My WindowTester Junit test passes but fails to terminate

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

My WindowTester Junit test passes but fails to terminate

Postby keico » Tue Feb 01, 2011 7:17 am

Hello,

I have a JUnit test that was generated by the WindowTester Pro tool. When I run this test in Eclipse or by invoking ant command, it PASSES. However, the test does not seem to terminate although my swing app successfully closes. From Eclipse I have to manually click on the Terminate button to kill the Java process. If I run this test by invoking the ant command from a Windows command prompt, I have to go to the Windows Task Manager and carefully select the Java process then click on End Process button to kill it once the test completes.

The following code fragment is a part of the JUnit test that the tool generated:

public void testAddRemoveSignal() throws Exception {
IUIContext ui = getUI();
ui.click(new JMenuItemLocator("Tools/Signals…"));
ui.wait(new WindowShowingCondition("Signals"));
ui.click(new JButtonLocator("Add"));
ui.click(new JButtonLocator("Remove"));
ui.click(new JButtonLocator("Close"));
ui.wait(TimeElapsedCondition.milliseconds(2000));
}

Does anyone know the cause of this issue and how to resolve it?

Thank you very much for your support!
-keico
keico
 
Posts: 21
Joined: Wed Jan 05, 2011 7:37 am

Re: My WindowTester Junit test passes but fails to terminate

Postby gnebling » Thu Feb 03, 2011 10:08 am

This is the first time we've heard of such. You could try adding a script to close your application at the end. Something like...
Code: Select all
ui.click(new JMenuItemLocator("File/Exit"));
See if that helps.
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