0

I'm currently facing a problem with ReadyAPI testRunner results. In order to design my tests, I use a small teardown script in order to check my testCase's steps status:

log.info "****************** EXECUTION SUMMARY *****"
log.info "nb test steps = "+ testRunner.getTestCase().getTestStepCount()
        for (testStep in testRunner.getResults()){
            log.info "step " + testStep.getTestStep().getName() + " : " + testStep.getStatus()
        }
log.info "**********************************************"  

In most of my tests it fits my requirements but I have a test that gives me incoherent results, ie. It contains 10 steps and displays results for only the five latest

:INFO:nb steps : 10
:INFO:step pending or success : OK
:INFO:step while pending : OK
:INFO:step GetPendingRequest - terminated : OK
:INFO:step while not terminated : OK
:INFO:step disconnect : OK

I have another test from another testSuite which contains similar test structure and which gives me a correct output. I event tried to modify both testCases in order to have the same sequence but I still have the problem.

Has someone already been through an issue like this one ? Any help appreciated

here is a screenshot : Copy of TTM API has the problem, Copy of Use Cases don't project

A.Joly
  • 2,317
  • 2
  • 20
  • 25
  • Screen shot of your test case with steps? Could be because not all steps have result. – Rao Oct 20 '17 at 11:36

1 Answers1

1

It looks like not all your steps have results. You can add testRunner.getResults().size() to your teardown script to confirm how many of your steps have results.

I can't find confirmation on when a step result is created, but the documentation for getResults() says

it "Gets the accumulated results so far; each TestStep returns a TestStepResult when running."

SherylHohman
  • 16,580
  • 17
  • 88
  • 94
Mark
  • 81
  • 6
  • thanks, I didn't know that one, but it shows that only 5 results are available, with no clue on what's wrong :( – A.Joly Oct 23 '17 at 07:00
  • could you try adding a delay before the end of the test case to see if makes any difference? – Mark Oct 23 '17 at 08:56
  • I did, it doesn't make any difference :( – A.Joly Oct 23 '17 at 09:15
  • can you trying adding `for(stepsWithResults in testRunner.getResults()){ log.info(stepsWithResults.getTestStep().getName()) }` to your teardown script. It will log out the test step names for each of the results you have. – Mark Oct 23 '17 at 11:13