Page 1 of 1

Disable Default Report but Allow Custom Report

Posted: Thu Dec 01, 2011 8:40 pm
by AppTester
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:

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;
        }
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.

Re: Disable Default Report but Allow Custom Report

Posted: Fri Dec 02, 2011 9:11 am
by sdaly
I always wipe any rxlogs and images in the current working directory in my global set up. Not sure if that is the best way, but it works for me! :lol:

Re: Disable Default Report but Allow Custom Report

Posted: Fri Dec 02, 2011 11:06 am
by Support Team
Hi,
AppTester wrote:Please let me know, how I can keep my custom report, but disable the generation of the default report file.
If you use Ranorex Studio and the Test Suite view. You can simply set the rxlog file inside properties dialog of the test suite to nothing (String empty). Then Ranorex should generate only your report.
Or you use scotts solution.

Regards,Peter
Ranorex Team

Re: Disable Default Report but Allow Custom Report

Posted: Mon Dec 05, 2011 7:26 pm
by AppTester
You said I can "set the rxlog file inside properties dialog of the test suite to nothing (String empty)." Please be more specific. I cannot find the properties dialog of the test suite. What steps should I take to find it?

Re: Disable Default Report but Allow Custom Report

Posted: Tue Dec 06, 2011 12:38 pm
by Support Team
Hi,

Please take a look to following documentation
http://www.ranorex.com/support/user-gui ... html#c3024
In the documentation you will find the properties dialog of the Test Suite. In this dialog you can set the Report Name. Please clear the entire text box and Ranorex should generate no report.

Regards,
Peter
Ranorex Team