How to define the Disabled 'Button' property in Watir

How can I check the button property, disabled or not? The statement below is sufficient for its existence,

@browser.frame(:name => 'MainBody').button(:text => 'Submit').exists? 

.. can someone let me know how I should check out a disconnected property? Thanks!

+4
source share
2 answers

@browser.frame(:name => 'MainBody').button(:text => 'Submit').enabled?

+4
source

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 how to choose def add this:

 def enabled? !disabled? end 

Did this work for me since watir-webdriver doesn't know about .enabled ? for select_lists options.

0
source

Source: https://habr.com/ru/post/1399216/


All Articles