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

String literal "\13" produces a one character string consisting of a vertical tab (character 13oct = 11dec). This is obviously not what you were trying to send.

I'm not sure what you were trying to send, but if you were trying to send a newline, it's chr(10) aka "\n" aka "\0x0A" aka "\12".

Replies are listed 'Best First'.
Re^2: How To Simulate "Enter" Key Stroke using WWW::Selenium
by venkatesan_G02 (Sexton) on Nov 13, 2009 at 20:17 UTC
    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

      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??