4

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.

T Gurung
  • 323
  • 1
  • 7
  • IE 11 doesn't support template literals. Take a look at the [ECMA compatability table](https://kangax.github.io/compat-table/es6/). Also possible [duplicate](https://stackoverflow.com/questions/40871705/template-literals-not-working-in-ie11-when-use-strict-directive-is-used) – Joe B. Jul 15 '17 at 05:14
  • @JoeB. It has got nothing to do with the template literals. Got `Babel` to take care of `ECMA compatibility`. Have used template literals all over and is working nicely. – T Gurung Jul 15 '17 at 11:38

0 Answers0