((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);",
webElement);
((JavascriptExecutor) driver)
.executeScript("arguments[0].setAttribute('style', 'color: yellow; border: 2px solid yellow;
');", element);
((JavascriptExecutor) driver).executeScript("arguments[0].click;",
webElement);
check image has loaded
List<WebElement> allImages = driver.findElements(By.tagName("img"));
for (WebElement image : allImages) {
boolean loaded = ((JavaScriptExecutor) driver).executeScript(
"return arguments[0].complete", image);
if (!loaded) {
// Your error handling here.
}
}
No comments:
Post a Comment