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

what all are the coverages , explain ?

2 Answers  


I have a Webedit object. some text is entered in that object I want to know the font sixe of that text.How could I do this using QTP? This is a requirement for me. I am happy if any one help on this

3 Answers   GE,


in a web page How to check and display a particular word from a paragraph?

0 Answers  


How to write business scripts using object repository with different scenarios

0 Answers  


What are the challenges do we face while testing webbased applcations using the automation tool QTP or any?

1 Answers  


what is the difference between an Action and a function in real time

4 Answers  


how u write vb script in qtp pls give me some basic script and some material

32 Answers   Datamatics, UHG, Winit,


How do you invoke any application and write a script to invoke QTP using VB Script.

2 Answers   HealthAsyst,


What is the syntax to call one script from another?

0 Answers  


1. What is the difference between Keyword and function in the keyword driven framework? 2. How do you associate Keywords to the script ?

0 Answers  


How to use Regular Expressions in QTP

1 Answers  


write script for finding number of broken links in web page? kindly please answer my question.

3 Answers   Manhattan, Oracle, Virtusa,


Categories