Injecting JavaScript snippet to trigger the "mouseover" and "mouseout" events. Works well with Chrome, Firefox and Safari (both locally and remotely).
For IE11, I can verify that it works in console. But when trying to automate it, throws error:
JavaScript error (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 64 milliseconds Build info: version: '2.53.0', revision: '35ae25b',
time: '2016-03-15 17:00:58' System info: host: '185-129-68-90', ip: '185.129.68.90', os.name: 'windows',
os.arch: 'x86', os.version: '10.0',
java.version: '1.8.0_121' Driver info: org.openqa.selenium.ie.InternetExplorerDriver Capabilities
[{browserAttachTimeout=0, enablePersistentHover=true, ie.forceCreateProcessApi=false, pageLoadStrategy=normal,
ie.usePerProcessProxy=false, ignoreZoomSetting=false, handlesAlerts=true, version=11, platform=WINDOWS,
nativeEvents=true, ie.ensureCleanSession=true, elementScrollBehavior=0, ie.browserCommandLineSwitches=,
requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=about:blank, takesScreenshot=true,
javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, cssSelectorsEnabled=true,
unexpectedAlertBehaviour=dismiss}]
Using: WebdriverIO - version 4.6.2
Code snippet:
hoverOnChart: function(chartID, index) {
browser.execute((chartID, index) => {
$(`${chartID} g.amcharts-graph-column:nth-child(${index})`).trigger("mouseover");
}, chartID, index);
}
Note: In above scenario I am trying to hover on a chart which is created using amcharts
JavaScript library.