Test hungs after Program is closed

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

Test hungs after Program is closed

Postby a.bitsche » Thu Nov 15, 2007 7:28 am

I need to verify some settings, after my PuT (Program under test) is closed.
That's why i close the Program by a File/Exit click.
All lines of code after this exit click were executed correctly,
but the test hungs at the end and won't finish.

I suggest it's because he wants to close the program, which is already closed.
a.bitsche
 
Posts: 31
Joined: Tue Aug 22, 2006 2:53 am
Location: Austria

Postby Phil Quitslund » Thu Nov 15, 2007 10:46 am

Could you attach a snippet of the test that leads up to the failure? Is there an exception at the hang? Where does the hang occur? At the start of the next test? Note that your next test will probably fail since the application WILL NOT be re-launched by the test framework...
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Postby a.bitsche » Fri Nov 16, 2007 12:38 am

False alarm :oops:
The test don't hangs up but runs in a long timeout

Hole Test:
Code: Select all
private final String port = "COM1";

protected void setUp() throws IOException  {
    try {
        FileOutputStream fout = new FileOutputStream(port);
        fout.close();
    } catch (FileNotFoundException e) {
        fail("'"+port+"' is in use by another application!");
    }
}
   
/**
* Builds a connection to a serial device and closes the SolutionCenter
*/
public void testConnectAndClose() throws Exception {
    IUIContext ui = getUI();
    ui.click(new XYLocator(new CTabItemLocator("Device Shell"), 58, 8));
   
    // Open a connection to the com-port   
    GUIHelper.clickShlCom(ui, port);

    // Close SC      
    ui.click(new MenuItemLocator("File/Exit"));
    // Check if com is available
    try {
        FileOutputStream fout = new FileOutputStream(port);
        fout.close();
    } catch (FileNotFoundException e) {
        fail("'"+port+"' wasn't freed after SC was closed!");
    }
}

The testMethod is finished correctly but the test ('Green Bar') is only finished after a long timeout.
a.bitsche
 
Posts: 31
Joined: Tue Aug 22, 2006 2:53 am
Location: Austria

Postby Phil Quitslund » Fri Nov 16, 2007 4:59 am

Thanks for the follow-up!
--
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