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

Explain runtime dynamic settings?

0 Answers  


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

1 Answers   Crea,


What information do the columns in the Keyword View show for each step?

1 Answers  


How to display the first 3 letters in these "ABCDEFGH" using qtp script?

6 Answers   Oracle,


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,






Hi all im having a pop up validation browser which is 20 in number, i want to close those similar pop browsers one after the other, is there any specific code for that? i tried by giving creation time & putting in a loop but it dint work? valid working answers will be greatly appreciated

2 Answers   McAfee,


What is reusable action?

0 Answers  


How do I modify a value of an elemnt which is not the first one in xml file? My sample XML file is like: <Environment> <Variable> <Name>Name</Name> <Value>Uday Kumar</Value> </Variable> <Variable> <Name>Designation</Name> <Value>Senior Software Engineer</Value> </Variable> </Environment> for example, I'd like to change the value 'Senior Software Engineer' to 'Student' in the second element. How do I do it in QTP?

3 Answers   QualiTest,


i have qtp 9.4 ver software.but i don't know the license key. if anyone have license key please send it to my personal mail id(munir.reddy@yahoo.com

0 Answers   Wipro,


Why you are Using Descriptive programming instead of Object Repository?

11 Answers  


Use of Multiple Actions in QTP?

3 Answers  


what is reusable action and how the same can be implemented (process)?

2 Answers  


Categories