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

How can we log a defect in Testdirector from Q.T.P ?

2 Answers   EDS,


how can we perform web datatable operations on webpages(Like rowcount,col count,cell data)?

2 Answers   Syntel,


How do you handle XML exceptions in QTP (Here it is Exception, not the checkpoint)

2 Answers   CFC, CTS,


give one example where you have used regular expression?

6 Answers   Ordain Solutions,


how to create external data table?

1 Answers   TCS,






what is a active x control?can any one brief me about active x controls

1 Answers  


write vbscript in qtp tool for senario, in the given sheet add each number in each row and each colunm and show result

3 Answers   Mind Q Systems,


How can we merge two repositories? Can we merge two differnt rep. I mean 1is peraction and other shared

4 Answers   Tavant Technologies,


can we create recorset with out using database connection in vbscript?

1 Answers   CSS, CSS Corp,


How does QTP identifies the object in the application

6 Answers   Convergys,


why use Description programming? what is advantages and disadvantage of this methods?

2 Answers  


how can i change the action path that called in other action. when i copy one action to other pc,the action"test2" calls another action(C:\test1\action0),and i update this"test1",the folder update to "action1",but when i open "test2", it just point the call path to "C:\test1 \action0", but does not update to "action1",and the change i make can be shown in test2. so, can i update the call path manully? thanks

2 Answers   HP,


Categories