Opened 12 years ago
Closed 8 years ago
#9243 closed defect (wontfix)
doh.robot.typeKeys and doh.robot.KeyPress seems not support backslash key
Reported by: | Zebulon | Owned by: | haysmark |
---|---|---|---|
Priority: | low | Milestone: | future |
Component: | TestFramework | Version: | 1.3.0 |
Keywords: | doh.robot.typeKeys and doh.robot.KeyPress with backslash key needsreview | Cc: | |
Blocked By: | Blocking: |
Description
The '\' char seems not working when using doh.robot.typeKeys and doh.robot.KeyPress?
in the JVM console, i got
Sun May 03 11:45:33 CEST 2009: > _typeKey Robot 92, 0 Sun May 03 11:45:33 CEST 2009: Error in _typeKey java.lang.NullPointerException?
at DOHRobot.getVKCode(DOHRobot.java:665) at DOHRobot.access$2400(DOHRobot.java:12) at DOHRobot$21.run(DOHRobot.java:911) at java.security.AccessController?.doPrivileged(Native Method) at DOHRobot._typeKey(DOHRobot.java:901) at DOHRobot.access$2600(DOHRobot.java:12) at DOHRobot$KeyPressThread?.run(DOHRobot.java:1029)
Sun May 03 11:45:33 CEST 2009: < _typeKey Robot
So, there is a crash on the ASCII 92 char ( which is backslash ) It seems to be supported in the code though ?
Here is the code portion from DOHRobot.java
int[] mykeys = new int[]{ KeyEvent?.VK_COMMA, KeyEvent?.VK_MINUS, KeyEvent?.VK_PERIOD, KeyEvent?.VK_SLASH, KeyEvent?.VK_SEMICOLON, KeyEvent?.VK_LEFT_PARENTHESIS, KeyEvent?.VK_NUMBER_SIGN, KeyEvent?.VK_PLUS, KeyEvent?.VK_RIGHT_PARENTHESIS, KeyEvent?.VK_UNDERSCORE, KeyEvent?.VK_EXCLAMATION_MARK, KeyEvent?.VK_DOLLAR, KeyEvent?.VK_CIRCUMFLEX, KeyEvent?.VK_AMPERSAND, KeyEvent?.VK_ASTERISK, KeyEvent?.VK_QUOTEDBL, KeyEvent?.VK_LESS, KeyEvent?.VK_GREATER, KeyEvent?.VK_BRACELEFT, KeyEvent?.VK_BRACERIGHT, KeyEvent?.VK_COLON, KeyEvent?.VK_BACK_QUOTE, KeyEvent?.VK_QUOTE, KeyEvent?.VK_OPEN_BRACKET, KeyEvent?.VK_BACK_SLASH, KeyEvent?.VK_CLOSE_BRACKET, KeyEvent?.VK_EQUALS }; for (int i = 0; i < mykeys.length; i++){
vkKeys.add(new Integer(mykeys[i])); }
Wait for feedback, its blocking for me as i want to type a windows path which needs like 'c:
temp
'
Thanks
Attachments (2)
Change History (20)
comment:1 Changed 12 years ago by
Milestone: | tbd → 1.4 |
---|---|
Owner: | changed from alex to haysmark |
comment:2 Changed 12 years ago by
comment:3 Changed 12 years ago by
To clarify, I ran the tests on Windows. The tests passed. Since you are constructing Windows file paths, I assume you are also running on Windows? What browser do you see this behavior?
comment:5 Changed 12 years ago by
Hi, To be exact, i tried to use doh.robot.typeKeys to enter a path when the browse popup appears ( with an input type = file , when you click on browse, a popup appear ) im on FR locale, with a french keyboard.
I cant test now, but if you are unable to reproduce the problem, i'll give you a dump of my code.
Im running the tests under windows yes. and firefox 3.0.10
comment:6 Changed 12 years ago by
Ok, i just tried your example and have the same problem with a input type = text
Tue May 12 22:54:12 CEST 2009: > _typeKey Robot 92, 0 Tue May 12 22:54:12 CEST 2009: Error in _typeKey java.lang.NullPointerException?
at DOHRobot.getVKCode(DOHRobot.java:665) at DOHRobot.access$2400(DOHRobot.java:12) at DOHRobot$21.run(DOHRobot.java:911) at java.security.AccessController?.doPrivileged(Native Method) at DOHRobot._typeKey(DOHRobot.java:901) at DOHRobot.access$2600(DOHRobot.java:12) at DOHRobot$KeyPressThread?.run(DOHRobot.java:1029)
Tue May 12 22:54:12 CEST 2009: < _typeKey Robot
comment:7 Changed 12 years ago by
Ok, indeed I was able to reproduce this on a French keyboard layout. It seems that the robot is trying to press Alt-Graph and is getting another exception much earlier in the test, hence it is unable to press any character requiring the use of Alt-Graph, including \.
comment:8 Changed 12 years ago by
comment:9 Changed 12 years ago by
comment:10 Changed 12 years ago by
Ignore the previous, invalid refs. Transposed a number in the tracker (#9234).
Changed 12 years ago by
Attachment: | 9243.patch added |
---|
Refs #9243. Enable the robot to get past dead keys in the keyboard detection stage (dead keys still not supported).
comment:11 Changed 12 years ago by
Hi, I attached a potential fix. I am hoping you will test it by applying the patch to your /util then replacing the JAR with the attached file. I would be interested to know if in the JVM console it says, "Error pressing alt graph" followed by a stack trace.
I think the robot did not detect the backslash because it previously tried to test the dead key ' (alt graph + è) and this behavior confused the robot!
comment:12 Changed 12 years ago by
comment:14 Changed 12 years ago by
Update: after exploring the JDK's JNI code for awt_Component, I found that Sun actually does not support using the robot to press alt gr on Windows. They are using the native Windows keybd_event which in turn does not list alt gr explicitly:
http://msdn.microsoft.com/en-us/library/ms645540(VS.85).aspx
However Windows takes alt gr and generates LCONTROL+RMENU instead, so if we were to create a C++ JNI class that could simply press RMENU, then implementing alt gr would be feasible. It's not enough to press ctrl+alt in the Java code because Safari will display the Activity window on ctrl+alt+a but not ctrl+(alt gr)+a.
In the meantime, if you are doing file upload tests, I suggest instead of clicking Browse, use doh.robot.setClipboard to enter file paths and backslashes directly into the system clipboard, then use the operating-system specific paste command to paste the filename into the textbox.
comment:15 Changed 11 years ago by
Milestone: | 1.4 → future |
---|
comment:17 Changed 9 years ago by
Keywords: | needsreview added |
---|---|
Priority: | blocker → low |
comment:18 Changed 8 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Presumably this will never be fixed, because we'll switch to using WebDriver?. Well, I guess in a sense that would fix it, but anyway, probably not worth keeping this ticket open.
I ran the following test with the following modification to include a backslash:
http://archive.dojotoolkit.org/nightly/checkout/util/doh/tests/robot.html
I tested in FF3,IE8, and Safari.