Forum Discussion
- aaronpliuFrequent Contributor
em_qdx ,
you may need to collect test results information and construct HTML report by yourself.
It's very easy to create a HTML report.
All of test running information would be retrieved from testResults.
For instance:
// retrieve test running info for (r in runner.results.sort {it.getStartTime()}) {} // construct HTML report def writer = new StringWriter() def builder = new groovy.xml.MarkupBuilder(writer) builder.html { head {} }
Thanks,
/Aaron
- nmraoChampion Level 3
Can't the ReadyAPI tool does this out of the box (might need some configuration)?
By the way, are you hosting the test result / report into some web server ? How are you doing this part?
- KarelHusaChampion Level 1
nmrao ,
as far as I know there is no function to send a report automatically in ReadyAPI.
In ReadyAPI there are nice options of reporting, however I am not aware of any way to execute a follow-up action. In the end the report files are placed in the output directory.
On TestCase and TestSuite level there are Report script holders, but the purpose of the script is to extend the scripting options (i.e. is executed before the reports are finished, not after). on project level there is nothing.
A good place to execute specific actions are the events. But here there is no "TestRunListener.afterReport" event. The closest available is TestRunListener.afterRun, but at that time report isn't created yet. But you can take the TestRunner's result data, process them and send them via Groovy.
So, the follow-up action to take the standard report, put it somewehre and send a notification has to be done externally, e.g. from the CI/CD pipeline.
This might be a good point for a reature request.
Best regards,
Karel
- KarelHusaChampion Level 1
Related Content
- 4 years ago
- 4 years ago
- 3 years ago
Recent Discussions
- 21 days ago