how do find current links in webpage for ex: in
yahoowebsite today mainpage is having 50 links and next day
same page is having 60 links. if i run same programe it
should display total links in webpage ?

Answers were Sorted based on User's Feedback



how do find current links in webpage for ex: in yahoowebsite today mainpage is having 50 links and..

Answer / badri

Above script for weblists

To count No of Links in webpage:

Set chobj=description.Create
chobj("micclass").value="Link"
Set obj=Browser(" ").Page(" ").ChildObjects(chobj)
'Count the no of objects
n=obj.count
msgbox "No of Links: "&n

Is This Answer Correct ?    11 Yes 0 No

how do find current links in webpage for ex: in yahoowebsite today mainpage is having 50 links and..

Answer / bkiranratna

Set oDesc = Description.Create()

oDesc("micclass").Value = "WebList"

Set Lists = Browser("Mercury Interactive").Page("Mercury
Interactive").ChildObjects(oDesc)

NumberOfLists = Lists.Count()

Is This Answer Correct ?    2 Yes 1 No

how do find current links in webpage for ex: in yahoowebsite today mainpage is having 50 links and..

Answer / u v r murthy

By using Page Check point also we could find out the total
link which are available in that particualr page.

Procedure: insert Standard check point then select any
object in the page, you will get Object selections popup,
there u can select page object, again you will get one more
popup called "Page Check point properties" in this popup
make sure that u have selected Links check box under ALl
OBJECTS IN PAGE then click ok.

Finally run the script. you will get the no of links
available in current used page in result window

Is This Answer Correct ?    1 Yes 0 No

how do find current links in webpage for ex: in yahoowebsite today mainpage is having 50 links and..

Answer / sudheerreddym

Set link obj=description.Create
linkobj("micclass").value="link"
Set link childobjs=browser("Yahoo").Page("Yahoo").chldobjects(linkobj)childcount=link childobjs.Count

for i=0 to child Count-1
msgbox link childobjs(i).getRoproperty("innertext")
next
if u want to click on the last link on that page:

browser("Yahoo").page("Yahoo").link(index:="&childCount-1).cclick
set linkobj=nothing

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

How to handle dynamic objects in quicktest professional (qtp)?

0 Answers  


How can we redirect QTP results in to a excel sheet after the execution

3 Answers   SAP Labs, Virtusa,


What is quicktest professional (qtp window?

0 Answers  


Can we do qtp testing without creating objects in Dbject repository? can we do it completely writing code i.e in expert view only. Are there any books for this?

7 Answers   Accenture,


where do you store the test result?

2 Answers   HCL,






Give one example of Standard checkpoint in qtp 10?

1 Answers  


How can i store runtime value through vb script while using qtp

1 Answers  


which tpye of exceptions mostly do we face in QTP

2 Answers  


What is API?

1 Answers  


when will you do debug your script? and explain that process?

0 Answers   Covansys,


If an application name is changes frequently i.e while recording it has name, in this case how does QTP handles?

1 Answers  


Count the number of radio buttons and randomly select one.

1 Answers   Deloitte,


Categories