Micro Focus QTP (UFT) Forums

Full Version: How to add a checkpoint to see if a button is disable or not
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a app designed in CAA for which i want to check if a particular button is disable or not. My scenario goes like; if the button is disabled then continue with next step or else give a warning and still continue....

Please help..

Thanks is adv...Smile
Hi .

What is CAA?
To check the status of any element for instance a button in your case . You have to make sure whether the property of that object is actually enabled by the developer if that is the case you can query that property value and design your scenario.
For instance lets take a particular scenario which should enable a button on a screen on triggering an event, in such case the developer sets the value of that object to be true or false and if you query this property value you will get the answer for your question.

Regards.
Balaji
Code:
set objbutton = browser().page().frame().webbutton()

if objbutton.getroproperty("disabled") then
      msgbox "warning"
else
     'your function
end if
Is this related to web browser button, i am using a windows app. where i have recorded my scenario....i want to check if a button is disabled or not...here is a part of my code:

Code:
Window("My App").WinMenu("Menu").Select "<Item 2>;<Item 1>"
Window("My App").Dialog("Login to ENOVIA V6").WinEdit("Separator").SetSelection 0,15
Window("My App").Dialog("Login to My App").WinButton("Login").Click
Window("My App").WinMenu("Menu").Select "<Item 2>;<Item 2>"
Window("My App").WinMenu("Menu").Select "<Item 2>;<Item 1>"
Window("My App").Dialog("Login to My App").WinEdit("Separator").SetSelection 0,15
Window("My App").Dialog("Login to My App").WinEdit("Separator").Type  micTab
Window("My App").Dialog("Login to My App").WinEdit("Password").SetSecure "4c64d533a35df20a60ddc622"
Window("My App").Dialog("My App").WinButton("Login").Click
Dialog("Login Error").WinButton("OK").

Suppose here WinButton("Login") is disable and i want it checked then what code should i give..???
Werent you able to do a replace ?
Hi,

Code:
blnpropertyvalue=Dialog("Login Error").WinButton("OK").GetRoProperty("enabled")
Code:
If blnpropertyvalue="True" Then
Msgbox "Enabled"
Else
Msgbox "Disabled"
End iF
Please let me know for further clariication.

Regards,
Venkat.Batchu