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.??

Answers were Sorted based on User's Feedback



Can you give me the code to calculate the total number of Links using the child object in the web ..

Answer / nanda

Hi Uday,

its nice answer. keep it.

and also u can use html tag instead of micclass..

like

linkDescObj("html tag").value="A"

it will perform same functionality.

Is This Answer Correct ?    3 Yes 0 No

Can you give me the code to calculate the total number of Links using the child object in the web ..

Answer / 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

More QTP Interview Questions

what are the principles of good testing scripts for automation?

1 Answers  


what could go wrong with test automation?

0 Answers  


Suppose there is a link present somewhere in an excel sheet. Find the link and click on it. How to write a script using Excel application object in QTP?

1 Answers  


Explain about Test Fusion Report of QTP?

0 Answers  


If an application name changes frequently i.e while recording it has the name, in this case, how do qtp handles?

0 Answers  






Can Any One Write How to Write the Script for Child Objects

4 Answers  


how do u copy object repository?

1 Answers  


After the execution of a script how do u upload the results to Quality Center. Pls anyone explain in detail. It is very urgent._______Thanks a lot!!

2 Answers   ABC,


i have a doubt can anyone tell me where are scripts stored while using QTP.Tell me the exact procedure takes place in real time?like how we call scripts how to proceed after writing scripts?how scripts are executed etc?i heard some use Qc whether others dont use.so tell me whole procedure for both the things it will be a very big help.as i have interview i want to have whole idea on this.its very urgent.

0 Answers   RR Donnelley, RRDonnelley,


can objects recogonised without repository?

10 Answers   AZTEC,


Is the provision for integrating QTP with QC ,available from the version 9.0 onwards only or even 8.2 version has such provisions?

1 Answers  


what is KEYWORD DRIVEN TESTING ? I M NOT ASKIN WHAT IS KEY WORD VIEW PLZ ANS FOR ONLY WHAT IS KEYWORD DRIVEN TESTING EXACTLY THANX

3 Answers  


Categories