Interview Questions

Selenium WebDriver - How to check if an element is visible on the web page ?

Selenium WebDriver Interview question and Answers


(Continued from previous question...)

Selenium WebDriver - How to check if an element is visible on the web page ?

use isDisplayed() method. The return type of the method is boolean. So if it return true then element is visible else not visible.
driver.findElement(By.xpath("xpath of elemnt")).isDisplayed();
1
driver.findElement(By.xpath("xpath of elemnt")).isDisplayed();

(Continued on next question...)

Other Interview Questions