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 data types in qtp?

0 Answers  


what are the different kinds of frameworks in automation?

1 Answers   Accenture,


How to use the object spy in quicktest professional (qtp) 8.0 version?

0 Answers  


can any one tell me what is process metrics and what is product metrics if possible give me example. Thank You

2 Answers  


some times we write user define functions.where we write main and sub program,how,where to insert the functions in qtp?

2 Answers   GE,






how open two urls in one browser? plz urgent

9 Answers   Satyam,


What are the Features & Benefits of Quick Test Pro ?

1 Answers   Crea,


Can I use datatable of Action1 in the Action2.

2 Answers   IBM,


What are private functions in QTP? How they can be called from the function library?

0 Answers   HCL,


Hi, i am mallishwari, i am veryn ew to testing but i have very much interest in testing. plse give me some guidence to get the job in testing. send me required documents and faqs to my personal id: mallishwari_urs@yahoo.co.in thans for advance.

2 Answers  


HI, pls help me on this, iam not able to capture getcelldata value in javatable... msgbox javawindow("").javatable("").getcelldata(3,3) but it diaplays empty...

0 Answers  


How to explain a banking project in interview as a test engineer???

0 Answers   Accenture,


Categories