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

Hi I am from delhi, Now I can surely say that no institution of QTP here in Delhi After reading you people I want to get cry, from last six month I am trying to learn QTP, I have knowledge too but dont know VB Script. Now it appears that without learning QTP no one can learn complete QTP, I want to get a formal learning in QTP. Can you suggest me the best institution. and please let me know the charges and span of the course too. thanks in advance to you alkaa.dugaal@gmail.com

1 Answers  


Hi Guys...I just started working with QTP now.The frame work they use hear is Write all the functions in function libraries and pass data using data dictionary either from data table or excel .I kind of understood evrthing but one thing I need to know is How do they recognize objects .Do they use object spy and recognize objects or record them ..Does soemone have any idea how they generally do this is such kind of framework

0 Answers  


Hi, How to give drop down values as input [Variable] from data table in QTP? If u know share with me.

3 Answers  


In QTP how can we recognize objects Without using Object Repository?

3 Answers   IBM, Wipro,


Hi all. Could anyone tell me the difference between an Action and a Function in QTP. Thanks in advance and Merry Christmas.

3 Answers   IBM,


What is the extension for Recovery scenario?

2 Answers  


plz anybody tell me how to explain the architecture of one particular project.plz give me answer for this.....RAJESH

7 Answers   TCS, Wipro,


Hi Every body please explain me in steps to use checkpoints and object Repositories in QTP for Flight Reservation application please tell me the steps for this its urgent pls thanx for urs answers

0 Answers  


QTP9.1 does not support to text checkpoint in Windows application? Is this correct? If this is correct, what is alternative for Text checkpoint?

2 Answers  


What is difference between shared and local object repository?

0 Answers  


How to create configuration scripts

1 Answers  


How can we fill data in a text box without recording using object spy. Can you please provide the steps...

1 Answers   Hotel Jobs, TCS,


Categories