CloseApplication and Form.Close gives response error

Ask general questions here.
LPG
Posts: 39
Joined: Mon Jul 25, 2011 6:12 pm

CloseApplication and Form.Close gives response error

Post by LPG » Wed Oct 19, 2011 6:47 pm

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!

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: CloseApplication and Form.Close gives response error

Post by Ciege » Wed Oct 19, 2011 7:01 pm

What version of Ranorex are you using? I've had these messages in the past but newer versions of Ranorex have (mostly) mitigated them.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: CloseApplication and Form.Close gives response error

Post by Support Team » Thu Oct 20, 2011 2:57 pm

Hi,

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

Regards,
Peter
Ranorex Team
.
Image

LPG
Posts: 39
Joined: Mon Jul 25, 2011 6:12 pm

Re: CloseApplication and Form.Close gives response error

Post by LPG » Thu Oct 20, 2011 9:16 pm

I'm using version 3.1.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: CloseApplication and Form.Close gives response error

Post by Support Team » Fri Oct 21, 2011 11:28 am

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
.
Image