Monday, 22 July 2013

Selenium : How to Check That Button is Enabled

Use the WebElement#getAttribute() method to query the “disabled” attribute on the element, like this in Java:
                             element.getAttribute(”disabled”)
Since getAttribute() returns a String object, you can encapsulate that using Boolean.parseBoolean() to get a boolean value: Another solution is using isEnabled() method
                             WebElement.isEnabled() – Returns True if button is enabled else False.

No comments:

Post a Comment