Reading Ranorex log if Automation execution doesn't complete

Ask general questions here.
cancerion
Posts: 30
Joined: Tue Jun 16, 2009 6:15 pm

Reading Ranorex log if Automation execution doesn't complete

Post by cancerion » Tue Sep 01, 2009 9:35 am

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

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

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

Post by Support Team » Tue Sep 01, 2009 12:32 pm

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