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
Which functionalities of QTP used in banking project?
What is the difference in the global and action sheet in qtp?
How to use transactions in qtp?
How can i check items sorted or not in a weblist ? Give me the script for this...
what is vmodel?advantages and disadvantages of vmodel?
What is the difference between qtp and selenium?
After executing the script in qtp suppose i found some script execute successfully and found some error.So how to report the status for both (i.e pass and fail report)in test director. For "fail" We use "defect tab" in testdirector. But for "pass" how to report it to TL.what is the process plz anybody ans
is it possible to add sheets to excel at runtime
What are the benefits of quick test pro(qtp)?
how can you do retesting (datadriven test) using notepad amd by using functions NOTE u should not use datatable methods
Where we use data driver in qtp?
What is synchronization point in QTP?
How to carry out bit map check points in QTP
What does mean by Scope of Automation?n How we defined it?
Hi,All How to create a link in excel sheet using qtp