Disable Default Report but Allow Custom Report
Posted: Thu Dec 01, 2011 8:40 pm
Just trying to generate my own custom report. Doing so has been successful, but with each run a default Ranorex report is generated as well. For example a Test_Case_20110805_100710.rxlog file is created each time. What I need is for this file to NOT be generated in addition to my custom report. So I only want Custom_Report.rxlog to be generated.
My solution does not use the recorder, but it does use the repository. Everything is custom implemented in classes using C#.
In the main method, my custom report is created and ended as follows:
I am using Report.Info(), Report.Warn(), Report.ScreenShot(), and other reporting lines in my other classes to add to the custom report created in the main method.
Please let me know, how I can keep my custom report, but disable the generation of the default report file.
Many thanks.
My solution does not use the recorder, but it does use the repository. Everything is custom implemented in classes using C#.
In the main method, my custom report is created and ended as follows:
Code: Select all
class Program
{
[STAThread]
public static int Main(string[] args)
{
string logFileName = string.Format("Test_Case_{0:yyyy-MM-dd_hh-mm-ss-tt}.rxlog", System.DateTime.Now);
Report.Setup(ReportLevel.Always, logFileName, true);
Keyboard.AbortKey = System.Windows.Forms.Keys.Pause;
int error = 0;
try
{
error = TestSuiteRunner.Run(typeof(Program), Environment.CommandLine);
}
catch (ImageNotFoundException e)
{
//code omitted
}
catch (RanorexException e)
{
//code omitted
}
catch (ThreadAbortException)
{
Report.Warn("AbortKey has been pressed");
Report.End();
Thread.ResetAbort();
error = -1;
}
catch (Exception e)
{
//code omitted
}
finally
{
try
{
//code omitted
error = -1;
Report.End();
}
catch (Exception e)
{
//code omitted
}
}
Report.End();
return error;
}
Please let me know, how I can keep my custom report, but disable the generation of the default report file.
Many thanks.