Site Loader
Auckland, New Zealand
In this post we will discuss, how to check if the control exist using Selenium webdriver. To check for the control exist, there is no inbuilt method available, hence we can do a trick by using isDisplayed() method to verify if the control exist. Here is the complete code snippet
public static boolean Exist(WebElement element) {
	try {
		return element.isDisplayed();
	} catch (NoSuchElementException e) {
		return false;
	} catch (Exception e) {
		return false;
	}
}
Here is the complete video with full explanation on the above concept. Thanks for watching the video and reading the post !!! Please leave your comments if you have any questions. Thanks, Karthik KK

Post Author: Karthik kk

Leave a Reply

Your email address will not be published. Required fields are marked *