Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find whether button is disabled or not in Selenium IDE

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>

like image 843
Sree Avatar asked Feb 18 '13 04:02

Sree


People also ask

How do I check if a button is disabled in Selenium?

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.

How does Selenium identify disabled fields?

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.


1 Answers

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();
like image 66
Code Enthusiastic Avatar answered Oct 11 '22 18:10

Code Enthusiastic