enterText: Cannot enter numeric value

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

enterText: Cannot enter numeric value

Postby palbaret » Tue Sep 26, 2006 7:19 am

Hi All,

I want to type a character string inside a text field for example: ui.enterText("slwinpatsp1");

but instead of the character "1", character "&" occurs. I have a French keyboard where the 2 characters "1" and "&" are on the same key.

What is the workaround?
thanks and regards,

Patrick
palbaret
 
Posts: 2
Joined: Tue Sep 26, 2006 7:14 am
Location: Paris

Postby Phil Quitslund » Tue Sep 26, 2006 2:37 pm

Hi Patrick,

We're currently investigating international keyboard support.

Could you submit a bug report to:

wintest-support@instantiations.com

This will help us track your issue.

In the meantime, the abbot tester classes that ship with windowtester might help.

Here's what I'd try:

Code: Select all
Text text = (Text)ui.click("text");  //click the text and cache it
new abbot.tester.swt.TextTester().actionEnterText("slwinpatsp1"); //use the abbot tester to set it


Why should this work? Behind the scenes, abbot is setting the text directly on the widget:

Code: Select all
widget.setText(text);


This bypasses our keyStroke event posting which is the culprit in this case.

Hope this helps! (And please follow up with a bug report either way.)

Thanks!

-phil
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Postby palbaret » Wed Sep 27, 2006 12:19 am

Thank you , it is working fine even with Chinese characters.

Patrick
palbaret
 
Posts: 2
Joined: Tue Sep 26, 2006 7:14 am
Location: Paris

Postby Phil Quitslund » Wed Sep 27, 2006 7:49 am

Great!

As I said, we are working on a proper fix (we'd like to enter text with keystrokes rather than just calling setText on the widget), but it's good to know this gets you unblocked in the meantime.
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest