Write a user defined function to count the no. of buttons
existed in a webpage ? i dont want to use descriptive.create
()
Answer Posted / geetha
Set list = browser("XYZ").Page("ABC").ChildObjects
countbutton (list) 'Pass the object to function
Function countbutton(allitems)
cnt = allitems.count
num=0
For i=0 to cnt-1
name1 =allitems(i).getroproperty("micClass")
If name1="WebButton" Then
print "position of web button is " &i
num = num+1
End If
Next
print "count of webbuttons present in a page are" &num
End Function
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are the ways you can synchronize?
how to know no.of mails in our g mail by using vb-script
Brief the process of testing with UFT?
How to get the particular property value?
i have doubt suppose iam purly working in manual, when i will get work to do on sql and performence testing? pls any one clarify doubt?
If the weblist is identified as webelement,and by clicking on webelement if the values are displayed,and if the values the values also identified as webelement.then how to fetch the values through script?
What contains Data Driven Framework document in qtp?
What is the difference between keyword view and expert view?
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
What are the differences between quicktest professional and winrunner?
What are the five challenges you faced in QTP?
What is difference in global and action sheet in qtp?
i am new QTP... please tell me automation frameworks , types & for whiich type of applications frameworks are used & how to generate script in keyword driven framework
How do you capture tooltip using QTP?
What are the different types of recording modes?