Interview Questions   Tutorials   Discussions   Programs   Videos   

QTP - In one page we have 100 links I have to click the 99th link how can I click the 99th link?




1141
views
asked marvit October 10, 2014 10:02 AM  

In one page we have 100 links I have to click the 99th link how can I click the 99th link?


           

1 Answers



 
answered By Hitesh-1047   0  

You can follow are below code

Dim objLink, objCollection

Set objLink=Description.Create()

objLink("micclass").Value="Link"

'all the links collection will be stored in objCollection array

Set objCollection=Browser("Name:=Google").Page("Title:=Google").ChildObjects(objLink)

linkCount= objCollection.count 'although it is given that linkCount=100

'clicking the 99th link

Browser("Name:=Google").Page("Title:=Google").link("index:=linkcount-1").click

flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert