ericmckean / chromedriver

Automatically exported from code.google.com/p/chromedriver
0 stars 0 forks source link

chromedriver/atoms dispatch wrong events when emulating actions on SELECT, OPTION elements #1073

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
ChromeDriver uses the selenium browser automation atoms[1] (and also its own 
internal logic) for simulating some of the user actions such as click or tap.

Atoms have had issues handling SELECT and OPTION elements for a while, e.g.
https://github.com/SeleniumHQ/selenium/blob/831f861a0532cc41bfab3db9c38f4a56deed
5198/javascript/atoms/device.js#L614

Since https://codereview.chromium.org/347773002 [that released with Chrome m38] 
the events that chromedriver dispatches on SELECT and OPTION elements when 
emulating click/tap is very different from the events that Chromium browser 
fires when actual user makes an actual click.

This is the bug, basically.

Related here: https://codereview.chromium.org/420663006 was submitted to 
partially work around the issue, but most of the issue is still there.

The following tests, among others, started failing in Chrome 38:
https://github.com/SeleniumHQ/selenium/blob/3dbbc54/javascript/atoms/test/select
_test.html (this one is, strictly speaking, not a chromedriver problem, but 
atoms')
https://github.com/SeleniumHQ/selenium/blob/72ef60dd4da2b76f2aff5450fa88b34b10fb
d6b2/java/client/test/org/openqa/selenium/SelectElementHandlingTest.java#L69-L87
https://github.com/SeleniumHQ/selenium/blob/76358a4ddc82200bab6302950406eb0470cc
1298/py/test/selenium/webdriver/common/select_element_handling_tests.py#L38-L50 
(this last one I didn't actually check yet, but hopefully it fails just as well 
as the Java one)

(they will now be disabled on Chrome[ium] in Selenium project repository)

[1]
https://github.com/SeleniumHQ/selenium/tree/master/javascript/chrome-driver
https://github.com/SeleniumHQ/selenium/tree/master/javascript/atoms

Original issue reported on code.google.com by vlotoshn...@gmail.com on 4 Apr 2015 at 1:20

GoogleCodeExporter commented 9 years ago
The 
testShouldBeAbleToSelectMoreThanOneOptionFromASelectWhichAllowsMultipleChoices 
in SelectElementHandlingTest.java appears to pass with chromedriver 2.14 and 
chrome 41, 42. I missed when that was fixed. Was it fixed completely or is 
SelectElementHandlingTest.java missing better tests?

The atoms select_test.html is not a chromedriver issue, per se.

Original comment by vlotoshn...@gmail.com on 4 Apr 2015 at 1:57

GoogleCodeExporter commented 9 years ago
I submitted a workaround in chromedriver for this a while ago (see 
https://codereview.chromium.org/420663006) but we still need to go through and 
make sure the events are firing properly. But I haven't done this yet since I 
haven't had any reports of problems from any users. It's definitely something 
that needs to be done though.

If this is flaky or otherwise causing problems, let me know and we can bump up 
the priority on this.

Original comment by samu...@chromium.org on 6 Apr 2015 at 8:23

GoogleCodeExporter commented 9 years ago
Thanks! Any idea what kind of scenarios may still be broken? If you give me 
hints I may be able to add a test (to selenium test suite, for example)

Original comment by vlotoshn...@gmail.com on 6 Apr 2015 at 8:30

GoogleCodeExporter commented 9 years ago
(I assumed for some reason that 
testShouldBeAbleToSelectMoreThanOneOptionFromASelectWhichAllowsMultipleChoices 
was still failing with https://codereview.chromium.org/420663006, but I guess I 
just tested chromedriver without that change back then)

Original comment by vlotoshn...@gmail.com on 6 Apr 2015 at 8:32

GoogleCodeExporter commented 9 years ago
I'm not sure exactly what scenarios would break, but my "fix" does cause the 
wrong mouse button value to be set in one of the JavaScript events. I remember 
Jason found this issue after I committed the change.

Original comment by samu...@chromium.org on 6 Apr 2015 at 9:02