Forum Discussion
jkrier
10 years agoRegular Contributor
I did find something close to what I am trying to do but I still can't really access the assertion results and add logic to my script depending on their value
This will return the following to the output
But it does not seem to find the status and print "FOUND FAILED"
Not sure why it doesn't work
obj = context.testCase.getTestStepByName("MyTestStep")
assertions = obj.getAssertionList()
assertions.each{
log.info(it.name + ' --> ' + it.status)
}
assertions.each{
if(it.status == "FAILED"){
log.info "FOUND FAILED"
}
}
This will return the following to the output
Wed Nov 05 14:28:48 MST 2014:INFO:Match content of [OrderStatus] --> FAILED
Wed Nov 05 14:28:48 MST 2014:INFO:Match content of [OrderStatus] --> FAILED
Wed Nov 05 14:28:48 MST 2014:INFO:Valid HTTP Status Codes --> VALID
Wed Nov 05 14:28:48 MST 2014:INFO:Invalid HTTP Status Codes --> VALID
But it does not seem to find the status and print "FOUND FAILED"
Not sure why it doesn't work