Diverging driver behavior for "clear the modifier key state" in "Dispatch actions for a string"
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 718
- Forks
- 228
- PR merge metrics
- No merged PRs in 30d
Description
As per the Dispatch actions for a string definition in the WebDriver classic spec the modifier key state should only be reset when the NULL key is send. But drivers behave differently these days for the following Selenium test:
def test_modifier_keys(driver):
driver.get(inline('<input id="input" type="text" value="foo">'))
elem = driver.find_element(By.ID, "input")
elem.send_keys(Keys.META + 'a' + Keys.META + Keys.DELETE + "cheese")
assert elem.get_property("value") == 'cheese'
Per definition the META key should be kept in pressed state and as such cheese should not be the final value of the send_keys command. But here the results of the browsers:
-
Chrome passes the above assertion, which means the
METAmodifier key has been reset. -
Firefox fails this assertion with
foo != cheese, which is the cause of a regression in Firefox 99, which we are going to fix for now to have a similar behavior as Chrome. -
I wasn't able to test Safari.
We should discuss what the correct behavior should be and then align the WebDriver implementations on the spec. If we think that we should not do such a change, maybe we should add that using the modifier key again resets the state of that particular modifier.
CC @jgraham, @sadym-chromium.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the WebDriver classic specification's “Dispatch actions for a string” definition and the Selenium test_modifier_keys example in the issue. Compare the stated NULL-key rule with the Chrome and Firefox results, then review the linked Firefox regression. Done means the expected modifier-key behavior is decided and the relevant WebDriver implementations are aligned.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100