Follow Our FB Page << >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

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
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


If iRes=1 Then
MsgBox ("All buttons are enabled")
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

How to use transactions in qtp?

0 Answers  

How to Set the Global Sync Timeouts in QTP?

2 Answers  

HI. AnyBody can explain Automation Testing Framework...Generally wht do we Intiate before going to start Automation testing process... Anybody can explain.......Thanks in advacne...

1 Answers   HCL,

How Qtp will identifies object during run time

6 Answers   CSS Corp, Yahoo,

How we can test a Frame in a web page?

1 Answers   eMids,

Where to use function or action?

0 Answers  

what is flag=0 in qtp tool.. i am strugglin to use flag function , exactly when it is used , any real time expert pls explain clearly?

1 Answers  

what does it mean when a check point is in red color? what do u do?

4 Answers  

how to add run-time parameter to a datasheet?

1 Answers   Mphasis, Ordain Solutions,

What is the use of sendkeys and what are send keys

0 Answers  

Error handling

3 Answers   Wipro,

how to fetch the values from grid? & qtp recogniges that grid as a webelement? what u do?

0 Answers   IBM,