Hi,
I’m trying to create a test but I’m facing a problem when I use jsonPath. First I would like to know if there’s some log where I can find what was returned on each request or somewhere I can find the reason of this error:
java.lang.IllegalArgumentException: Invalid container object
at com.jayway.jsonpath.JsonPath.read(JsonPath.java:208)
at io.gatling.core.check.extractor.jsonpath.JsonPathExtractors$.io$gatling$core$check$extractor$jsonpath$JsonPathExtractors$$extractAll(JsonPathExtractors.scala:46)
at io.gatling.core.check.extractor.jsonpath.JsonPathExtractors$$anonfun$1$$anon$1.apply(JsonPathExtractors.scala:59)
at io.gatling.core.check.extractor.jsonpath.JsonPathExtractors$$anonfun$1$$anon$1.apply(JsonPathExtractors.scala:56)
at io.gatling.core.check.CheckBase$$anonfun$check$3$$anonfun$apply$4.apply(Check.scala:65)
at io.gatling.core.check.CheckBase$$anonfun$check$3$$anonfun$apply$4.apply(Check.scala:64)
at io.gatling.core.validation.Success.flatMap(Validation.scala:28)
at io.gatling.core.check.CheckBase$$anonfun$check$3.apply(Check.scala:64)
at io.gatling.core.check.CheckBase$$anonfun$check$3.apply(Check.scala:63)
at io.gatling.core.validation.Success.flatMap(Validation.scala:28)
at io.gatling.core.check.CheckBase.check(Check.scala:63)
at io.gatling.http.check.HttpCheck.check(HttpCheck.scala:30)
at io.gatling.http.check.HttpCheck.check(HttpCheck.scala:29)
at io.gatling.core.check.Checks$$anonfun$check$1$$anonfun$apply$1.apply(Check.scala:30)
at io.gatling.core.check.Checks$$anonfun$check$1$$anonfun$apply$1.apply(Check.scala:30)
at io.gatling.core.validation.Success.flatMap(Validation.scala:28)
at io.gatling.core.check.Checks$$anonfun$check$1.apply(Check.scala:30)
at io.gatling.core.check.Checks$$anonfun$check$1.apply(Check.scala:29)
at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:111)
at scala.collection.immutable.List.foldLeft(List.scala:84)
at io.gatling.core.check.Checks$.check(Check.scala:29)
at io.gatling.http.ahc.AsyncHandlerActor.checkAndProceed$1(AsyncHandlerActor.scala:162)
at io.gatling.http.ahc.AsyncHandlerActor.io$gatling$http$ahc$AsyncHandlerActor$$processResponse(AsyncHandlerActor.scala:175)
at io.gatling.http.ahc.AsyncHandlerActor$$anonfun$receive$1.applyOrElse(AsyncHandlerActor.scala:55)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:425)
at akka.actor.ActorCell.invoke(ActorCell.scala:386)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:230)
at akka.dispatch.Mailbox.run(Mailbox.scala:212)
at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:506)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
I’ve written this test
exec(http(“add_product”)
.post("/Checkout")
.headers(headers_checkout)
.param(“Product”, code)
.check(jsonPath("$.success").saveAs(“canGoOn”)))
.pause(461 milliseconds)
.doIf("${canGoOn}", “true”){
// another tests
}
I’m sure the problem is with the jsonPath, but I don’t know what is causing this… This call returns a json like this: {success: true}
I’ve tried using exists and find functions, but the same error ocurred.
Can you help me with this?
Thanks in advance,
Augusto