Hi there,
I want to add a short summary of all test-data in the head of the report. In our tests data will be prompt by Ranorex and I want to show the amount of data in the head of the report, e.g.
- 12 customers were inserted
- 10 invoices were created
...
If possible these information should be readable without expanding any test-case at the top of the report.
What will be the best way to add this data to the head of the report?
Regards,
Thomas.
How to show additional information at the head of Report?
- RobinHood42
- Posts: 324
- Joined: Fri Jan 09, 2015 3:24 pm
Re: How to show additional information at the head of Report?
Hello BCTest,
You will need to use a custom report template in order to display runtime information within your report.
The runtime information can be added to the “ActivityStack” using the following lines of code:
After that, we need to change the *.xsl file of our custom report template.
Just add the following part to the file:
Robin
You will need to use a custom report template in order to display runtime information within your report.
The runtime information can be added to the “ActivityStack” using the following lines of code:
var act = Ranorex.Core.Reporting.ActivityStack.Instance; act.CurrentActivity.CustomProperties.Add("MyProperty", "MyValue");You can add the aforementioned code to UserCodeModules or UserCodeMethods.
After that, we need to change the *.xsl file of our custom report template.
Just add the following part to the file:
<!-- Custom header information --> <tr> <xsl:if test="//custom"> <td> <i class="field"> MyProperty<b> <xsl:value-of select=".//custom/@MyProperty"/> </b> </i> </td> </xsl:if> </tr> <!-- END custom header information-->Sample XSLfile: The result will look like this: Cheers,
Robin
You do not have the required permissions to view the files attached to this post.
Re: How to show additional information at the head of Report?
Hello Robin,
exactly what I was looking for.
Thanks!
Thomas.
exactly what I was looking for.
Thanks!
Thomas.
Re: How to show additional information at the head of Report?
Great.
Thanks RobinHood42
Thanks RobinHood42
- RobinHood42
- Posts: 324
- Joined: Fri Jan 09, 2015 3:24 pm
Re: How to show additional information at the head of Report?
You're welcome
Cheers,
Robin
Cheers,
Robin