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 action?
Why qtp the best testing tool?
Can UFT be connected to Quality Center? If ‘Yes’ brief the process or steps.
What are the types of data tables in qtp?
what is stepin & stepout?
What is object spy in quicktest professional (qtp)?
I want to do Certification course in QTP. For this I request you to suggest the best Tutorial in PDF format, if possible, kinldy mail PDF file to my mail-ID: ramakrishna908@gmail.com Regards, krishna.
What are the differences between table and db checkpoints?
What environment does qtp run in?
What is an expert view and keyword view?
What are the key elements available in test result window?
How to upload excel files into Quality Center using QTP Script and how to delete excel files from Quality?
How can I check if a environment variable exist or not?
How to add object to object repository in qtp9.0 Suppose for brower yahoo home page
what difference between runtime object and text object and what property they have. whether they have same properties or different properties.