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

What is the difference between driver-script and AOM-script?

2 Answers   IBM, Value Labs,


I want some banking domain projects where can i get this projects ( anybody can help me plz)

3 Answers  


before launching qtp, we need to close all the open browsers u dont know what are all the browsers either it might be ie,mozilla etc and u dont know how many brosers are open.... u need to close all these before launching qtp.. can anyone plz temme d solution...

2 Answers   Keane India Ltd,


What is the Limitations of Testing ?

4 Answers   TCS,


How to Import data from a ".xls" file to Data table during Runtime.

1 Answers   Crea,






Please tell me the steps to record the test in Analog recording mode in QTP version 9.2???

2 Answers  


How can we translate the steps between the Keyword and Expert Views?

1 Answers  


The structure of keyword driven frame work is like a folder structure the different sub folder are 1-functional libray folder 2-object repository folder 3- database folder 4-appliction1.xls 5-initalzation vbs file 6-sequence file 7-driver script 8-test case list file My question is whether these are in a local server machine or in our pc.((whether It like Vss). can u give example of driver script(code)

0 Answers   TCS,


Where you can store check point results?

3 Answers  


In Object Repository, two actions r there. Action1 name is A.tsr, Action2 name is B.tsr. Is it Possible? if Yes, what is the out put of A+B? if No, why?

2 Answers   Kanbay,


Can you list some technologies that support qtp?

0 Answers  


How to add a page checkpoint to your test?

1 Answers  


Categories