Forum Discussion

rlong98's avatar
rlong98
Contributor
10 years ago

How to capture assertions list with it's response?

Not sure if the image will appear   If you run a testStep and look at the Assertions. SoapUI returns the assertion Green/Red as well as adding "- VALID" or "- FAILED"   Question: Is there a w...
  • rlong98's avatar
    10 years ago

    I actually found my answer in a post

     

    // get the testStep
    def testStep = testRunner.testCase.getTestStepByName('Test Request')
    // print assertion names an its status
    testStep.getAssertionList().each{
        log.info "$it.label - $it.status"   
    }

     

    it was the "status" I needed to add.  so for my code I put:

     

        testStep.getAssertionAt(AssertionCount).name + '->[' + testStep.getAssertionAt(AssertionCount).status + ']'