Can't release Key anymore

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

Can't release Key anymore

Postby a.bitsche » Tue Sep 05, 2006 2:36 am

If i use ui.keyDown to press the SHIFT button (must use it for multiple selection) i can't release the button anymore.
ui.keyUp doesn't release the button.

What's the problem?
a.bitsche
 
Posts: 31
Joined: Tue Aug 22, 2006 2:53 am
Location: Austria

Postby Phil Quitslund » Tue Sep 05, 2006 7:07 am

If you are using the click API, shift clicks can be accomplished like this:

ui.click("my.widget", SWT.BUTTON1 | SWT.SHIFT);

If this doesn't work, could you post the code you are trying to run?
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Postby a.bitsche » Wed Sep 20, 2006 1:49 am

Sample code
Code: Select all
// Make multiple selection
ui.keyDown(SWT.SHIFT);
ui.click("tree1", "Test/Item01");
ui.click("tree1", "Test/Item10");
ui.keyUp(SWT.SHIFT);

The SHIFT-button is still pressed after the ui.keyUp-method was called.
The method doesn't release the SHIFT-key properly.

If i append the following line to the above code it work's properly.
Code: Select all
ui.keyClick(SWT.SHIFT);
a.bitsche
 
Posts: 31
Joined: Tue Aug 22, 2006 2:53 am
Location: Austria

Postby Phil Quitslund » Wed Sep 20, 2006 6:54 am

Interesting!

The following should work too:

Code: Select all
ui.click("tree1", "Test/Item01", SWT.BUTTON1 | SWT.SHIFT);
ui.click("tree1", "Test/Item10", SWT.BUTTON1 | SWT.SHIFT);
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Postby a.bitsche » Wed Sep 20, 2006 10:23 pm

Yes the above codesample works too.
a.bitsche
 
Posts: 31
Joined: Tue Aug 22, 2006 2:53 am
Location: Austria

Postby Phil Quitslund » Thu Sep 21, 2006 7:14 am

Glad that works (it's the expected way fo shift-clicking).

Thanks for the inquiries.
--
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