German Special Characters Are Not Recorded

WindowTester allows you to easily create and run unit tests for every GUI they build. It can also be used to generate system level tests.

Moderators: gnebling, Eric Clayberg, Dan Rubel, keertip, Phil Quitslund

German Special Characters Are Not Recorded

Postby goksel » Mon Dec 13, 2010 8:01 am

Hello,
when I use the record function from WT special characters are not recognized correctly.
Instead of ä ö ü Ä Ö Ü and ß I get "boxes":

- ui.enterText("�������pp��p");
- ui.enterText("�������������__--");
- ui.enterText("AB�������?+*");

(hope the examples above are shown as expected...)

Running my test cases with that generated JAVA code results in an excepction, i.e. the ButtonLocator cannot not find that button. When I correct the values and replace the "box" with the suitable special character it works.

I tried the same with characters with acute or grave accent and face the same problems...

My system setup is:
- Eclipse for RCP and RAP Developers Version: Helios Service Release 1 Build id: 20100917-0705
- WindowTester Pro 6.0.0.r36x201009131510 for Eclipse 3.6

I played around with the encoding settings at "record configurations", "workspace", "spelling" but had no luck.

Do you have any hint or is there any other issue? Your help is highly appreciated!

Thanks,
Göksel
goksel
 
Posts: 17
Joined: Thu Nov 25, 2010 7:13 am

Re: German Special Characters Are Not Recorded

Postby keertip » Tue Dec 14, 2010 12:54 pm

Not able to recreate this problem at our end. Used the ContactManagerRCP application to test. Set the keyboard type to German and did a recording. Was able to record accent characters, the generated test contained

ui.enterText("üooöäl");

Do you have a German keyboard? How are you doing the recording? Any other steps we need to do to recreate the problem?
keertip
Moderator
 
Posts: 221
Joined: Thu Mar 15, 2007 10:26 am

Re: German Special Characters Are Not Recorded

Postby goksel » Wed Dec 15, 2010 2:44 am

Hi keertip,

thanks for replying!

As you were not able to reproduce the problem I tried to create a small example to support you.
I am astonished, because the example works as expected (look at "Good.png") and the code is fine:

/**
* Main test method.
*/
public void testUmlaut() throws Exception {
IUIContext ui = getUI();
ui.click(new LabeledTextLocator("First Name:"));
ui.enterText("Bla");
ui.keyClick(WT.TAB);
ui.enterText("äöü_ÄÖÜ_ßß??");
ui.click(new ButtonLocator("Cäncel"));
ui.ensureThat(new ShellLocator("Address Book").isClosed());
}

So I made a screenshot of the "same" actions on my real project (look at "Bad.png"). The screenshots looks like the same: in the recorder Tab the output is ok, just the generated code is not like expected:

/**
* Main test method.
*/
public void testUmlaut() throws Exception {
IUIContext ui = getUI();
ui.click(new ButtonLocator("Aktivit�tentypen..."));
ui.wait(new ShellShowingCondition(""));
ui.click(new ButtonLocator("Neu"));
ui.enterText("��_���_��??_++**");
ui.click(new ButtonLocator("OK"));
ui.ensureThat(new ShellLocator("Der Client...").isClosed());
}

So it should be project specific. Any ideas?

Thanks,
Göksel
Attachments
Good.png
Good.png (17.79 KiB) Viewed 155 times
Bad.png
Bad.png (25.93 KiB) Viewed 155 times
goksel
 
Posts: 17
Joined: Thu Nov 25, 2010 7:13 am

Re: German Special Characters Are Not Recorded

Postby keertip » Thu Dec 16, 2010 8:41 am

Interesting! Will look into it and try to figure out what is happening in this case.
keertip
Moderator
 
Posts: 221
Joined: Thu Mar 15, 2007 10:26 am

Re: German Special Characters Are Not Recorded

Postby goksel » Thu Dec 16, 2010 1:38 pm

