0
<input type="submit" id="edit-save-m" name="save_m" value="Save my thing" class="form-submit ajax-processed saved-m-processed">

I need to verify with Python and Selenium if the button is disabled. Any ideas?

1
  • check the for the properties or class. I don't see any separate property so it has to be class.check which class makes it disable, seems like saved-m-processed class. If it's present element is disabled else not. Commented May 15, 2017 at 13:35

2 Answers 2

7

Try this:

element = driver.find_element_by_id("edit-save-m")
print element.is_enabled()

Prints true or false, based on element visibility.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for your time, but I’m getting an error: Failure: NameError (name 'driver' is not defined) ... ERROR ====================================================================== ERROR: Failure: NameError (name 'driver' is not defined) ----------------------------------------------------------------------
I even used from selenium import webdriver and it's strange, cause in PyCharm it looks like it's grayed out and the same error appears...
0

This worked for me:

className.Property.is_enabled()

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.