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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

You will receive the mail in your outlook from client at night time to go ahead for the execution. Based on the mail you need to trigger the batch run. What is the QTP Code for this?

1319


what is the mail use of frame work(with detail). architecture for keyword driven frame work

1405


Whats the realtime QTP testing process

1982


distinguish between old version and new version QTP features.

1848


How will you check that your test cases covered all the requirements?

549






If u r using library files (Instead of Check Points) , How do u do bitmap check ?

1444


PLEASE TELL ME WHEN DO YOU USE THE OBJECT SPY AT RUN TIME

5911


What are the different recording modes?

547


How does quicktest professional (qtp) identifies the object in the application?

567


What is object spy in quicktest professional?

605


How many types of recording modes in the qtp?

579


What are the features of quick test pro(qtp)?

520


How to capture a window in QTP?

1515


in my application,validation message has in japanise language.how to validate this message is appears properly or not

1506


Get the count of files of similar types from a folder.

961