Ask a Question

Is ist possible to see why an assertion test step fails?

SOLVED
diva-e-api-test
New Contributor

Is ist possible to see why an assertion test step fails?

I have an assertion test step which fails and I have no idea why it does. It would be very helpful to have the same information as in a REST-request test step where it is possible to add an assert. If I run the test step and the assertion fails, I get information like"Comparison failed. Path: [$['variable'][0]['code']]; Expected value: [xyz; Actual value: [xxy]. "

2 REPLIES 2
Radford
Super Contributor

To me that doesn't seem right, perhaps it might be best to raise a support call to see if this is expected behaviour or not.

 

As a work around you can try adding the following to your test case teardown script:

 

testRunner.getResults().each() { result ->
	if(result.getStatus().toString() != 'OK' ){
		log.error('TestStep "' + result.getTestStep().getName() + '" finished with the status ' + result.getStatus().toString())		

		result.getMessages().each() { message ->
			log.error('Error message: ' + message) 
		}
	}
}

 

It loops through all of the test steps in your test case and prints error messages for failed steps.

Thank you for reply. It worked, I saw some more information at script and error log.

 

I still found another good tip at https://www.soapui.org/scripting-properties/tips-tricks.html#8-Logging-results. These results contain the value of properties which do not match.

cancel
Showing results for 
Search instead for 
Did you mean: