trouble playing enterText for Japanese

29 views
Skip to first unread message

Deng Tian

unread,
Nov 10, 2011, 6:16:22 AM11/10/11
to windowtester-pro
Hi, I'm investigating Window Tester pro for testing our project, but I
find two critical issues.

One is for inputting Japanese when replaying test codes recorded by
WT.
If I input Katakana, Hiragana or Kanji, the WT just skipped thoes
characters.
Even if I use the workaround listed here:
http://forums.instantiations.com/topic-5-3938.html
the recorded Japanse characters including kana and kanji just cannot
be inputted, what's more, after add the workaround, when replaying the
code within this workaround, eclipse (tested one) will crash .

Here is the workaround codes I used:

private void enterTextWithTempLocale(String s, String language,
String country)
{
Locale defaultLocale = Locale.getDefault(); // remember previous
Locale
Locale.setDefault(new Locale(language, country));
WT.setLocaleToCurrent();
ui.enterText(s); // enter the text in the ui
Locale.setDefault(defaultLocale); // reset to previous locale
WT.setLocaleToCurrent();
}

and if replaying codes like this:
enterTextWithTempLocale(
"C:\\alphabet\\ひらがな日本語漢字カタカナ\\myfile.text",
"ja", "JP");

a fatal error will happen, ending with a eclipse crashing:
com.windowtester.runtime.swt.internal.text.KeyMapTextEntryStrategy
$UnMappedKeyException: Key map not found for ひ for locale ja_JP
at
com.windowtester.runtime.swt.internal.operation.SWTKeyOperation.queueChar(SWTKeyOperation.java:
149)
at
com.windowtester.runtime.swt.internal.operation.SWTKeyOperation.keyString(SWTKeyOperation.java:
76)
at
com.windowtester.runtime.swt.internal.text.SWTOperationTextEntryStrategy.enterText(SWTOperationTextEntryStrategy.java:
15)
at
com.windowtester.runtime.swt.internal.UIContextSWT.enterText(UIContextSWT.java:
389)
at
com.curl.test.cde.utils.LocaleTools.enterTextWithTempLocale(LocaleTools.java:
38)
at
com.curl.test.cde.new_project.EclipsePrjName_SelectPrjLocation.testEclipsePrjName_SelectPrjLocation(EclipsePrjName_SelectPrjLocation.java:
510)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at com.windowtester.runtime.common.UITestCaseCommon.access
$0(UITestCaseCommon.java:1)
at com.windowtester.runtime.common.UITestCaseCommon
$2.run(UITestCaseCommon.java:130)
at com.windowtester.runtime.common.UITestCaseCommon
$3.run(UITestCaseCommon.java:151)
at com.windowtester.internal.runtime.junit.core.SequenceRunner
$1.run(SequenceRunner.java:40)


The other fatal issue for us is that even if the recorded codes have a
line like:
ui.enterText("C:\\temp\\files\\myfile.text");
what is inputted on the screen is
C*\temp\files\myfile.text
where the ":" is changed to "*".

I investigated some time for this strange issue, and found within
ASCII codes between 0x21 and 0x7E, 0x3A(":") will be replaced with
0x2A("*"), and 0x5E("^") will be replaced with 0x7E ("~") .

Did I missed anything ?

The following is the platform I found the above issues:
Windows7 SP1 Japanese (system locale is set to ja_JP)
Eclispse 3.6.2 (I tried booting eclispe with locale ja_JP and en_US,
the result are the same).
Test target is an eclipse plugin project.

Thanks in advance.

Deng

gerry anderson

unread,
Nov 15, 2011, 11:35:47 AM11/15/11
to windowtester-pro
Hi Deng,

Came across the same problem myself and put it down as a known issue.

GA.

Keerti Parthasarathy

unread,
Nov 28, 2011, 12:27:37 AM11/28/11
to windowte...@googlegroups.com
Looks like the ひ character does not have a translation in the map file. Could you check if any of the other characters in the string ひらがな日本語漢字カタカナ are supported.

Also, attached is the MapGenerator application. Do run this application to generate a map file for your keyboard and send it to us. It would be good to crosscheck against the one currently in WindowTester.
--
Keerti

MapGenerator.java
Reply all
Reply to author
Forward
0 new messages