| || |
How to check whether a .net button is disabled?
We are using QTP 9.5 version. Technology is VB.net. We need to check first whether a button is disabled before data entry in the text box and then whether it is enabled after the data entry in the text box.
I have used the following code:
If SwfWindow(windowname).SwfWindow(windowname).SwfBut ton(buttonname).GetROProperty("Enabled") = FALSE THEN
Msgbox("Button is disabled")
I have also included "Enabled" property as mandatory.
It is displaying as the property not found.
Any help regarding the above issue is greatly appreciated.
Re: How to check whether a .net button is disabled?
See below example:
Lets assume that 2 buttons are available on web page named
1) buttonEnable which in enable default
2) buttondisable which in disable default
test1 =Browser("XYZ").Page("ABC").WebButton("ButtonEnabl e").GetROProperty("disabled")
test2 =Browser("XYZ").Page("ABC").WebButton("ButtonDisab le").GetROProperty("disabled")
msgbox "ButtonEnable -- > " & test1 & "ButtonDisable -- > " & test2
ButtonEnable --> 0
ButtonDisable --> 1
So based on return values , you can further do coding.
Hope this will help you and solve your problem.