Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE10+: fire pointerdown and pointerup on click #17

Open
wkeese opened this issue Oct 2, 2014 · 14 comments
Open

IE10+: fire pointerdown and pointerup on click #17

wkeese opened this issue Oct 2, 2014 · 14 comments

Comments

@wkeese
Copy link

wkeese commented Oct 2, 2014

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+.

@csnover
Copy link
Member

csnover commented Oct 2, 2014

Can you please verify the value of the nativeEvents capability in the returned caps for the system you are testing against and report back?

@wkeese
Copy link
Author

wkeese commented Oct 2, 2014

this.remote.environmentType.nativeEvents is true (or at least truthy). I'm testing on IE10 and IE11 on Saucelabs.

wkeese added a commit to wkeese/delite that referenced this issue Oct 2, 2014
wkeese added a commit to wkeese/delite that referenced this issue Oct 7, 2014
@wkeese
Copy link
Author

wkeese commented Oct 31, 2014

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.

@jason0x43
Copy link
Member

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.

@jason0x43
Copy link
Member

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.

@wkeese
Copy link
Author

wkeese commented Nov 3, 2014

@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.

@jason0x43
Copy link
Member

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.

@wkeese
Copy link
Author

wkeese commented Nov 4, 2014

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.

@jason0x43
Copy link
Member

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.

@wkeese
Copy link
Author

wkeese commented Nov 4, 2014

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.

@csnover
Copy link
Member

csnover commented Sep 25, 2015

Is this still an issue?

@wkeese
Copy link
Author

wkeese commented Sep 25, 2015

Yup, unfortunately still happens, see https://saucelabs.com/tests/444563213e524053bb29cbe2a4e8d150.

@LingSpb
Copy link
Contributor

LingSpb commented Jul 13, 2016

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)

@wkeese
Copy link
Author

wkeese commented Jan 18, 2017

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.

wkeese added a commit to ibm-js/delite that referenced this issue Jan 18, 2017
That uses native mouse events and avoids problems
listed in theintern/leadfoot#17.
wkeese added a commit to ibm-js/deliteful that referenced this issue Jan 18, 2017
That uses native mouse events and avoids problems
listed in theintern/leadfoot#17 and theintern/leadfoot#103.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants