Page 1 of 1

Reading Ranorex log if Automation execution doesn't complete

Posted: Tue Sep 01, 2009 9:35 am
by cancerion
Hi,

I have a question related to Ranorex logs. In my automation I am starting logging using Report.Setup and in last closing logs using Report.End().

If automation suite execution stops without completion, in that it could not reach till Report.End().In this case log is generated as a temp file.

How can we see the Ranorex log in this case?

Thanks,
Sachin

Re: Reading Ranorex log if Automation execution doesn't complete

Posted: Tue Sep 01, 2009 12:32 pm
by Support Team
Usually, there is no need to explicitly call Report.End(), since it is called automatically when the process exits gracefully. That means, Report.End() is not called when you terminate the process, e.g. by killing the process from the command manager or by an unhandled (uncaught) exception raised in the code.

Because of the latter you should always wrap your automation code inside a try-catch clause. Or you subscribe to the AppDomain.UnhandledException event and call the Report.End method from there:
AppDomain.CurrentDomain.UnhandledException += delegate(object sender, UnhandledExceptionEventArgs e)
{
	Report.End();
};
Regards,
Alex
Ranorex Support Team