Sahi Pro - Sahi Reports
abstract This section explains how reporting works in Sahi and how to customize it.
- All report data is stored in the database by default.
- At the end of a suite, Sahi Pro reads the data from the database and converts them to XML
- The XML is then converted into desired reports using XSL transformations
info By default, Sahi Pro ships with XSLs for html, xml, junit, excel and email formats.
These are stored in
sahi_pro/config/reports/folder under folders named
xmlare not special keywords. These can be defined by the user.
When Sahi sees the logType as
html, it will look for a folder
This folder contains various XSL files for transforming data as desired, and a report.properties file.
A brief description of various XSL files:
|script_report.xsl||Output for individual scripts|
|suite_report.xsl||Output for a single suite|
|suites_list.xsl||Creates the default listing of all suites (This may only be needed by the default online reporting)|
|testcase_report.xsl||Creates the output for individual scripts but also shows summary of testcases (Refer _testcase() API)|
|reconciled_report.xsl||Output for different view of data. For example, to show stepwise time comparisons in a load test|
The names of the output files can be governed by the entries in
script_file.name=<reportId>.html suite_file.name=index.html images.copy=true images.dir=images
Variables available are
<reportId>and will be replaced correctly in the file names.
images.copy tells Sahi whether screenshots images should be copied and images.dir specifies the copy destination folder.
userdata/bin/testrunner.bat. Look for
and change it to
Reports are generated using XSLs.
XSL files are by default in subfolders of
They can be overridden in
Sahi will first look for any report xsl in
If it is not found, it will default to
For example, xsls for
htmlreports are in
To modify existig xsl, copy it over into
with the same subfolder name.
Eg. if you want to modify
config/reports/html/suites_list.xsl, copy it such that you have
Now modify this copied file as needed.
To create a new log type copy
Edit the xsl files as desired. You can test your xsl at runtime by navigating to any existing logs and adding
&type=mytypeat the end of the log url.
For example, click on the "Logs" link on the dashboard and drill down to any particular script report.
You may see a URL like this on the browser address bar:
&type=mytypeto the end such that it looks like
This will show you your modified output according to the xsl in
When ready with the correct XSL, open testrunner.bat or drun.bat and pass
You will now see the logs created according to your xsls.
warning The older variables in sahi.properties/userdata.properties are no longer honoured:
Multiple suite reports can be downloaded directly from the logs page. One can set the report type from the "Download as" dropdown.
The reports can be downloaded with varying formats including email, html, xml, excel, junit, tm6.
One can also download multiple script reports inside a suite, if there exists any script inside that suite.
When one wants to get rid of refreshing the logs page again and again, one can check the auto refresh checkbox.
So while the script or suite is executing, checking the auto-refresh checkbox will refresh the page after every 2 seconds till the excecution completes.
One can show or hide network activity logs along with other activity logs with following two scenarios:
- Clicking the "Expand all" link will expand the network activity content as well.
- Clicking the "Collapse all" link will collapse the network activity content as well.
- Checking the "Show failed/all" checkbox will show only those steps which has failed network activity.
- Clicking the "Expand all" link will expand the only expand the logs content and not the network activity content.
- Clicking the "Collapse all" link will collapse the network activity content but if "Expand all" is clicked then network activities will show up again.
- Checking the "Show failed/all" checkbox will show only failed steps.