Created
August 8, 2016 13:07
-
-
Save henrrich/557ba7f340451c7c67002f2aa93b9798 to your computer and use it in GitHub Desktop.
move to element implementation using javascript for java webdriver for Safari
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
private static void moveToElementJs(WebDriver driver, WebElement element) { | |
String javaScript = "var evObj = document.createEvent('MouseEvents');" + | |
"evObj.initMouseEvent(\"mouseover\",true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);" + | |
"arguments[0].dispatchEvent(evObj);"; | |
((JavascriptExecutor)driver).executeScript(javaScript, element); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment