Page 1 of 1

How to add information in Jenkins report with Ranorex

Posted: Wed Mar 02, 2016 10:39 am
by mto
Hello all,

I would like to display additional information in my reports. In fact, i have serveral testcases and these testcases are executed in different browsers (FF39, FF41,FF42..., IE6, IE7..., Safari, Chrome43, 45, 47....etc).

The problem i have is that the name of the browser is not displayed in jenkins reports. So is difficult to know in which browser the testcase is executed.

For example, i would like display my tests in jenkins like this:
- TestCase1_firefox39
- TestCase1_firefox40
- TestCase1_firefox41
- ...etc

Now, i have this kind of report in jenkins (see screenshot attached).

Thank you in advance for your help,

Best regards

Re: How to add information in Jenkins report with Ranorex

Posted: Fri Mar 04, 2016 2:11 pm
by Support Team
Hello mto,

Unfortunately, I'm not exactly sure were the issue occurs. May I ask if you use a specific plugin for Jenkins? It would be great if you could describe the workflow in detail. With which command do you execute the test?

Generally, it is possible to define the location and the name of the Ranorex Report via the Windows batch command. More information about defining the command can be found in the blog entry about Jenkins.

Sincerely,
Johannes

Re: How to add information in Jenkins report with Ranorex

Posted: Wed Nov 02, 2016 6:37 pm
by mto
Hello Johannes,

Thank you for your response.

Yes i am using Windows batch command but i am not sur you understood my request.

This is an example of Windows batch command that i am using for reports:
bin\Debug\MyProject.exe /zr /zrf:Report-Build.rxzlog /rf:Report-Build /cfg:TestBrowser
Reports are correctly generated but it lacks information, as i explained that in my first comment, i would like to display in which browser the testcase is executed. Now all the testcases in the jenkins report have the same name and it is impossible to identify the browser.

Now to identify the browser, I look at the Excel file because the testcases in the test report are ordered according to the excel file.

Best regards,

MTO,

Re: How to add information in Jenkins report with Ranorex

Posted: Wed Nov 02, 2016 7:58 pm
by krstcs
When you say "Jenkins Report", are you talking about the Jenkins page that lists the status of the job?

If you're talking about the RANOREX report, are you publishing it to Jenkins? If so, then are you saying that the report is empty of data, or are you getting an error, or are you just not seeing the report linked in Jenkins?

Please be more specific about exactly what you are having a problem with as the details are very important.


ALSO, please always include the following when raising an issue on the forums:

FULL Ranorex version being used (only 6.0.2 and 6.1.1 are currently supported).
Windows version of all systems being used for testing or test creation

Re: How to add information in Jenkins report with Ranorex

Posted: Thu Nov 03, 2016 10:33 am
by mto
krstcs

The Ranorex report is correctly generated and all browsers are displayed here. So no problem with these reports. In fact, i am using this Ranorex report and transform it to be compatible with Jenkins. I'am using this in Jenkins configuration:
ranorex-to-xunit.xsl
Reports in jenkins are ok, not empty and no error. But the name of the browser on which testcase was executed is not visible (see attachment in my first comment). All the names of the testcases are the sames (without knowing in which browser was executed).

There is a way to add the browser name in ranorex-to-xunit.xsl ? or another solution ?

I hope you understood now.

Ranorex v6.1.0
Windows 7 - 64bits

Re: How to add information in Jenkins report with Ranorex

Posted: Wed Nov 09, 2016 12:59 pm
by jma
Hi mto,

Probably, this could be implemented by modifying the ranorex-to-xunit.xsl file. Note that this depends also on where the name of the browser is stored in the *rxlog.data file.

For example, if the browser name is stored in a parameter of the test case, the browser name could be added to the test case name by the concat function.

*.rxlog.data

Code: Select all

			<activity
				result="Failed"
				duration="328ms"
				durationms="328"
				type="test case"
				rid="1d01ce4a8436f6be"
				totalerrorcount="1"
				totalwarningcount="0"
				totalsuccesscount="0"
				totalfailedcount="1"
				totalblockedcount="0"
				testcasename="TestCase2"
				testcaseid="2a184a7a-5a93-4388-a66c-8b8b830119f3"
				maxchildren="0">
				<params>
					<param
						name="Browser">
						Firefox
					</param>
				</params>
				<detail>
ranorex-to-xunit.xsl

Code: Select all

<xsl:when test="@testcasename">
  <xsl:value-of select="concat(@testcasename,'_',params/param)"/>
</xsl:when>
Before implementing such changes, I would recommend gaining knowledge of XSL Transformations. When implementing the changes, you could use Visual Studio to debug the transformation: https://weblogs.asp.net/stevewellens/de ... ual-studio