Dude!
I think I found the solution. Seems that special characters only work with an ISO 8859-1 encoding. I set the default text encoding at the package properties (Alt-Enter). Now it works. Seems that the project default was UTF-8.

Do you have any recommendations about the used text encoding? What does WT do when generating code?

Thanks,
Göksel
goksel
 
Posts: 17
Joined: Thu Nov 25, 2010 7:13 am

Re: German Special Characters Are Not Recorded

Postby goksel » Fri Dec 17, 2010 2:07 am

Hello again,
ISO 8859-1 would be just a "part-solution". With this code page we do not have the EURO symbol € (0xA4).
(...which will hopefully last for some time ;-) )

To have that symbol I changed the encoding to ISO 8859-15. In the combo box in Eclipse that value was not available as a default, but adding was possible. To ensure, that it is not just an "silly" adding, I also tried to add ISO 8859-23 which is - of course - rubbish. Eclipse complaint, so I guess that ISO 8859-15 will be taken.

I recorded a new test case and tried to enter the EURO symbol. In the generated code, I get a "box". When looking via a hex editor the code at the position of the EURO symbol is 0x80. This is the EURO symbol, but only when using CP1252 which is used in Windows...

So, what does WT when it records user entries? Are only Eclipse-settings taken or is there anywhere at WT a switch I can use to make it like I want?

Thanks,
Göksel
goksel
 
Posts: 17
Joined: Thu Nov 25, 2010 7:13 am

Re: German Special Characters Are Not Recorded

Postby keertip » Fri Dec 17, 2010 10:18 am

Glad that you found a solution. Unfortunately we do not have a switch in WT to indicate text encoding. Are you using windows or is it a different platform?
keertip
Moderator
 
Posts: 221
Joined: Thu Mar 15, 2007 10:26 am

Re: German Special Characters Are Not Recorded

Postby goksel » Fri Dec 17, 2010 2:57 pm

It's a Windows platform. I use a Mac but Eclipse runs vie Parallels Desktop on a Windows XP system. All my source code files are on the WinXP system. The rest of our programmers use native Windows.
...do you need any other information?
Thanks, Göksel
goksel
 
Posts: 17
Joined: Thu Nov 25, 2010 7:13 am

Re: German Special Characters Are Not Recorded

Postby keertip » Mon Dec 20, 2010 10:17 am

Well, I am using Windows, eclipse is set to CP1252 encoding, keyboard is German. Also, what is different in your application and the sample application? If you could make the sample application fail, then that would give us a clue as to what is happening.
keertip
Moderator
 
Posts: 221
Joined: Thu Mar 15, 2007 10:26 am

Re: German Special Characters Are Not Recorded

Postby goksel » Tue Jan 04, 2011 2:54 am

keertip,
I've uploaded a sample project with four different test packages (don't care about the fiths). I removed the libs from the lib-folder not to exceed the file size limit. Each package is set to another encoding, so the generated source from the record function is saved in that type of encoding. There you will see, that just with CP1252 both umlauts and the euro symbol are shown correctly.
You are using CP1252 on your windows system. Our software will run on both Windows and Linux and (later) MacOS. CP1252 ist just available on Windows systems.
So my question is: will WT support UTF-8 in (near) future? Will be aby support for ISO 8859-15?

Thanks,
Göksel
Attachments
AddressBookSWT.zip
(17.43 KiB) Downloaded 6 times
goksel
 
Posts: 17
Joined: Thu Nov 25, 2010 7:13 am

Re: German Special Characters Are Not Recorded

Postby keertip » Tue Jan 04, 2011 11:35 am

Thanks for all the information. Looking at the example, do see the problem with recording when the encoding is changed. Currently there are no plans to add support for UTF-8 in WindowTester.
keertip
Moderator
 
Posts: 221
Joined: Thu Mar 15, 2007 10:26 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest

cron