Can you give me the code to calculate the total number of
Links using the child object in the web page..? is there
any other way to calculate number of links with out using
the Child objects.??
Answer Posted / uday kumar_anem
Set fileSysObject=createobject("Scripting.FileSystemObject")
Set
linksFileName=fileSysObject.opentextfile("D:\samplelinkfile.txt",2,true)
Set linkDescObj=description.Create
linkDescObj("micclass").value="Link"
Set noOfLinks=browser("Browser").Page("Yahoo!
India").ChildObjects(linkDescObj)
For i=0 to noOfLinks.count-1
linkName=noOfLinks(i).getROProperty("name")
linksFileName.writeline(linkName)
Next
linksFileName.close
Set fileSysObject=nothing
Here i am retrieving all the links in Yahoo home page and
writing the link names in a text files.
If you wish to verify the number of links a web page, you
can use "Standard Checkpoint".
Click on Record button ->Insert Menu -> Check point
->Standard Checkpoint -> Click on any place in the page and
select the page in the Hirarchy and observe the number of
links property/value. If the total number of links are
increased or decreased, then it will show the differences.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is the qtp testing process?
Client is able to provide budget..he want you to choose the automation tool for the web application? which one you will select ? QTP or Selenium ? what are the reasons?
Explain in brief about the qtp automation object model (aom).
how to evalute defects in QTP script?
How is test case write?
How to use setroproperty?
Consider one application is open, clicking one menu will open another application in another browser. QTP does not catch the URL of the second browser(second application). can we capture it ?
What is the difference between byref and byval in qtp?
How to execute a winrunner script in quicktest professional (qtp)?
What is the extension of QTP local Repository? If it is .mtr then what is .bdb extension stands for?
Hi, Can we open a test in qtp10 which is saved in qtp 9.2?
What should we say if interviewer asks "What is ur project architecture?".......Can any one help me with clear information.?????????
Do you know how to connect database? Can you tell me the procedures?
Hi, I'm a beginner in QTP and planning of a certification in QTP, but have no idea about it :P. Could anyone please tell me what certifications that a QTP- beginner can take? What is the fees and the syllabus for the certification? Please reply soon. Thanks Vidhya
What is the pros and cons between QTP and Rational Robot