0

I'm trying to validate whether error messages returned by API are proper or not. So, I stored all local error message strings in HashMap errorMessage

.doIf(errorMessages.size()>1) { 
    exec(session => {
   assert(ResponseJSON.contains(errorMessages.get("errorMessage1")))
   for ((k,v)<- errorMessages){
      assert(ResponseJSON.contains(v))
    }
}

I could see the error on console as

hook-3' crashed with 'java.lang.AssertionError: assertion failed', forwarding to the next one

But, the Gatling scenarios are not failing here, what is I'm missing ?

Swapnil Kotwal
  • 5,418
  • 6
  • 48
  • 92

1 Answers1

0

Try using an exitHereIfFailed to exit the scenario.

niharika_neo
  • 8,441
  • 1
  • 19
  • 31