Hi,
I am new in Ranorex.
I recorded several test cases for a desktop application.
Some reports are in success and some are gets error report.Both are ok in their test cases.
But my question is that, how can i set different report path for error reports and success report?
such that if error report occurs then report will move to error folder, if success report occurs then report will move to success folder.
Thanx,
Pabitra Swain
Set recorded report paths for Ranorex
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Set recorded report paths for Ranorex
Hello Pabitra,
I’m afraid that there is not out-of-the-box solution for moving reports to specific folders based on their result.
In general, you could use the the “int error” which is specified within the Program.cs file in order to check whether the test has failed or succeeded (0 = Success, -1 = Failure).
For example:
Program.cs : Code added just before "return error"
Regards,
Robert
I’m afraid that there is not out-of-the-box solution for moving reports to specific folders based on their result.
In general, you could use the the “int error” which is specified within the Program.cs file in order to check whether the test has failed or succeeded (0 = Success, -1 = Failure).
For example:
Program.cs : Code added just before "return error"
using System.IO;
string successFolder = @"c:\success"; string failureFolder = @"c:\failure"; if (!Directory.Exists(successFolder)) { Directory.CreateDirectory(successFolder); } if (!Directory.Exists(failureFolder)) { Directory.CreateDirectory(failureFolder); } string reportLocation = Directory.GetCurrentDirectory(); string reportFilename = TestReport.ReportEnvironment.ReportName; string sourceReportFilename = String.Format(@"{0}\{1}.rxzlog", reportLocation, reportFilename); if(error == 0) { string destinationReportFilename = String.Format(@"{0}\{1}.rxzlog",successFolder, reportFilename); File.Copy(sourceReportFilename, destinationReportFilename); } else { string destinationReportFilename = String.Format(@"{0}\{1}.rxzlog",failureFolder, reportFilename); File.Copy(sourceReportFilename, destinationReportFilename); }Please note that this sample requires a compressed report file. Further information on how to enable the compressed report can be found here: TestSuiteSettings
Regards,
Robert
Re: Set recorded report paths for Ranorex
Since Ranorex returns a 0 (Success) or -1 (Failed) when the test ends, you could use a batch file to run the test and then, based on the result returned back to the OS, you could move the report to the correct folder.
Shortcuts usually aren't...
-
- Posts: 13
- Joined: Thu Dec 04, 2014 5:21 pm
Re: Set recorded report paths for Ranorex
Hello Support Team,
Yes, its worked for me.Thanks for your support.
Actually only report movement is not enough for proper view, so i had also transfered all files and all image folders for proper view of report. And its works nice.
Once again thanks.
Yes, its worked for me.Thanks for your support.
Actually only report movement is not enough for proper view, so i had also transfered all files and all image folders for proper view of report. And its works nice.
Once again thanks.

- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Set recorded report paths for Ranorex
Hello Pabitra,
I'm glad that we could help you in this matter.
Regards,
Robert
I'm glad that we could help you in this matter.
Regards,
Robert