Page 1 of 1

JUnit report empty--interference from previous steps?

Posted: Thu Nov 09, 2017 8:48 pm
by Darwin
I am executing our tests with a command-line specifying run configuration and report file name, e.g./z.B.:

Code: Select all

JobCreator.exe /rc:SelectedTest /reportfile:\Test\Reports\TESTAUTOWIN10_2017_11_09_11_10_SelectedTest.rxlog
Additionally, in the test suite the second-to-last (penultimate/vorletzte) step in the test suite Teardown is to call the ReportToPDFModule with the following parameters:

Code: Select all

PDFName       RanorexResults
Details       failed
(The reason for "failed" is because I want to email the PDF to our team with any failures readily visible--otherwise the PDF is too big and too detailed)

After the call to ReportToPDFModule, the final step in the test suite is to execute a user code module to save the report and export a couple stats to some files--this is simply so my batch file can grab these numbers and put them into the team email for quick overview. The code is:

Code: Select all

Ranorex.Core.Reporting.TestReport.SaveReport();
            
var suiteActivity = Ranorex.Core.Reporting.TestReport.CurrentTestSuiteActivity;
int casesSucceeded = suiteActivity.TotalSuccessTestCaseCount;
int casesFailed = suiteActivity.TotalFailedTestCaseCount;
			
StreamWriter suiteSucceeded = new StreamWriter("Succeeded", false);
suiteSucceeded.WriteLine(casesSucceeded.ToString());
suiteSucceeded.Close();
			
StreamWriter suiteFailed = new StreamWriter("Failed", false);
suiteFailed.WriteLine(casesFailed.ToString());
suiteFailed.Close();
The problem:
I wish to generate JUnit reports so I can import them into a DB for tracking and reporting. However, whether I try the command-line parameter "/junit" or check "Create a jUnit compatible copy of the report" in the Test Suite Properties, the XML file is generated (e.g., TESTAUTOWIN10_2017_11_09_11_10_SelectedTest.rxlog.junit.xml), but it is blank.

So I'm doing several things here:
  • Running a specific run-configuration
    Specifying a custom name for the report file
    Exporting (only "failed") report to PDF file via Automation Helper
    Saving the report in user code explicitly
EDIT: I want to point out that I am not customizing the report file in any way other than specifying a name. Behavior is same if I launch tests from command-line or Ranorex Studio. Number of failures does not appear to be a factor either.

Rather than potentially spend a lot of time sorting through the various factors here to see what the culprit may be, I'd like to ask the Ranorex team if there is a known issue generating a JUnit report with any of these actions? Thank you--

Re: JUnit report empty--interference from previous steps?

Posted: Fri Nov 10, 2017 12:48 pm
by asdf
I think there was a bug in Ranorex 7.2.0 that could lead the jUnit report to be empty. I would suggest updating Ranorex to 7.2.1 and check if the problem still remains.

Re: JUnit report empty--interference from previous steps?

Posted: Tue Nov 14, 2017 12:41 am
by Darwin
Thank you--that was the culprit. I have upgraded to 7.2.1 from 7.2 and am no longer encountering the issue.