MinkSelenium2Driver icon indicating copy to clipboard operation
MinkSelenium2Driver copied to clipboard

Current "key*" methods are just emulating JS events

Open aik099 opened this issue 10 years ago • 4 comments

Current "key*" methods are just emulating JS events instead of actually pressing corresponding keys. I recommend using dedicated WebDriver calls for that instead.

Though we need to add test to Mink to ensure that fired JS events are still fired as they should.

aik099 avatar May 07 '14 09:05 aik099

For keyup and keydown events: http://stackoverflow.com/questions/11388327/how-to-write-a-keydown-and-keyup-for-webdriver .

For keypress event: http://grokbase.com/t/gg/webdriver/1261z3gp5n/key-press-for-sequence-keys-not-working-in-firefox (seems like Ctrl+ENTER does trigger it, not sure about Mac).

aik099 avatar May 07 '14 09:05 aik099

keyup and keydown are hard to use right, because they are low-level actions, and must be applied in an order matching the behavior of a user action.

Btw, the W3C webdriver spec defines only 2 actions: keyDown and keyUp. There is a no keypress action here (browsers may trigger a keypress event when processing a keyDown action, if they dispatch such an event in normal usage, but it is not a separate action. So I don't know whether these methods are really usable as is in the Mink API

stof avatar Jan 04 '17 09:01 stof

Then we'll just update keyDown and keyUp methods we have to use WebDriver API and keep keyPress method intact.

aik099 avatar Jan 04 '17 11:01 aik099

Hello! What's the status of this? It's very much needed.

usmonster avatar Sep 07 '17 17:09 usmonster