-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Driver input method cannot type '[' #2554
Comments
While looking into this, I noticed that there are some other incomplete mappings in the codes.
Despite falling into the else block, these "unknown" key codes are entered into the input successfully. |
tagging as |
I would be happy to contribute if I knew the meaning behind the numbering system, assuming the numbering system is the aligned solution path. It proved challenging to pin down. Possibly due to being assembled across at least three years. I found one resource that came close to fitting. That resource came with a warning that all such mappings can be hardware-dependent. If these numbers have a specific function elsewhere in the code base I wouldn't want to break that. My experiments with the develop branch and this lone test case determined that the numbers are arbitrary in the operation under test. Multiple reassignments of the With multiple solution paths possible, what standard should I pursue? Changing the numbers in |
If PR #2555 is satisfactory, my employer has allowed access to 1.5.0-RC versions. I do not know what your release versioning policy is, but if we can get it into an easily accessed version, my coworkers and I would be much obliged. |
Upon further research, It turns out that the issue described in the opening post is not the only way to have an error involving the input method and Minimal reproduction will be provided when time permits. |
@SirJerric I'm really sorry for the delay even merging a PR, thanks for the contribution. |
1.5.0 has been released |
Discovered while logging in with randomized passwords using karate 1.4.1 and 1.5.0-RC3 (OpenJDK 17). Reproduction testing with develop branch and OpenJDK 21.
Reproducing Error
The below code can be used with any locator for an element accepting input. (Minimal project attached at end.)
test.feature -- central logic
Output log contains this unexpected match failure:
Root cause
Debug log contains these lines:
Notice the departure from pattern at
"id":15
. Raw key down, no text, virtual key code 91.com.intuit.karate.driver.DevToolsDriver - method
input()
- lines 637-663Based on the Debug log snippet, default block is used for most characters, but
[
has decided to sendKey "rawKeyDown" with keyCode 91.com.intuit.karate.driver.Keys - lines 140, 195, and 240-242
(For context, method
put()
runsCODES.put(META, CODE_META)
as well asVALUES.put(META, "Meta")
.)After the above,
CODES.get('[') == CODES.get(META) == 91
. Since the switch checks forKeys.CODE_META
and findskeyCode == 91
, the break before default is executed and[
is never typed.Thus,
Driver.input()
cannot type[
due to a duplicate numeric value inKeys.CODES
map. Specifically due to the overlap with a modifier key code.Project file
karate-input-open-bracket.zip
Run UiRunner.java as unit test to demonstrate.
mvn test
did not find UiRunner in my testing.pom.xml
is set to use karate version1.6.0-SNAPSHOT
due to testing with local develop branch. My IDE didn't want to compile master. Feel free to use other versions; the conflict was introduced in Feb 2022 per git history.The text was updated successfully, but these errors were encountered: