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

Define object spy ?

0 Answers  


How will u find that how many List boxes( and check boxes) are present in one particular window

8 Answers  


Hi, Where should I get all the test's results If I ran the scripts in Batch run. At the result window I found only last test result. Could any one help me on this?

3 Answers   Livetek,


how to get the particular chr in an array list the question is ....i have an array like this ABCD EBCF GBCH IBCJ HERE I NET TO GET ONLY "BC" FROM ALL HOW TO GET IT HELP ME ANY ONE THANKS

6 Answers   Cap Gemini,


I've some problem in Descriptive programming plz help me. I've written in a click event code in Functional library when I run this flight reservation program It is not run. How to I write multiple click event in functional library. My program is this. I have associate an action with functional library. Public Function ClickButton(byval ApplicationName, byval WindowName, byval ObjectName, byref Comments) If Dialog("text:=" &WindowName).WinButton("text:=" &ObjectName).Exist Then Dialog("text:=" &WindowName).Activate Dialog("text:=" &WindowName).WinButton("text:=" &ObjectName).Click Elseif Window("text:="&ApplicationName).WinButton("text:=" &ObjectName).Exist Then Window("text:=" &ApplicationName).Activate Window("text:=" &ApplicationName).WinButton("text:=" &ObjectName).Click End if End Function

2 Answers   Amdocs,






How can we do Data driven testing Using For loop in QTP?

2 Answers  


hi what is the use of "dim" in automation objective model or any where what is the use of "dim" plz tell me

3 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 Test Dynamic links ?

4 Answers   Wipro,


How to change the run-time value of a property for an object?

3 Answers   Crea,


How we can merge the object repositories?say if we have 2 or 3 object repositories then how we can merge them?Is there any option in QTP to merge the object repositories?

2 Answers  


What is the extension of qtp local repository?

0 Answers  


Categories