Forum Discussion

tonielfuster's avatar
tonielfuster
Occasional Contributor
9 years ago

Get TestStep outcome in a Groovy TestStep

 

Hi guys. 

 

In a looped testStep I'm saving in a txt file Request and Response.

 

I want to save as well the result of this step (If has passed all the assertions). In other words Green as OK. Red as NOK.
 
It is possible using Groovy script?
 
Thanks in advance.  Toni

11 Replies

    • tonielfuster's avatar
      tonielfuster
      Occasional Contributor

      Thanks for your answer Rao.

       

      This is not what I'm trying to do.

       

      The idea is take status of previous SOAP step (which is inside a loop) in execution time. And report it in the txt file indicating if has passed (all assertions are ok) or not (some of the assertion have failed)

       

      Your approach is after execution and in testCase level. In my case, if testRunner.status is called (following your approach), response is RUNNING :( . I'm trying to obtain the Result of a testStep.

       

      Screenshot added, maybe can help you to understand what I need

       

      sample.png

       

      Thanks

      • nmrao's avatar
        nmrao
        Champion Level 3
        Better the details, better the answers :)
        Assuming that test request has all the assertions to be made.
        So if any assertion failed in certain iteration, the next step (writing result) is not executed, otherwise it is executed.