Created
October 6, 2014 01:13
-
-
Save mspiegel/58125c8e56e4ba68a769 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void clickWhenVisible(By locator) { | |
int counter = 0; | |
boolean retry; | |
do { | |
try { | |
retry = false; | |
wait.until(ExpectedConditions.elementToBeClickable(locator)); | |
driver.findElement(locator).click(); | |
} catch (WebDriverException ex) { | |
if (counter < TestManagerConfiguration.DEFAULT_RETRY) { | |
counter++; | |
log.warn(ex.toString()); | |
log.warn("Retry number " + counter); | |
retry = true; | |
} else { | |
throw ex; | |
} | |
} | |
} while (retry); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment