Mouse hover does not work in safari, selenium web driver

I used Actions to move the mouse in FF and chrome, it works fine. But the same code does not work in safari. I am using mac OS and selenium webdriver and java.

I tried under the code.

 new Actions(driver).moveToElement(element).build().perform();

JS:

String mouseOverScript = "if(document.createEvent){var evObj = document.createEvent('MouseEvents');evObj.initEvent('mouseover', true, false); arguments[0].dispatchEvent(evObj);} else if(document.createEventObject) { arguments[0].fireEvent('onmouseover');}";
                    JavascriptExecutor js = (JavascriptExecutor) driver;
                    js.executeScript(mouseOverScript, element);

This is a stop show problem. any help is appreciated.

+4
source share
1 answer

WebDriver Advanced User Interactions API. Java Actions. , SafariDriver API , . , , , , JavaScript , .

+3

All Articles