Disable Default Report but Allow Custom Report

Ask general questions here.
AppTester
Posts: 20
Joined: Thu Sep 29, 2011 12:11 am

Disable Default Report but Allow Custom Report

Post by AppTester » 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:

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.

User avatar
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

Re: Disable Default Report but Allow Custom Report

Post by sdaly » Fri Dec 02, 2011 9:11 am

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:

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Disable Default Report but Allow Custom Report

Post by Support Team » Fri Dec 02, 2011 11:06 am

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

AppTester
Posts: 20
Joined: Thu Sep 29, 2011 12:11 am

Re: Disable Default Report but Allow Custom Report

Post by AppTester » Mon Dec 05, 2011 7:26 pm

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?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Disable Default Report but Allow Custom Report

Post by Support Team » Tue Dec 06, 2011 12:38 pm

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