0

I want to verify if a button is clickable, so I tried using the following :

def save_button_status(browser):
    button = browser.find_element_by_class_name(save_new_pass_button)
    print button.is_enabled()

But it is not verifying the button status, all I can understand from this code is if the button is enabled

5
  • What do you mean it is not verifying the button status?? is there any exception?? Commented Feb 14, 2017 at 8:24
  • I want to verify if I can click on the button or not Commented Feb 14, 2017 at 8:28
  • So what are you getting at this line button.is_enabled()?? Commented Feb 14, 2017 at 8:28
  • The answer i get is None in two different conditions. Commented Feb 14, 2017 at 8:35
  • If the button is clickable and if not i get the same answer Commented Feb 14, 2017 at 8:36

1 Answer 1

4

To check if the button is clickable you need to check two conditions: enabled and visible

def save_button_status(browser):
    button = browser.find_element_by_class_name(save_new_pass_button)
    print button.is_enabled() and button.is_displayed()
Sign up to request clarification or add additional context in comments.

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.