mozilla / geckodriver

WebDriver for Firefox
https://firefox-source-docs.mozilla.org/testing/geckodriver/
Mozilla Public License 2.0
7.03k stars 1.51k forks source link

"Element Send Keys" doesn't use implicit wait for element to become keyboard-interactable #2104

Open titusfortner opened 1 year ago

titusfortner commented 1 year ago

System

The spec says for send keys:

Wait in an implementation-specific way up to the session implicit wait timeout for element to become keyboard-interactable.

Testcase

The first click will wait one second and then make the input element displayed.

driver.manage.timeouts.implicit_wait = 2
driver.get 'https://www.selenium.dev/selenium/web/dynamic.html'
driver.find_element(id: 'reveal').click
driver.find_element(id: 'revealed').send_keys('Displayed')

Stacktrace

     Selenium::WebDriver::Error::ElementNotInteractableError:
       Element <input id="revealed"> is not reachable by keyboard
     # RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
     # WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:180:5
     # ElementNotInteractableError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:290:5
     # webdriverSendKeysToElement@chrome://remote/content/marionette/interaction.sys.mjs:624:13
     # interaction.sendKeysToElement@chrome://remote/content/marionette/interaction.sys.mjs:598:11
     # sendKeysToElement@chrome://remote/content/marionette/actors/MarionetteCommandsChild.sys.mjs:516:29
     # receiveMessage@chrome://remote/content/marionette/actors/MarionetteCommandsChild.sys.mjs:157:31
     # ./spec/waits/waits_spec.rb:49:in `block (2 levels) in <top (required)>'

Trace-level log

https://gist.github.com/titusfortner/0b7ce400f00488dd6cc80bb006974451#file-firefox_send_keys-log

whimboo commented 12 months ago

Thanks @titusfortner! I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1842214 to track the required work.