Check Web element Visibility Using Selenium WebDriver Commands – IsSelected IsDisplayed IsEnabled

How to check Web Element visibility using Selenium WebDriver:

To check the web element visibility using Selenium WebDriver, we do use the following methods. We could check the web element visibility using Selenium such as buttons, checkboxes, radio buttons, drop down boxes etc.,

  • Boolean isSelected(): This method is used to verify the element is selected or not. This method returns a true value if the specified element is selected and false if it is not selected.  It is widely used on checkboxes, radio buttons, and options in a select.

  • Boolean isDisplayed(): This method is used to verify the presence of the element. It determines if an element is displayed or not. This method returns a true value if the specified element is displayed and false if it is not displayed.

  • Boolean isEnabled(): This method is used to verify whether the element is enabled or not. It returns a true value if an element is enabled and false if it is not enabled.

Let’s see a practical example to check web element visibility using Selenium WebDriver.

Given clear explanation in the comments section within the program itself. Please go through it to understand the flow.

Execute the above script and see the console output.

Also Read: Extent Reports in Selenium WebDriver

If you are not a regular reader of my blog then I highly recommend you to signup for the free email newsletter using the below link.

Sumasri is a Sr. Software Test Engineer. Currently working in an MNC. She is a co-founder of Software Testing Material. She has an exclusive experience in the field of Software Testing. She writes here about Manual Testing and Automation Testing.

Leave a Comment

Share via
Copy link
Powered by Social Snap