how can i count the number of links???

Answer Posted / nalini

There are two ways to get the count of links on a page.

1) g=Browser("Google").Page("Google").GetROProperty("number
of links")
print g


2) set ld=description.Create()
ld("micclass").value="Link"
set lobj=Browser("Google").Page("Google").ChildObjects(ld)
c=lobj.count
print c

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

one screen page,that contains file , browse , update and cancel buttons.when we browse a file it should get update otherwise it should go to previous page.write negative test case for that.

1513


How can we retrieve the Bug Ids which are open&Reopen in status through QTP scrit?Please find the script which i tried... Dim objBugFactory, objBug Dim BugId Set TDConnection = QCUtil.TDConnection Set objBug = TDConnection.BugFactory If QCUtil.IsConnected then Reporter.ReportEvent 0, "Connected", "Connected to server: " + QCUtil.TDConnection.ServerName + chr (13) +"Project: " + QCUtil.TDConnection.ProjectName + chr (13) + "Domain: " + QCUtil.TDConnection.DomainName Reporter.ReportEvent 0, "Current time on server is","==>" & TDConnection.ServerTime Else Reporter.ReportEvent 1, "Not connected", "Not connected to Quality Center" End If If mybug.Status="Open" Then BugId=mybug.DefectId MsgBox BugId End If 'OR**********************************--------------------- -----********************************** If Bug_Fields("BG_STATUS").Value ="Open" Or "Re Open"Then BugId=Bug_Fields("BG_BUG_ID").Value MsgBox BugId End If

2564


Tell some commonly used Excel VBA functions?

587


Can anyone share/send me QTP 8.2 Crack as I had it before but now it's virus affected. Pls send me on Sawale.vijay@gmail.com Thanks, ~Vijay

2652


What VBScript operators, functions, and statements do you use in QuickTest Professional?

2162






How did you resolve conflicts present in Object Repository?

1609


What are main panes available in qtp test browser?

528


Where to use Property Let, Property Get, Property Set in UFT

365


When to use descriptive programming?

582


Excel sheet having some datas and some datas present in the application (in table). How will you compare these two datas? Write code to fetch datas from Excel sheet.

1487


I want to do Certification course in QTP. For this I request you to suggest the best Tutorial in PDF format, if possible, kinldy mail PDF file to my mail-ID: ramakrishna908@gmail.com Regards, krishna.

1458


How to export quicktest professional results to an .xls file?

564


I used child objects to get the no of weblist present in the weblist.now i need to select the items present in each weblist ?How to do so

2244


Hello, Is there any way to send the test results in html format (or any other) by email using outlook after the test run ends? thank you in advance

1733


i can done the project with QTP in that time i can say how many members in my team size?

1358