I'm using webdriver to test a specific page which sometimes will have options disabled in a form.
I'm trying to select the value directly, and then check whether or not it is enabled.
Here's what I have :
hourly = driver.find_element_by_xpath("//select[@name='frequency']/option[@value='HOURLY']")
self.assertFalse(hourly.isEnabled());
The full path is:
/html/body/div[@class='options']/form/select[@name='frequency']/option[@value='HOURLY']
When I run this snippet, I get the following :
AttributeError: 'WebElemet' object has no attribute 'isEnabled'
Which leads me to think that either:
isEnabled
in the API under the remote driver (http://selenium.googlecode.com/svn/trunk/docs/api/py/webdriver_remote/selenium.webdriver.remote.webelement.html), which wouldn't be the same thing since I'm just using Selenium Webdriver in Python.How To Verify Element is Enabled or Disabled in Selenium Webdriver? To verify that the target element (Button, Check box, Dropdown, text box, Radio Button, Icons, etc ) are enabled or disabled use isEnabled() Method to check element is enabled or disabled.
Nevermind, I've been googling so many different docs I forgot entirely just to read the api. The call should be :
is_enabled()
rather than
isEnabled()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With