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

What are the different types of checkpoints?

577


how to test Web application using QTP software

1328


Limitations in QTP?

1735


Explain Descriptive Programming Types with Examples?

920


I am facing an issue of object identification with the dropdown element of DHTML grid. When I tried to recognize these different dropdown objects, QTP identifies only one object for all the dropdowns. Hence, selection of different data from different dropdowns list is an issue. To overcome this problem, i have used Descriptive Programming technique by creating different object descriptions which have all the other properties same but differ only in one property i.e. ‘X’ location of the element on the screen. Hence, i have created distinct object descriptions that would allow us to select values in different dropdowns. The code is given below. But still I am unable to identify distinct dropdown objects. ‘Object Description for Dropdown Cell Status Set objCellStatus = Description.Create objCellStatus("micclass").value = "WebList" objCellStatus("name").value = "select" objCellStatus("x").value = 219 ------ ‘X’ Axis value for cell status drop down ‘Object Description for Dropdown Sub Segment Set objSubSegment = Description.Create objSubSegment("micclass").value = "WebList" objSubSegment("name").value = "select" objSubSegment("x").value = "319" ------ ‘X’ Axis value for sub segment drop down Please help... This is specific to DTML grid(Drop down object)

1404






how to prepared for first for the first interview?

1790


how to fetch the values from grid? & qtp recogniges that grid as a webelement? what u do?

1900


What is the XML file architecture ?

1544


what is defenetion of kiran can u tell me plz CVS, SVN

1564


Explain the concept of object repository and how QTP recognizes objects?

544


How does QTP identify an object?

607


i have to login into gmail loginpage i have to pass testcase into userid and password by using functions. the test case of user id is it should take only lowerletters alphabetin between 4 to 6 length.it should not take spectial letters.it should not take numbers.testcase for password is it should take numbers and it should not take alphabets note the following things must happen 1 when i give correct password and userid that password and userid should be seen in QTP result and notepad,xl sheet 2 when i gave in valid password the system willgive message please give valid password that particular messaage should be seen in QTP result,norepa and xl sheet

1750


I have two For loop, first For loop does is creates a customer and input the customer info and then the second for loop within the first for loop does the follows which is capture the customer name and verify the with the data within the datatable. The problem I am coming across is that when it goes through the second time creating another customer and then verify the second customer then it creates the following during runtime. I want is to have the customer2 below Customer1 under the Customer_from_Apps. Any help will be greatly appreciate it. Customer Customer_from_Apps Customer_from_Apps1 Customer1 Customer 1 Customer2 Customer2 Window("Customer Desktop").Window("Customer Tracking (Privacy").WinObject("TreeView20WndClass").Click 92,244 runtimevalue = .VbTreeView("vbname:=AppServerTree").GetROProperty("Selectio n") Customer_Val= Datatable.GlobalSheet.AddParameter ("Customer_from_Apps",runtimevalue) row=datatable.getsheet("Global").GetRowCount For x=1 to row datatable.SetCurrentRow(x) Data_Val=Datatable.Value("Customer",dtGlobalSheet) If (trim(Customer_Val)=trim(Data_Val)) Then Reporter.ReportEvent micPass, "Customer validation successful", "Actual Value: " &Data_Val&vbcrlf& "Customer Value: " &Customer_Val else Reporter.ReportEvent micFail, "Cusotmer validation unsuccessful", "Actual Value: " &Data_Val&vbcrlf& "Customer Value: " &Customer_Val End If Next

1327


How can you identify the browser and its information using the qtp script?

575


Does QTP10 supports Windows 7OS +IE 9 combination? Which is the preffered combination ,Plz let me know?

2968