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


Please Help Members By Posting Answers For Below Questions

What is the virtual object?

748


www.icici.com after this home page wll came, in this page what r the items we r going to test for manual and what the element we r test for QTP... explian clearly with example

1596


how to find that a file has been completely downloaded or not? I told that "download Complete" pop up. but he told the tool doesn't recognize the pop up

3917


What are the key points to create a framework in QTP for oracle forms?

1900


Is it possible to merge two object repository files in qtp?

714






What are the views available in qtp?

685


What are the types of data tables in qtp?

663


How you can delete excel file in qtp?

670


Can testing be done on the production system, or will a separate test system be required? How are browser caching, variations in browser option settings, dial-up connection variabilities, and real-world internet 'traffic congestion' problems to be accounted for in testing?

708


What is a Patch in QTP?

688


How to recognise the webelement and verifying that webelement is enabled?

1733


What is ‘object spy’ and what is the function of object spy in qtp?

661


What is object spy in quicktest professional (qtp)?

624


How will you compare keyword and expert view?

620


What is the keyword view and expert view in qtp?

644