Python/Webdriver Check Select Option is Disabled
python, selenium, webdriver
Solution
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()
Problem
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: - I'm selecting the wrong thing or.. - The thing I'm selecting isn't actually a WebElement as I could only find reference to `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.