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
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 |
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 |
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 |
interviwer asks what is data table? my ans is Data table is an internal Excel file of QTP...intervier not happy with this also? can u post any other answer?
What is Performance testing?
1. I have asked the same question for the third time, but i am getting wrong answers. Pls give me the script to count the number of edit boxes or checkboxes in an windows application screen. In windows application childobject is not working, anyone very urgent
Which line will be executed 1-B(DP).P(OR.link(DP) 2-B(OR).P(Or).Link(DP)
Explain the difference between check point and output value?
How we can add actions in the test using QTP?
How can we close all webbrowsers which are opened in out desctop?
is qtp 9.2 supported for firefox browser3.0?bcoz when i tried to create scripts with the application run on firefox browser 3.0 then qtp 9.2 didn't ct=reate the scripts?
How many types of Test Plans are there...??
What is the differences between image check point and bit map check point?
In Datatable having the data like this S.no Name Address 1 raj hyderabad 2 suresh Mumbai 3 shyam chennai 4 dev banglore i want to get the shyam row id & column id using scipting i.e 3,3
How to run scripts 1,29,3,5,7,2 scripts using test batch runner in QTP.... Ie...I wanted to run scripts not in an order 1,2,3,4,5...like that How it is possible using test batch runner... I dont want hardcoded script