Page 1 of 1

CloseApplication and Form.Close gives response error

Posted: Wed Oct 19, 2011 6:47 pm
by LPG
Hi,

When I try to exit my test application, I keep getting an error. The application closes fine and the rest of the scripts continue, but the error always get logged.

The error I see getting logged is:
Action 'close' failed on element '{Form:MainWindow}. Failed to get response from control within 2000 milliseconds.

I assume that Ranorex is waiting for a response from the application that it closed? Perhaps it closes too quickly to send a response, but how do I stop Ranorex from waiting for a response so that I don't get this error when the application exited successfully?

I've tried to exit the application the following 3 ways, but keep getting this error:

Method 1:
------------
repo.ReporterForm.Self.Close();

Method 2:
------------
Ranorex.Form repForm = repo.ReporterForm.Self;
repForm.Close();

Method 3:
------------
Ranorex.MenuItem mi = "/form[@controlname='MainWindow']/menubar/menuitem[@accessiblename='Report']";
Host.Local.CloseApplication(mi);

Thanks!

Re: CloseApplication and Form.Close gives response error

Posted: Wed Oct 19, 2011 7:01 pm
by Ciege
What version of Ranorex are you using? I've had these messages in the past but newer versions of Ranorex have (mostly) mitigated them.

Re: CloseApplication and Form.Close gives response error

Posted: Thu Oct 20, 2011 2:57 pm
by Support Team
Hi,

As Ciege said, this should be fixed with newer Version of Ranorex. Which version do you use?

Regards,
Peter
Ranorex Team

Re: CloseApplication and Form.Close gives response error

Posted: Thu Oct 20, 2011 9:16 pm
by LPG
I'm using version 3.1.

Re: CloseApplication and Form.Close gives response error

Posted: Fri Oct 21, 2011 11:28 am
by Support Team
Hi,

Sorry but you have to capture this exception by your own. This exception is thrown if your application needs longer than 2 seconds to close. If this is the cause, Ranorex throws an exception because we wait 2 seconds for a respond of you app.

Regards,
Peter
Ranorex Team