Issue metadata
Sign in to add a comment
|
Key events from Input.dispatchKeyEvent no longer get handled by browser process |
||||||||||||||||||||||
Issue description
Arrow down & up keys do not work when trying to select the text from autofill dropdown in an input element.
Repro testcase is as follows :
//Enable the autofill settings
ChromeOptions options = new ChromeOptions();
Map<String, Object> prefs = new HashMap<String, Object>();
HashMap<String, Object> autofill = new HashMap<String, Object>();
autofill.put("enabled", true);
prefs.put("autofill", Arrays.asList(autofill));
options.setExperimentalOption("prefs", prefs);
//test
WebDriver driver= new ChromeDriver(options);
driver.get("file:///path/to/testPage.html");
WebElement elem = driver.findElement(By.name("firstname"));
elem.clear();
elem.sendKeys("test");
driver.findElement(By.id("sub")).click();
Thread.sleep(1000);
WebElement elem1 = driver.findElement(By.name("firstname"));
elem1.clear();
elem1.sendKeys("te");
Thread.sleep(1000);
elem1.sendKeys(Keys.ARROW_DOWN);
Thread.sleep(2000);
elem1.sendKeys(Keys.ARROW_UP);
testPage.html:
<!DOCTYPE html>
<html>
<body>
<form >
First name:<br>
<input type="text" name="firstname" value="first name">
<br>
Last name:<br>
<input type="text" name="lastname" value="last name">
<br><br>
<input id= "sub" type="submit" value="Submit">
</form>
</body>
</html>
Issue happens on Chrome v54.0.2840.59 with Chromedriver 2.24
whereas, the above test works as expected on Chrome v53 with v2.24
Another observation - In input element, Down/Up arrow keys acts like Right/Left arrow keys respectively and scrolls right to left across the autofilled text.
,
Oct 20 2016
Here is the bisect change log - https://chromium.googlesource.com/chromium/src/+log/4501b27d39098f2c43089b88987f57adc93f9559..3e45becd1da65b4a3ff379fb794cc652d496e07e Culprit CL seems to be crrev.com/404984
,
Oct 21 2016
,
Oct 24 2016
Thanks for any help on this, it is blocking my project at the moment (need latest Stable version of Chrome).
,
Nov 2 2016
This is due to crrev.com/404984, which prevents the browser process from handling any keyboard shortcuts that could be triggered by these synthetic input events. (I'm assuming that the autocomplete stuff is handled in the browser process, correct me if I'm wrong) So the only way to fix this would be to have Input.dispatchKeyEvent set skip_in_browser=false. Or maybe we could make it a parameter? dgozman@, how feasible is this?
,
Nov 2 2016
,
Nov 3 2016
skip_in_browser is there to fight null-pointer, since we don't have real native event. The question is why up/down are handled in browser? Let's ask someone from editing team.
,
Nov 8 2016
In this case, the autocomplete code is implemented in the browser, so they need this for testing. When you say "we don't have real native event", does this mean that NativeWebKeyboardEvent::os_event needs to be set? Maybe we can modify DispatchKeyEvent to build a fake ui::Event (or whatever we need for the platform)?
,
Nov 18 2016
Ping dgozman would love your opinion.
,
Nov 18 2016
re #c8: sure we can explore building a fake ui::Event. skip_in_browser was the easiest way, but if it doesn't work it makes sense to explore other options.
,
Nov 19 2016
Is there hope of undoing the change that broke this for us? I am not familiar with the reasons of the change. Thanks for your help
,
Nov 20 2016
Nothing to add except to emphasize the importance of fixing this, for some of us at least.
,
Nov 21 2016
,
Nov 21 2016
,
Nov 23 2016
So, where is no way anymore to use hacks like open new tab with ctrl + t, close tab with ctrl + w and etc? Sounds pretty sad.
,
Nov 23 2016
I'm also very much dependent on this issue.
,
Nov 25 2016
,
Dec 8 2016
Hi Dmitry, please let us now if there is a possible fix that could be done. This is hindering the launch of our testing framework (we developed it with M53 and on M54+ we can't test Autofill interactions, which are arrow up/down events in the browser).
,
Dec 14 2016
Issue chromedriver:1040 has been merged into this issue.
,
Dec 14 2016
,
Dec 16 2016
Issue 659939 has been merged into this issue.
,
Dec 22 2016
Issue chromedriver:1642 has been merged into this issue.
,
Dec 30 2016
Really need this addressed, especially for the Ctrl+Tab, Ctrl+Shift+Tab, but for any keyboard interaction through ChromeDriver. Really need to be able to automate anything the user might do, simulating as closely as possible if necessary.
,
Jan 11 2017
Could you tell me when this will be resolved?
,
Jan 11 2017
,
Jan 23 2017
Any updates on this?
,
Jan 25 2017
This is blocking our tests. Please let me know when this can be resolved. Thanks.
,
Jan 25 2017
It's becoming a major problem on our side as well :/ We have problems with former Chromedrivers, and we can not migrate on a more recent version because of this.
,
Jan 26 2017
Any chance we can get this in Q1?
,
Jan 27 2017
I spoke to dgozman@ about this. There is no simple solution to this problem. We discussed a couple early solutions but none of them are very good. I am at the exploration part of fixing this. I am not going to promise anything, but this bug will likely be fixed this quarter. However, fixes to bugs like this have a tendency to get reverted once or twice :-(, so don't hold your breath quite yet. I am flagging this as "Started", but we do not know what we will do to fix it yet.
,
Jan 27 2017
Thanks for the update! :) We'll stay tuned.
,
Jun 6 2017
Any update?
,
Jun 9 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/fa84ab9619de73a61d305c7459fc186e99b0d291 commit fa84ab9619de73a61d305c7459fc186e99b0d291 Author: allada <allada@chromium.org> Date: Fri Jun 09 20:52:03 2017 ChromeDriver: Handle key events properly on Mac Fixes devtool's emulation of key input events to emulate os key event for OSX. BUG= 667387 Review-Url: https://codereview.chromium.org/2656903005 Cr-Commit-Position: refs/heads/master@{#478407} [modify] https://crrev.com/fa84ab9619de73a61d305c7459fc186e99b0d291/chrome/browser/devtools/devtools_sanity_browsertest.cc [add] https://crrev.com/fa84ab9619de73a61d305c7459fc186e99b0d291/chrome/test/data/devtools/dispatch_key_event_shows_auto_fill.html [modify] https://crrev.com/fa84ab9619de73a61d305c7459fc186e99b0d291/content/browser/BUILD.gn [modify] https://crrev.com/fa84ab9619de73a61d305c7459fc186e99b0d291/content/browser/devtools/protocol/input_handler.cc [add] https://crrev.com/fa84ab9619de73a61d305c7459fc186e99b0d291/content/browser/devtools/protocol/native_input_event_builder.h [add] https://crrev.com/fa84ab9619de73a61d305c7459fc186e99b0d291/content/browser/devtools/protocol/native_input_event_builder_mac.mm [modify] https://crrev.com/fa84ab9619de73a61d305c7459fc186e99b0d291/third_party/WebKit/Source/devtools/front_end/Tests.js
,
Jun 9 2017
This should be fixed. Please check to make sure it works for you on Canary in the next few days. Sorry about the delay.
,
Jun 10 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3505cba91e5a004726c286f4396caf2aae3c2e17 commit 3505cba91e5a004726c286f4396caf2aae3c2e17 Author: thakis <thakis@chromium.org> Date: Sat Jun 10 18:10:52 2017 Revert of ChromeDriver: Handle key events properly on Mac (patchset #6 id:440001 of https://codereview.chromium.org/2656903005/ ) Reason for revert: Speculative, might have caused https://crbug.com/732053 Original issue's description: > ChromeDriver: Handle key events properly on Mac > > Fixes devtool's emulation of key input events to emulate > os key event for OSX. > > BUG= 667387 > > Review-Url: https://codereview.chromium.org/2656903005 > Cr-Commit-Position: refs/heads/master@{#478407} > Committed: https://chromium.googlesource.com/chromium/src/+/fa84ab9619de73a61d305c7459fc186e99b0d291 TBR=dgozman@chromium.org,rohitrao@chromium.org,pfeldman@chromium.org,luoe@chromium.org,erikchen@chromium.org,allada@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG= 667387 Review-Url: https://codereview.chromium.org/2932223002 Cr-Commit-Position: refs/heads/master@{#478518} [modify] https://crrev.com/3505cba91e5a004726c286f4396caf2aae3c2e17/chrome/browser/devtools/devtools_sanity_browsertest.cc [delete] https://crrev.com/f823f843f06636feb082521d76c282a16fe2d577/chrome/test/data/devtools/dispatch_key_event_shows_auto_fill.html [modify] https://crrev.com/3505cba91e5a004726c286f4396caf2aae3c2e17/content/browser/BUILD.gn [modify] https://crrev.com/3505cba91e5a004726c286f4396caf2aae3c2e17/content/browser/devtools/protocol/input_handler.cc [delete] https://crrev.com/f823f843f06636feb082521d76c282a16fe2d577/content/browser/devtools/protocol/native_input_event_builder.h [delete] https://crrev.com/f823f843f06636feb082521d76c282a16fe2d577/content/browser/devtools/protocol/native_input_event_builder_mac.mm [modify] https://crrev.com/3505cba91e5a004726c286f4396caf2aae3c2e17/third_party/WebKit/Source/devtools/front_end/Tests.js
,
Jun 10 2017
,
Jun 10 2017
Thanks for working on this allada@. Is the proposed fix only for Mac? Last time I had checked, I was having this issue on Linux.
,
Jun 16 2017
This patch sadly got reverted (like I said earlier... these types of changes often get reverted) because it broke a perf test. I am still looking into what is actually wrong.
,
Jul 6 2017
Any update? Thanks!
,
Jul 6 2017
I started going down the route to fill in the needed info to send the event to browser, but because of the many differences between OSs and edge cases, I decided that the best route might be to simply forward the info to browser if native_virtual_key was sent. This will give devs the ability to test more precisely per OS at the expense of needing to keep the OS specific key lookup tables themselves. I uploaded a new patch here that should do this: https://chromium-review.googlesource.com/c/562559/ Does this sound like a good enough compromise?
,
Jul 7 2017
Hi,
The patch you are referring to is wrong ("Fixed filmstrip so reset shows proper message"), could you add the correct link?
,
Jul 7 2017
Sorry correct link is here: https://chromium-review.googlesource.com/c/562583/
,
Jul 7 2017
Hi, Disclaimer: I have no knowledge of how Chromium works and it has been over a decade since I wrote code in C++ :) From looking at the code, it seems that this issue will have been fixed for Mac, but not for other Linux platforms.
,
Jul 7 2017
#44 TL;DR: Mac is the only OS blocking this from being fixed, which is to only remove a single line of code: "event.skip_in_browser = true;". Detail: We are explicitly forcing the events to skip browser right now because on Mac they do not have an os_event on the NativeEvent and it's needed for some Mac specific stuff. The solution was to construct a Mac os_event and attach it to the NativeEvent, but then it was failing some other performance tests because if you did not specify the character being pressed mac would open the help dialog in chrome because the event somehow triggers the OS to open the help dialog of the application.
,
Jul 8 2017
OK, got it- removing "event.skip_in_browser = true;" will solve this issue for all operating systems, except for Mac which required an additional implementation. Sounds good!
,
Jul 12 2017
,
Jul 26 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e83d216ed9fe24c61c7e5647c69887160e283ffd commit e83d216ed9fe24c61c7e5647c69887160e283ffd Author: Blaise <allada@chromium.org> Date: Wed Jul 26 19:09:12 2017 Chromedriver: Fix test failure for emulating key event This patch fixes a bug introduced in https://chromium-review.googlesource.com/c/562583/ where chromedriver was sending nativekeyevent to inspector protocol when not nessessary. BUG= 667387 , 732053 , chromedriver:1896 Change-Id: I884c5d1b57900618a7bcbf164c4a70b0455f83a4 Reviewed-on: https://chromium-review.googlesource.com/585651 Reviewed-by: John Budorick <jbudorick@chromium.org> Commit-Queue: Blaise Bruer <allada@chromium.org> Cr-Commit-Position: refs/heads/master@{#489717} [modify] https://crrev.com/e83d216ed9fe24c61c7e5647c69887160e283ffd/chrome/test/chromedriver/chrome/web_view_impl.cc
,
Jul 26 2017
I forgot to mark the patch that fixed it with the bug. This should now be fixed in this patch: https://chromium-review.googlesource.com/c/562583/
,
Feb 9 2018
Issue chromedriver:2265 has been merged into this issue.
,
Feb 13 2018
Issue is not fixed. Please refer to comment from 2265 "https://bugs.chromium.org/p/chromium/issues/detail?id=667387#c49 per this issue is fixed but I can still reproduce. I feel marking ticket as duplicate of already fixed one is not valid. Please re-open" |
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by gmanikpure@chromium.org
, Oct 20 2016