
| Key: |
SRC-504
|
| Type: |
Bug
|
| Status: |
Resolved
|
| Resolution: |
Not a problem
|
| Priority: |
Major
|
| Assignee: |
Andras Hatvani
|
| Reporter: |
toma
|
| Votes: |
0
|
| Watchers: |
0
|
|
If you were logged in you would be able to see more operations.
|
|
|
|
Original Estimate:
|
Unknown
|
Remaining Estimate:
|
Unknown
|
Time Spent:
|
Unknown
|
|
File Attachments:
|
1.
keyPressNative.log (5 kb)
|
|
Environment:
|
Windows XP, Internet Exlporer 6
|
|
|
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.
|
|
Description
|
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. |
Show » |
|
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