Skip to content

Instantly share code, notes, and snippets.

@henrrich
Last active July 12, 2016 08:53
Show Gist options
  • Save henrrich/11c21b9617f7335110c721e2b30dda4b to your computer and use it in GitHub Desktop.
Save henrrich/11c21b9617f7335110c721e2b30dda4b to your computer and use it in GitHub Desktop.
method to highlight webelement in yellow color
public void highlight(WebElement element, long highlightInterval) throws InterruptedException {
int flexibleWait = 5;
long pollingInterval = 500;
WebDriverWait wait = new WebDriverWait(ngDriver, flexibleWait);
wait.pollingEvery(pollingInterval, TimeUnit.MILLISECONDS);
wait.until(ExpectedConditions.visibilityOf(element));
executeScript("arguments[0].style.border='3px solid yellow'", element);
Thread.sleep(highlightInterval);
//executeScript("arguments[0].style.border=''", element);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment