Micro Focus QTP (UFT) Forums
How to add a checkpoint to see if a button is disable or not - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: How to add a checkpoint to see if a button is disable or not (/Thread-How-to-add-a-checkpoint-to-see-if-a-button-is-disable-or-not)



How to add a checkpoint to see if a button is disable or not - kuldeepbh - 08-13-2010

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


RE: How to add a checkpoint to see if a button is disable or not - balaji4u - 08-13-2010

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


RE: How to add a checkpoint to see if a button is disable or not - basanth27 - 08-16-2010

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

if objbutton.getroproperty("disabled") then
      msgbox "warning"
else
     'your function
end if



RE: How to add a checkpoint to see if a button is disable or not - kuldeepbh - 08-16-2010

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..???


RE: How to add a checkpoint to see if a button is disable or not - basanth27 - 08-18-2010

Werent you able to do a replace ?


RE: How to add a checkpoint to see if a button is disable or not - venkatbatchu - 08-18-2010

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