First of all, I think you should not check for the presence of an element by calling findElement and detecting a potential exception. Better use findElements and check list size
public WebElement getElementIfPresent(By locator) {
driver.manage().timeouts().implicitlyWait(100, TimeUnit.MILLISECONDS);
List<WebElement> elements = driver.findElements(locator);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
if(!elements.isEmpty()) {
return elements.get(0);
}
else {
return null;
}
}
, WebDriver . , , , . , , . , .
isDisplayed() , .