MinkSelenium2Driver icon indicating copy to clipboard operation
MinkSelenium2Driver copied to clipboard

keyPress only working in Firefox

Open lphuberdeau opened this issue 11 years ago • 5 comments

For some tests, I want to validate that the return keypress behaves correctly.

$field->keyPress(13)

The operation works in Firefox, but fails in every other browser I have tested with (Chrome, IE7, IE8, IE9).

lphuberdeau avatar Sep 27 '12 17:09 lphuberdeau

@lphuberdeau , is this still an issue?

aik099 avatar Nov 08 '13 13:11 aik099

I may be several weeks behind the latest updates to Mink and all (but Selenium is up to date). This is still an issue.

lphuberdeau avatar Nov 12 '13 20:11 lphuberdeau

Does other key* methods, like keydown and keyup fail with same 13 char code? From the code it seems pure responsibility of underlying Syn library (http://bitovi.com/blog/2010/07/syn-a-standalone-synthetic-event-library.html), which is supposed to be cross-browser.

I guess we need to investigate that or consider using native event triggering code in WebDriver itself.

aik099 avatar Nov 12 '13 22:11 aik099

tested with keydown, keypress and keyup, including all of them in sequence. No luck.

lphuberdeau avatar Nov 26 '13 20:11 lphuberdeau

Can you please add test case, that would:

  1. open a page in Chrome
  2. send ENTER key
  3. check (e.g. via js callback) that ENTER key was received properly
  4. add assertion that would check ENTER keypress result

I know that test would fail now, but once we figure out what's wrong we'll see instantly that it passes.

About the fix I see several options:

  1. it's a bug in Syn library that triggers the event and upgrading a library might solve a problem
  2. use native Selenium event triggering code, but ensure that JS event is fired where it should

In any case I would expect valid PR from you with a test and a fix.

aik099 avatar Nov 26 '13 21:11 aik099