Forum Discussion

TELENET_NV_Supp_1's avatar
TELENET_NV_Supp_1
Occasional Contributor
15 years ago

Structure of testrunner.results collection

Hi,

I wanted to know how can testrunner.results collection be accessed for a particular iteration.
Basically, my testcase is as follows,

1)DataSource step
2)JDBC step
3)Operation
4)Groovy Step (Here i am using testrunner.results to get the status of all test steps in a single iteration)
5)DataSource Loop (say for 4 iterations)


In the groovy step the following script is present

for( r in testRunner.results )
{
log.info("TestStep Name" +r.testStep.name)
log.info("Status" + r.status)

}

But this prints the status of all the iterations executed previously.
For e.g. In the third iteration, groovy prints the status of all test steps for the previous iterations (i.e. first and second iterations as well)
How can I get the status for a particular iteration directly(eg. Third iteration only skipping the previous iterations' results)
Furthermore, explanation on the structure of testrunner.results collection would be an additional help.

2 Replies

  • William_Willafo's avatar
    William_Willafo
    Occasional Contributor
    Instead of iterating over all results with a for loop, you could print out only the last 2 or 3 results in the array, however many you need.
  • Hi!

    the results collection always contains one TestStepResult object for each TestStep execution while running your testcase, so you should be able to calculate the index into the collection if knowing how many steps that are in the loop and before it. Does that make sense?

    regards,

    /Ole
    eviware.com