How can i check all the button that are enabled in a
widnows based application ? What script should i write for
this ?



How can i check all the button that are enabled in a widnows based application ? What script sho..

Answer / jay prakash

Try this... i am writing for "Flight Reservation" sample
application. You can coustomize for your own requirements.

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''SCRIPT STARTS HERE'''''''''''''''''''''''''

Dim i, j, iRes
j=0: iRes=1
Window("Flight Reservation").Activate
Set oDesc = Description.Create
oDesc("Class Name").value="WinButton"
Set oChild = Window("Flight Reservation").ChildObjects
(oDesc)
iCount = oChild.count

For i = 1 to iCount

strBtnStatus = Window("Flight
Reservation").WinButton("Class Name:=
WinButton", "index:="&j).GetROProperty("enabled")
j = j+1

If strBtnStatus="False" Then
iRes = 0
Exit For
End If

Next

If iRes=1 Then
MsgBox ("All buttons are enabled")
Else
MsgBox ("All buttons are not enabled")
End If

Set oDesc = Nothing
Set oChild = Nothing

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''SCRIPT ENDS HERE''''''''''''''''''''''''''''

Please let me know if it satisfies your requirement.

Is This Answer Correct ?    5 Yes 0 No

Post New Answer

More QTP Interview Questions

where do you store the test result?

2 Answers   HCL,


can any one please tell me which is the best institute in Bangalore to learn QA (crash course)? Thanks

0 Answers   iFocus,


How to get line numbers in your editor in expert view?

2 Answers  


Write the code for select the 5 values from drop down list. drop down list having the 10 values.

6 Answers  


What u say as experience(Interview) "TELL ME ABOUT UR SELf"? As a Fresher(interview) What u Say?

3 Answers   ShopRite,






w is output value

3 Answers   MBT,


in login module login button chage regularly(means login button change to submit button).What is the code for it.

3 Answers  


What is difference b/w AOM,DOM,COM Have u ever is used ny of the models.If so why?

1 Answers   GE,


what r the verstions from 1st to present (verstions) of mercury tools (like winrunner,QTP,Loadrunner) ? Chandana

0 Answers   Mannar Company, Wipro,


What is the main disadvantage of using low level and Analog modes?

2 Answers  


Any limitation to XML Checkpoints?

1 Answers  


how to lunch the application in the qtp tool ?

3 Answers  


Categories