After having lot of Groovy written for just retrieving the data from one place and copying it to another place, I thought to investigate some new commands. Although these are not new in the Javadoc, it was just new for me only ;).
So I just went ahead on how to extract the status of the test steps that has been executed.
One point to note over here is that, add the Groovy script to get the status of test steps at least in a test case or you can add the script to get the status of test step execution in the teardown script of the test case or test suite.
So here is the simple Groovy that will fetch you the status of your test steps
for (r in testRunner.results)
{
log.info "Test Step " + <test_step_name> + "has been executed with status as " + r.status
}
If test step has been passed then result will be OK, on the other hand if test step has been failed, then status will be Failed
In the end it turns out to be very simple command which will be really very helpful for everyone.
So I just went ahead on how to extract the status of the test steps that has been executed.
One point to note over here is that, add the Groovy script to get the status of test steps at least in a test case or you can add the script to get the status of test step execution in the teardown script of the test case or test suite.
So here is the simple Groovy that will fetch you the status of your test steps
for (r in testRunner.results)
{
log.info "Test Step " + <test_step_name> + "has been executed with status as " + r.status
}
If test step has been passed then result will be OK, on the other hand if test step has been failed, then status will be Failed
In the end it turns out to be very simple command which will be really very helpful for everyone.
No comments:
Post a Comment