Adsense

Mouse hover and other mouse events in WebDriver

public static void MouseHoverByJavaScript(IWebElement targetElement)
{

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);";
IJavaScriptExecutor js = _driver as IJavaScriptExecutor;
js.ExecuteScript(javaScript, targetElement);

}

No comments:

Post a Comment

comment here

newest questions on wordpress