Run "test" inside an application

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

Run "test" inside an application

Postby alfonso777esp » Thu May 12, 2011 7:25 am

Hello,

I have a question .... is it possible to use WindowTester inside an SWT application? I would like to have one option in a menu like "Run UI test" that an
administration user can run at any time.

To test this I create one entry in a menu and I have an "action" class then runs when the administrator clicks in this option. But my problem is that I always get the same error: "Display has not been initialized."

In my first case I created one class that extends UITestCaseSWT so I can execute getUI() to get one context. But this doesn't work. Is there any way to get
one IUIContext so this class can work? or without UITestCaseSWT is there any way to get IUIcontext?

public class TestInterfazAction extends AbstractSimpleAction {

class TestUI extends UITestCaseSWT {

public TestUI() {
}

public void execute() throws Exception {

IUIContext ui = getUI() ;
ui.click(new MenuItemLocator("File/Open Log Viewer"));

Regards,
Alfonso
alfonso777esp
 
Posts: 1
Joined: Thu May 12, 2011 6:43 am

Re: Run "test" inside an application

Postby gnebling » Fri May 13, 2011 9:18 am

Windowtester tests are essentially junit tests and use the junit test runner to run, and that is how they need to be launched.
gnebling
Moderator
 
Posts: 243
Joined: Tue Aug 22, 2006 7:49 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest

cron