Last active
July 16, 2016 18:49
-
-
Save 4M01/b419ef6463c2f6d532a47f173ea0deac to your computer and use it in GitHub Desktop.
Java method to highlight webelement.
This file contains hidden or 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 highlightElement(WebElement element) { | |
for (int i = 0; i < 5; i++) { | |
WrapsDriver wrappedElement = (WrapsDriver) element; | |
JavascriptExecutor driver = (JavascriptExecutor) | |
wrappedElement.getWrappedDriver(); | |
driver.executeScript("arguments[0].setAttribute('style',arguments[1]);", | |
element, "color: green; border: 5px solid green;"); | |
driver.executeScript("arguments[0].setAttribute('style',arguments[1]);",element, ""); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment