How to retain focus on the eclipse plugin

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

How to retain focus on the eclipse plugin

Postby » Mon Apr 27, 2009 1:16 am


I am using WindowTester for our product Flex Builder. In the test i will be launching Flex application from our Flex application. Once the Flex application is launched focus will be on the Flex application and Flex builder looses the focus. Because of this our test fails with UnableToFindActiveShellException. Is there anyway we can retain the focus on the Flex builder (Where WindowTester test will be running) even after launching the Flex application?

Posts: 1
Joined: Sun Apr 26, 2009 11:39 pm

Re: How to retain focus on the eclipse plugin

Postby Phil Quitslund » Mon Apr 27, 2009 10:19 am

You can do this by forcing focus back to Flex Builder once focus is lost. We are working on an API condition for handling this (com.windowtester.runtime.swt.condition.eclipse.WorkbenchHasFocusCondition). In fact our next beta will have a fixed version of it in place. Once it is there you can write something like this:

Code: Select all
ui.ensureThat(new WorkbenchHasFocusCondition());

In the meantime, you can use the existing version of the condition this way:

Code: Select all
new WorkbenchHasFocusCondition().handle(ui);

to force focus.

Is this something that happens at predictable times?
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
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