How to map 3 or more keys to KeyStroke [message #634590] |
Fri, 22 October 2010 07:18  |
Eclipse User |
|
|
|
Hi guys,
I need to use the typeText() method on a SWTBotText object.
I use CZECH keyboard and when I try write 'Ž' the exception with the message like "can't create keystroke for char 'Ž'" is thrown and I know it's because I need use keyboard mapping file.
So I've created the CS_CZ.keyboard file and registered it with the SWTBot. And there is my problem:
'Ž' is written on the czech keyboard using this key combination
SHIFT + ´ + Z
and I'm not able to figure out how this could be mapped. Since when I use
Ž SHIFT + ´ + Z
in the keyboard file, SWTBot throws this exception:
java.lang.ExceptionInInitializerError
at org.eclipse.swtbot.swt.finder.keyboard.Keyboard.typeCharacter(Keyboard.java:100)
at org.eclipse.swtbot.swt.finder.keyboard.Keyboard.typeText(Keyboard.java:89)
at org.eclipse.swtbot.swt.finder.widgets.SWTBotText.typeText(SWTBotText.java:92)
at cz.tigra.spl.test.swtbot.client.modul.odchylky.pageObjects.ZkusebniListPageObject.vyplnHlavniFormular(ZkusebniListPageObject.java:38)
at cz.tigra.spl.test.swtbot.client.modul.odchylky.ZkusebniListSWTBotTest.testVytvoreniZkusebnihoListu(ZkusebniListSWTBotTest.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at cz.tigra.swtbot.utils.junit.TigraSWTBotJUnit4ClassRunner.run(TigraSWTBotJUnit4ClassRunner.java:46)
at org.junit.runners.Suite.runChild(Suite.java:115)
at org.junit.runners.Suite.runChild(Suite.java:23)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.swtbot.eclipse.core.RemotePluginTestRunner.main(RemotePluginTestRunner.java:64)
at org.eclipse.swtbot.eclipse.core.UITestApplication.runTests(UITestApplication.java:117)
at org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(WorkbenchTestable.java:71)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.RuntimeException: org.eclipse.jface.bindings.keys.ParseException: Cannot create key stroke with duplicate or non-existent modifier key: ´
at org.eclipse.swtbot.swt.finder.keyboard.KeyboardLayout.parseKeyStrokes(KeyboardLayout.java:135)
at org.eclipse.swtbot.swt.finder.keyboard.KeyboardLayout.parseKeyStrokes(KeyboardLayout.java:124)
at org.eclipse.swtbot.swt.finder.keyboard.KeyboardLayout.<init>(KeyboardLayout.java:38)
at org.eclipse.swtbot.swt.finder.keyboard.KeyboardLayout.getKeyboardLayout(KeyboardLayout.java:92)
at org.eclipse.swtbot.swt.finder.keyboard.KeyboardLayout.getDefaultKeyboardLayout(KeyboardLayout.java:75)
at org.eclipse.swtbot.swt.finder.keyboard.Keystrokes.<clinit>(Keystrokes.java:110)
... 41 more
Caused by: org.eclipse.jface.bindings.keys.ParseException: Cannot create key stroke with duplicate or non-existent modifier key: ´
at org.eclipse.jface.bindings.keys.KeyStroke.getInstance(KeyStroke.java:134)
at org.eclipse.swtbot.swt.finder.keyboard.KeyboardLayout.parseKeyStrokes(KeyboardLayout.java:133)
... 46 more
|
|
|
|
|
Powered by
FUDForum. Page generated in 1.11471 seconds