Ask a Question

How to capture assertions list with it's response?

SOLVED
rlong98
Contributor

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 way to captuer that full string? The name + status

 

i.e.

SOAP Response - VALID

XPath Match - VALID

Contains - VALID

Not Contains - FAILED

 

Currently I'm pulling the assertionsList - testStep.getAssertionAt(AssertionCount).getLabel()

But I want the extra status piece to go along with it.

Thank you, Rob

 

1 ACCEPTED SOLUTION

Accepted Solutions
rlong98
Contributor

Re: How to capture assertions list with it's response?

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 + ']'

 

 

View solution in original post

2 REPLIES 2
nmrao
Community Hero

Re: How to capture assertions list with it's response?

Can you please add little more details regarding your use case, how are you going use or run the tests?



Regards,
Rao.
rlong98
Contributor

Re: How to capture assertions list with it's response?

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 + ']'

 

 

View solution in original post

cancel
Showing results for 
Search instead for 
Did you mean: