I want to check whether button is disabled or not by selenium IDE
But I couldn't.
I have tried below code but it doesn't work. is there any other way to find whether button is disabled...? <tr><td>assertElementPresent</td><td>
//button[contains(text(), 'Save')]</td><td>/td></tr>
How To Verify Element is Enabled or Disabled in Selenium Webdriver? To verify that the target element (Button, Check box, Dropdown, text box, Radio Button, Icons, etc ) are enabled or disabled use isEnabled() Method to check element is enabled or disabled.
In selenium there is the . Enabled(), you could use that to check if it's enabled or not. it only works for input methods, if you want to check something that isn't a input method you should use GetAttribute("disabled"), that will return a bool value.
In WebDriver. There is a method isEnabled which returns true if the element is enabled else it returns false.
driver.findElement(By.id("elementID")).isEnabled();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With