webdriver icon indicating copy to clipboard operation
webdriver copied to clipboard

Keyboard events code might be different depending on the browser

Open carlosgcampos opened this issue 5 years ago • 0 comments

I'm checking several failures in the key event tests that I'm getting in WebKit and I'm not sure what the expected behavior is. The WebDriver spec has a table of expected key codes, but it also says that the events should be processed in accordance with the requirements of UI-EVENTS spec, and tests are using the generated js events to compare the results. I've found several issues:

  • The WebDriver spec says that for keys not in the table the code should be undefined. The spec says that Unidentified should be used for the key code when it can't be determined. So, in WebKit I'm getting Unidentified for the key code in several tests where the expected value is "" (for example test_special_key_sends_keydown[CLEAR-expected4]). It seems Firefox uses Unidentified too for unknown codes, while chrome uses "", but for some reason those tests pass for both firefox and chrome.
  • In other tests the code expected is "" too but there's actually a key code defined in the spec, like test_special_key_sends_keydown[EQUALS-expected12]. WebKit is producing "Equal" for the key code, this one is in the list of the WebDriver spec too.
  • In other cases the key code used by different browsers is different, so for example test_special_key_sends_keydown[CANCEL-expected3]. Firefox and WebKit use BrowserStop and chrome Cancel, but the test expects "" and it passes in both firefox and chromium.

carlosgcampos avatar Oct 21 '20 12:10 carlosgcampos