Closed martinpitt closed 3 months ago
It doesn't belong into a bug report, but I have to let it out: I just love this spec: https://w3c.github.io/webdriver-bidi . Many thanks for this great work, and getting the browsers united behind it.
We are currently porting our tests from CDP to bidi, and it makes things so much more consistent and also easier. This is the only hiccup that I've found so far, and I suppose it's easy enough to work around by just synthesizing a web platform's KeyBoardEvent.
WebDriver BiDi just depends on the WebDriver specification here, and providing multiple input characters is supposed to be an error, so that seems like a bug in Firefox.
To get non-printing characters PUA codepoints are used; see https://w3c.github.io/webdriver/#keyboard-actions
Thank you, that works. Could https://w3c.github.io/webdriver-bidi/#command-input-performActions link to https://w3c.github.io/webdriver/#keyboard-actions to make that more discoverable?
@martinpitt would you mind filing a bug against Firefox? You can use this URL. Thanks.
Should we then close this issue?
Edit: Maybe we can close after adding a link which would indeed be helpful?
@whimboo Right, retitling accordingly. Indeed just adding that link to the classic spec would help a lot to understand the "value" field.
I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1910352 about that multi-character quirk.
input.performActions allows you to simulate key presses. E.g. typing an "a":
The documentation currently just says
value: text
without any further explanation/definition.With Chromium 126.0.6478.182 (as packaged in Fedora 40), supplying e.g. "hello" does not work:
Now, that's fair -- I expected this to describe a single key, not series of keys. But curiously it does work with Firefox 128.0 (also as packaged in Fedora 40), and it succeeds typing "hello" into the web page.
My bigger concern is actually how to do non-ASCII keys. With CDP's Input.dispatchKeyEvent() you could press keys like
ArrowLeft
,Enter
orDelete
. But again with Chromium that just fails withwhile with Firefox it types a literal "Enter" word.
So this is underspecified and inconsistent, and there doesn't seem to be a way how to input key names and/or modifiers like "Shift", "Control", and so on.