Reputation: 37
How can i check the property of a button whether it is disabled or not? The below statement is sucessfull for its existence,
@browser.frame(:name => 'MainBody').button(:text => 'Submit').exists?
.. can someone let me know how should i check the disabled property? Thank you!
Upvotes: 4
Views: 3534
Reputation: 1
In watir-webdriver
this can be done by editing the file: C:\Ruby193\lib\ruby\gems\1.9.1\gems\watir-webdriver-0.6.1\lib\watir-webdriver\elements\option.rb
and before the def select, add this:
def enabled?
!disabled?
end
It worked for me, as watir-webdriver doesn't know about .enabled
? on options for select_lists
.
Upvotes: 0
Reputation: 4053
@browser.frame(:name => 'MainBody').button(:text => 'Submit').enabled?
Upvotes: 4