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 are the different kinds of test steps?

788


What is environment variable in qtp and why to use it?

741


When using descriptive programming?

823


How to do the scripting. Is there any inbuilt functions in qtp as in qtp-s.

717


What is the difference between run time object and test object in QTP?

785


How to data driven test for Win objects in QTP ?

1663


hi all can any body explain how to write the script for finding the mandatory fields which are having [red Astrik sign (*)]

1666


Should have experience in framework means?

1619


whow much strong on VB and C?

1676


what is supply chain management?

2325


What is the difference between keyword view and expert view?

837


what is the difference between data driver & data driven and driver script?

2408


What is the diff between image and bitmap check point?

767


Key word driven framework

1900


I have developed and executed a script successfully, and saved the same to QC. When I tried to execute the script from QC, the script is not executing. What are the possible reasons?”

784