google / windowtester

Automatically exported from code.google.com/p/windowtester
Other
18 stars 23 forks source link

SWTKeyOperation needsShift for ASCII 60 wrong #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If you try to insert text with enterText("<") windowTester always will enter 
">" - so this is not correct and the error can be found at this line:

if (keyCode == 58 || keyCode == 60 || keyCode == 62)
            return true;

keyCode 60 = < and needs no shifting 

So will easy to solve :)
As workaround you can use keyClick(((char)60)); this seems to work :)

Class: SWTKeyOperation
Method: bool needsShift(char keyCode)
Line: 246

Best Regards,
Falk

Original issue reported on code.google.com by zilm@testingtech.com on 7 Mar 2013 at 1:40

GoogleCodeExporter commented 9 years ago
Hi Falk,
Sounds like an easy fix. (I did not have a closer look yet.)

Could you create a patch and a little test for this issue?

Regards,

Fred

Original comment by fred.g...@googlemail.com on 8 Mar 2013 at 2:50

GoogleCodeExporter commented 9 years ago
So i have created a eclipse plugin test , it will open the preferences and just 
enter "<>" in the search field to test if WindowTester enters it correctly.

And a patch is attached :)

Regards,
Falk

Original comment by zilm@testingtech.com on 11 Mar 2013 at 11:10

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hi Falk,

After looking at this issue more closely, I think this problem only occurs, 
when the correct locale is not set.
Executing the following code in your setup() method should fix it:

Locale.setDefault(new Locale("de", "DE"));
WT.setLocaleToCurrent();

There is also an existing test case here:
/com.windowtester_test/src/com/windowtester/test/runtime/KeyMapTextEntryTest.jav
a
(Not sure why most of the code is commented out, though.)

The current solution of having to set the locale manually is far from perfect 
and not intuitive. The whole "key entering"-approach seems a bit fragile 
anyway. I hope this can be fixed in the future.

Regards,

Fred

Original comment by fred.g...@googlemail.com on 16 Mar 2013 at 6:42

GoogleCodeExporter commented 9 years ago
Hi Fred,

Yes you are right the whole "key entering"-thing have to be fixed some day, i 
use only the standard us layout to get it working, i tried as you suggest to 
set it to "de" and however WT is not able to enter any text in my test case .. 

So maybe let this issue as reminder open and change the title ?
I will have a deeper look at it next days.

Regards,
Falk

Original comment by zilm@testingtech.com on 18 Mar 2013 at 9:54

GoogleCodeExporter commented 9 years ago
Hi Falk,

Which OS do you use?
Setting the locale should definitely work on Windows. I know there are issues 
with
Linux, as it seems to need it's own special keymap.

Regards,

Fred

Original comment by fred.g...@googlemail.com on 18 Mar 2013 at 11:26

GoogleCodeExporter commented 9 years ago
We are using Linux also for the automatically test builds on jenkins.

So we have to deal with that workaround i see. 

Regards,
Falk

Original comment by zilm@testingtech.com on 18 Mar 2013 at 12:45