Is there a way to display a global parameter in the header of the report? I've edited it a bit to show the user who's run the test, and it already shows the Test Suite name, but I'd also like to show the global parameter which is the URL that we are running the test on. Is there a way to do that?
The information I want is shown in a collapsed container, but I'd like it up higher so I don't need to expand the container before taking a screenshot of the header.
Report Customization - Add Global Parameter
-
- Posts: 56
- Joined: Thu Oct 29, 2020 12:47 am
Re: Report Customization - Add Global Parameter
Hi,
Basically, you must modify both View.rxlog.data and RanorexReport.xsl files. Please see the attached screenshot and sample solution. Sadly, the forum attachment system appears to be broken again, so I'm uploading it to my google drive:
https://drive.google.com/file/d/1OP2ylv ... sp=sharing
https://drive.google.com/file/d/1vexex0 ... sp=sharing
Basically, you must modify both View.rxlog.data and RanorexReport.xsl files. Please see the attached screenshot and sample solution. Sadly, the forum attachment system appears to be broken again, so I'm uploading it to my google drive:
https://drive.google.com/file/d/1OP2ylv ... sp=sharing
https://drive.google.com/file/d/1vexex0 ... sp=sharing
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
-
- Posts: 56
- Joined: Thu Oct 29, 2020 12:47 am
Re: Report Customization - Add Global Parameter
I noticed the images not being added to posts yesterday
Ok, so I get how to add the data to the report itself, but how do I get the parameter itself in there? It changes depending on which URL is entered in the global parameters (which we use in Jenkins too). Looking at the rxlog.data for a test I ran, it has the following for the parameter I want to appear at the top of the report:
How can I reference that parameter in the rxlog.data template? Currently, I have exactly what you put in for the Custom Property, but instead of "000" or whatever, what do I put there?
Ok, so I get how to add the data to the report itself, but how do I get the parameter itself in there? It changes depending on which URL is entered in the global parameters (which we use in Jenkins too). Looking at the rxlog.data for a test I ran, it has the following for the parameter I want to appear at the top of the report:
Code: Select all
<params>
<param
name="URL">
https://www.google.com
</param>
</params>
-
- Posts: 56
- Joined: Thu Oct 29, 2020 12:47 am
Re: Report Customization - Add Global Parameter
I nearly have it.
Got me the name portion of the parameter. How do I get it to pull in the value?
Code: Select all
<tr>
<td>
<i class="field">
URL Tested
<b>
<xsl:value-of select=".//param/@name" />
</b>
</i>
</td>
</tr>
Code: Select all
<params>
<param
name="URL">
https://www.google.com
</param>
</params>
-
- Posts: 56
- Joined: Thu Oct 29, 2020 12:47 am
Re: Report Customization - Add Global Parameter
I GOT IT!
Posting this here in case someone else has a similar question.
All I did was add a bracket around the parameter name to get me the value instead of the name of the parameter.
Posting this here in case someone else has a similar question.
All I did was add a bracket around the parameter name to get me the value instead of the name of the parameter.
Code: Select all
<tr>
<td>
<i class="field">
URL Tested
<b>
<xsl:value-of select=".//param[@name='URL']" />
</b>
</i>
</td>
</tr>