0

Im currently using Robot Framework 2.7 with Selenium 2.18 for running my test scripts. In one of my scripts, I have to input the @ sign by using the Press Key Native keyword. The key native value that I have seen for the @ sign is 512

(http://docs.oracle.com/javase/6/docs/api/constant-values.html#java.awt.event.KeyEvent.VK_AT)

but for some reason I get an error whenever it does the Press Key Native 512. The error I get is "ERROR: Problem during keyDown: Invalid key code". Is there a new value assigned for the @ sign?

Note: Press key native keyword in my script works with other values (for letter a I use 65)

Below is the code that I use and little explanation:

@{email_address_in_list_form} =  Split Email  ${email}
@{email_address_in_number} =  Convert Name To Numbers  @{email_address_in_list_form}
@{numbers_to_input} =  Convert To List  ${email_address_in_number}
:For  ${number}  IN  @{numbers_to_input}
\  Press Key Native  ${number}

The above code splits an email address to letters and puts it in a list, then the new created list of letters are turned into numbers since Press Key Native keyword uses the java.awt.event.KeyEvent numbers. The For loop now enters the data in specified textfield. And in this for loop the error occurs when it reaches to type the @ sign which has a value of 512. For example an email address admin@test.com, the system types until admin and gets an error on typing the @sign.

dodong
  • 1
  • 1
  • 6
  • I have been facing similar issue and solved it by setting my keyboard to English by default - see here: http://stackoverflow.com/questions/7186474/convert-at-symbol-to-charsequence Is your issue similar to that? – Pavel Janicek Feb 07 '12 at 15:59
  • Checked my keyboard setting and it is currently under American English. Actually the error that I am getting is that the application is literally not typing the @ sign. I think the issue you raised it got replaced by the letter v. – dodong Feb 08 '12 at 07:12
  • Can you edit your question and paste the bit of the code where you are trying to write the "@" symbol? – Pavel Janicek Feb 08 '12 at 09:05
  • question edited with the sample code that I use. – dodong Feb 08 '12 at 09:24
  • Issue also occurs when I try entering an underscore. Any ideas on why this is occurring? – dodong Feb 23 '12 at 15:07

0 Answers0