History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: SRC-504
Type: Bug Bug
Status: Resolved Resolved
Resolution: Not a problem
Priority: Major Major
Assignee: Andras Hatvani
Reporter: toma
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Selenium Remote Control

KeyPressNative fails with first lowercase character

Created: 24/Jul/08 02:34 AM   Updated: 23/Nov/08 02:37 AM
Component/s: Client Driver - Java
Affects Version/s: 1.0 beta 1
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: 1. Text File keyPressNative.log (5 kb)

Environment: Windows XP, Internet Exlporer 6


 Description  « Hide
I took a regular string and used toCharArray to get single characters and then casted these to integers.
I couldn't figure out yet how to type : and \ so I removed all characters other than regular english letters. The numbers passed to keyPressNative were following: 67,68,79,99,117,109

The result: "CDO" was typed into file input and then "3" instead of "c". After that focus goes to address bar and "-" gets typed in.

Also, shouldn't 67 be typed as capital letter?

Using Estonian keyboard here.

 All   Comments   Work Log   Change History      Sort Order:
Andras Hatvani - 23/Nov/08 02:37 AM
Instead of a textual description the relevant test steps would have been more beneficial.
Here is how the key*Native() method have to be used:

selenium.keyDownNative("16"); // Press and do not relase the shift key, so that
selenium.keyPressNative("67"); // this and
selenium.keyPressNative("68"); // this and
selenium.keyPressNative("79"); // this character will be capitals
selenium.keyUpNative("16"); // Release the shift key, as we don't need it for the
selenium.keyPressNative("67");
selenium.keyPressNative("85");
selenium.keyPressNative("77");

"Virtual key codes are used to report which keyboard key has been pressed, rather than a character generated by the combination of one or more keystrokes (such as "A", which comes from shift and "a"). "

For further information you can refer to:
http://jira.seleniumhq.org/browse/SRC-183
http://jira.seleniumhq.org/browse/SRC-377
http://java.sun.com/javase/6/docs/api/java/awt/event/KeyEvent.html