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

X flies from Hyd to bangalore using different methods of transportation. write the test scenarios and test cases for this?

0 Answers   Virtusa,


How to analyzing test results using quicktest professional (qtp)?

0 Answers  


What is test object model in QTP?

1 Answers   Crea,


How will you test a stapler?

0 Answers  


I used Child objects to get the count of the no of weblist present in the page.now i need to select the item in the weblist..Please send me full code

1 Answers  


What is optional step in qtp? How you can add optional step in qtp?

0 Answers  


For ex we are doing automate testing in that can we do some part of application recording, some part descriptive programing and some part general VB scripting like that .............

3 Answers   Satyam,


What is the difference between qtp and selenium?

0 Answers  


How can we parameterize our test, values in flat file. Ex:- Values in notepad, with that values i want to parameterize the test.

3 Answers   Ordain Solutions,


How to Run a Test using QTP?

1 Answers  


hi i have one doubt i have 4 yrs exp in testing and iam working one mnc in north but i have completed my degree correspodene is the companies are accept in south side some people are tellig they won't agree but i need correct answer plz let me know which companies are taking and not taking thanks in advance

8 Answers  


what are the mandatory properties in qtp? what are the library functions in qtp?

3 Answers   Wipro,


Categories