in reply to Re: How To Simulate "Enter" Key Stroke using WWW::Selenium
in thread (SOLVED)How To Simulate "Enter" Key Stroke using WWW::Selenium

I am trying to send an ENTER key press and i used
$sel->key_press("q","\r");

But i am receiving the following error:

Error requesting http://localhost:5555/selenium-server/driver/:
ERROR: invalid keySequence

Replies are listed 'Best First'.
Re^3: How To Simulate "Enter" Key Stroke using WWW::Selenium
by ikegami (Patriarch) on Nov 13, 2009 at 20:21 UTC
    Enter produces a newline, not a carriage return. I'm not saying selenium will accept a newline — I don't know the first thing about selenium — I'm saying that sending a carriage return is surely incorrect.
      So, is there any way to send the enter key press to the application, Please??

        Did you get the same error sending a newline? There's also a mention of sending a backslash followed by keycode, so I'd also try all of the following:

        $sel->key_press("q", "\12"); # Newline $sel->key_press("q", "\\10"); # Decimal $sel->key_press("q", "\\12"); # Octal $sel->key_press("q", "\15"); # Carriage return $sel->key_press("q", "\\13"); # Decimal $sel->key_press("q", "\\15"); # Octal