In my application, with respect to user access some elements in drop down will be enabled/disabled.I have to check whether the particular element is disabled or not.


If the element you're trying to find has a literal "disabled" attribute you're probably looking for someElement.isEnabled() which would return a boolean based on the outcome.

| improve this answer | |

Also, you can use XPath to identify the disabled elements in dropdown

Ex:- driver.findElements(By.xpath("//option[@disabled="disabled"]"))

| improve this answer | |
  • The above code works perfectly – Ranjani Feb 20 '18 at 7:06
  • Cheers........... – Sachintha Feb 21 '18 at 4:18

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.