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


Please Help Members By Posting Answers For Below Questions

How you calling actions in qtp?

829


What is output value? How many types of output values are there in qtp?

789


write a script to verify the image path(src property) of the images which are in web pages.

1983


what is Property......End Property loop? how to write sript for it in QTP

2126


How does you pass optional arguments in qtp?

779


What is the standard timing delay for web based application in qtp?

826


Which HTML specification will be adhered to? How strictly? What variations will be allowed for targeted browsers?

777


How will we compare the texts in the two word files using QTP writing the script in Descriptive Programming. Thanks

1775


With what extension you can save the list of tests in a file to run in test batch runner?

767


How will you check that your test cases covered all the requirements?

784


Hi All, I need code for how to execute qtp scripts from excell sheet

1669


I am getting the "test object property" Description properties "toolkit class" value By using "gettoproperty" in run time But my problem is how to get Ordinal Identyfier's type and value Type is index, value is 0 How can i keep this values in to required place How can i get these values in runtime I have to insert these "index" and "value" into another area Is there any script for this like "gettoproperties","Getroproperties" If anybody knows,please help me .

1954


what type of automation is follwed in the project?

1708


can any one please tell me which is the best institute in Bangalore to learn QA (crash course)? Thanks

1740


Why to use descriptive programming?

772