IE10+: fire pointerdown and pointerup on click
Calling .click() on IE10 doesn't emit an mspointerdown event, and similarly calling .click() on IE11 doesn't emit a pointerdown event.
I assume this is a webdriver problem but leadfoot is supposed to work around that. Perhaps it's already firing mousedown/mouseup, but it would be good if it fired the pointer events too, since that's what actually happens when the user clicks on IE10+.
Can you please verify the value of the nativeEvents capability in the returned caps for the system you are testing against and report back?
this.remote.environmentType.nativeEvents is true (or at least truthy). I'm testing on IE10 and IE11 on Saucelabs.
A trivial test case (and "feature test") is:
pointerdown.html:
<!DOCTYPE HTML>
<html>
<body>
<span id="span" onpointerdown="span.innerHTML='got pointerdown';">click me</span>
</body>
</html>
pointerdown.js
define([
"require",
"intern",
"intern!object",
"intern/chai!assert"
], function (require, intern, registerSuite, assert) {
registerSuite({
name: "pointerdown event on id",
basic: function () {
return this.remote
.get(require.toUrl("./pointerdown.html"))
.findById("span")
.click()
.getVisibleText()
.then(function (text) {
assert.strictEqual(text, "got pointerdown");
});
}
});
});
That's for IE11. It needs to be adjusted for IE10 to use mspointerdown.
I've tested this with IE10, and pointer events are firing. Handlers added both through the DOM (onmspointerdown) and via JS (addEventListener('MSPointerDown')) seem to work fine.
More information: I tested IE10 running on Win7 using Selenium 2.44.0 and IEDriverServer 2.44.0 32-bit. It should theoretically be fine with older versions of Selenium since pointer events support was added back in 2.34.0, but I'll check some additional combinations.
@jason0x43 - How about IE11 on Saucelabs? If you can reproduce the problem there, then it probably means the problem was fixed in a newer release of IEDriverServer.
After running a number of trials on Sauce, it looks like IE 11 on Windows 7 works, but IE 11 on Windows 8.1 does not. Both OSes run the same fairly recent version of Selenium (2.42.0) and InternetExplorerDriver (2.42.0 32-bit). The Win8.1 machine runs Java 24.65-b04, and the Win7 runs Java 24.60-b04; it seems unlikely that a patch version difference in Java would make a huge difference, though.
OK, thanks for trying that; I'm glad you could reproduce the problem in one scenario. How about running on Win8.1 (and IE11) locally? (Your original local test ran against Win7 and IE11.) It sounds likely to me that the problem is not the Java version but the OS version.
More information... On a local Windows 8.1 VM, selenium server 2.42.0 won't even register the InternetExplorerDriver binary because 2.42.0 doesn't know the platform WIN8_1. This bug was patched in 2.43.0. I'm guessing that Windows Server 2012, which is what Sauce is using for Win8.1, doesn't show up as WIN8_1 to Selenium.
Regardless, that's only half the problem. The other issue is IEDriver's flakey support for native events. To get pointer events to register you have to disable native event support by adding nativeEvents: false to your IE environment config. With native events disabled, pointer events worked in my tests with IE11 + Win8.1 for Selenium 2.43+, and even for 2.42 on Sauce.
Wow, OK, interesting. I'm not sure what the side effects of adding nativeEvents: false are. It seems nativeEvents: false would interfere with things like pressKeys(keys.TAB) advancing from one <input> to another, but perhaps not.
Is this still an issue?
Yup, unfortunately still happens, see https://saucelabs.com/tests/444563213e524053bb29cbe2a4e8d150.
Because of this issue, we cannot make the tests run in IE. @jason0x43 suggested to use nativeEvents: false, but once we use it, the mouse hovering (moveMouseTo() stops working)
FYI, I confirmed that on SauceLabs, Leadfoot uses native events on IE11/Windows 7, but not on IE11/Windows 8.1 nor IE11/Windows 10.
As listed in #83 this is presumably due to the brokenMouseEvents environment test failing on Win 8.1 and Win10.