Suppose there are 100 links in a web page and the number of
links will be changing dynamically from time to time. I
need code such that every time i had to click on the last
link of the web page.

Answers were Sorted based on User's Feedback



Suppose there are 100 links in a web page and the number of links will be changing dynamically fro..

Answer / amarendra kothuru

Below code will work for your case.

' Set a description object to identify links.
Set oDesc = Description.Create()
oDesc("html tag").Value = "A"

' Get a collection of links
Set oLinkCollection = Browser("test").Page
("test").ChildObjects(oDesc)
Set obj=oLinkCollection.Item(oLinkCollection.Count-1)
obj.Click

Is This Answer Correct ?    6 Yes 1 No

Suppose there are 100 links in a web page and the number of links will be changing dynamically fro..

Answer / kiran

set odesc = decription.create

odesc("micclass").value = "Link"

set n = browser("xxx").page("xxx").childobjects(odesc)

objcount = n.count

browser("xxxx").page("xxxx").link("index:="&objcount-1).click

Is This Answer Correct ?    5 Yes 1 No

Suppose there are 100 links in a web page and the number of links will be changing dynamically fro..

Answer / qtp

set odesc = decription.create

odesc("micclass").value = "Link"

set n = browser("xxx").page("xxx").childobjects(odesc)

objcount = n.count
n(objcount-1).click

Is This Answer Correct ?    0 Yes 0 No

Suppose there are 100 links in a web page and the number of links will be changing dynamically fro..

Answer / kishore

set odesc = decription.create

odesc("micclass").value = "Link"

set n = browser("xxx").page("xxx").childobjects(odesc)

objcount = n.count

browser("xxxx").page("xxxx").link("index:="&objcount).click

Is This Answer Correct ?    5 Yes 6 No

Post New Answer

More QTP Interview Questions

How to handle Dynamically changing Objects in QTP?

4 Answers  


Hi cud you plz answer my question.. what is the size of Object Repository?

8 Answers   TCS,


HI, Anybody can explain Automation Test Framework...and wht do we do before start of Automation.....

5 Answers   Polaris, Siemens,


plz explain QTP real time work( Means where you store scripts and how u access scripts next day? where those activities we are maintaining, If By usig VSS how the process in going on , plz explain briefly?

2 Answers   CTS, Tech Mahindra,


if you have the same application screen with 7 drop down boxes and approximately 70 values how do you test with QTP?

2 Answers   Ordain Solutions,


in qtp how i can retrive from a browser how many links are there.means total no of links used in a browser

4 Answers   Verizon,


Brief the process of testing with UFT?

0 Answers  


i'm testing the webpage with QTP, in this wabpage i have to choose the CV from the window, but QTP can't recognize the object, so i used the Low LEvel Recording, but every time i run the test, QTP go to halt when it gets to the Recorded part, any solution for that?( except puting delay in the script and manuall selecting, because i've did that)

0 Answers  


How to Synchronize the Browser at Field level? For example if you put Browser.sync(), its waiting upto for that Browser sync only. It should wait total Browser get upload with fields.

3 Answers   IBM, TCS,


How to get the format of a webedit class in qtp. How can i know that particular webedit accept what type of format like "mm/dd/yyyy" or "$" or Alphanumeric

0 Answers  


What do you mean by checkpoints in qtp?

0 Answers  


Currently i have designed my script based on the test cases present in Quality Center. I want to run my script from quality center. Can anyone help me to get the code which will connect QTP with Quality Center and execute the test cases?

1 Answers  


Categories