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 can you do retesting (datadriven test) using notepad amd by using functions NOTE u should not use datatable methods

1379


How to Open FireFox using descriptive programing? If my question is not clear, i will give an Example To Open Internet Explorer, We use Set IE = CreateObject(InternetExplorer.Application) IE.Navigate "www.yahoo.com In the same i need to open yahoo.com in firefox. Can any one tell me what is the server name of firefox to create an object

2528


How smart identification works in qtp ?

575


How many types of actions are there in quicktest professional (qtp)?

534


Explain the use of action split in qtp?

565






Client is able to provide budget..he want you to choose the automation tool for the web application? which one you will select ? QTP or Selenium ? what are the reasons?

1229


What is QTP scenario.

1731


What is keyword view in qtp?

548


Discuss quicktest professional (qtp) environment?

577


action contains public and private functions but do we resuable that action or not..If it is reusable How..plz tell me the ans

1628


What are the various types of Actions in UFT?

591


What is an expert view and keyword view?

569


explain abt dyanamic changing object with example?

1899


What are the Disadvantages of shared object repository?

569


If you have two monitors one is of 19inch and the 2nd one is of 24inch,if you want to write same QTP script in both the two monitors is there any changes required in the script?

1583