Improve Error Messages in Reports?

So, in the reports, I errors reported as following:

regex.notExists didn’t match: unexpectedly found [ ] didn’t match: (3) didn’t match: found 2 didn’t match: (10) didn’t match: found 5 didn’t match: (10) didn’t match: found 6 didn’t match: (10) didn’t match: found 4

It’d be a lot more useful if the errors were reported with the failing expression, e.g.

regex(".+").notExists didn’t match: unexpectedly found foo

jsonPath("$[*]").is didn’t match: (3) didn’t match: found 2

This would be especially useful where I have long chains of checks on content - then I’d know exactly where my check chain is failing.

I’ve nosed around the code already to see if that would be an easy obvious fix.

Looks like the message is generated at gatling-core/src/main/scala/io/gatling/core/check/Check.scala, line 65
Which would make the culprit

So, the JsonPathExtractor has a name, which is assigned just “jsonPath”

I see that all the subclasses of JsonPathExtractor are passed a criterion which is an Expression[String]

At first, I thought I could just place that in the parent class and then use it as part of the name, but that didn’t seem to work.

I think it probably has something to do with criterion being an Expression[String], which I know is typed to be (Session) => String - but I’m not really sure what to do with that at construction time so that I can set the name the way I’d like.

name = “jsonPath(” + criterion + “)”

just resulted in “jsonPath().is” being printed for the reported error.

So, any pointers where I’m going wrong here?


Are you now using a SNAPSHOT version ?

I just did this quick test :

val scn3 = scenario(“Scenario3”)


Then, in the console, I get :

17:12:58.285 [WARN ] i.g.h.a.AsyncHandlerActor - Request ‘Home’ failed : jsonPath($.foo).is(bar) didn’t match: found nothing

And in the report, I have :

How do your checks look like ?


Oops - my fault, I messed up the versions when testing.

I think I fixed it :