1

While writing a code many time any of them get failed. How actually those methods work? Please great if you can help to stop confusing between those two.

Q - What is the real difference between methods isDisplayed() and isEnabled()?

4

The methods .isDisplayed() and .isEnabled() have nothing in common.

Method .isDisplayed() :

An element is considered displayed when it is perceptually visible to the human eye.

https://www.w3.org/TR/webdriver/#element-displayedness

Method .isEnabled() :

An element is considered enabled if it's not a form control (button, input, textarea, select or option) or when the user interactions and focus are not blocked with the disabled attribute/property.

https://www.w3.org/TR/webdriver/#is-element-enabled

For the default implementation:

https://github.com/SeleniumHQ/selenium/blob/master/javascript/atoms/dom.js

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.