Thanks for the reply Max,
I'm also struggling with .checkIf()
Here's a summary of my efforts. I'm kinda desperate for any help!
1) checkIf() cannot be chained to .check(), it must be passed into the .check() method.
exec(http("getCanaryPage")
.get(TestEnvironment.pathAccService+"op/canary")
.basicAuth("ldsIdentityTest", DecoderRing.pwd)
.checkIf( session => session("threads").as[Integer] > 1000).jsonPath("$.").exists
)
Here's the error I get:
CanaryPage.scala:14: value checkIf is not a member of io.gatling.http.request.builder.HttpRequestBuilder
So, I put checkIf inside a check() method:
exec(http("getCanaryPage")
.get(TestEnvironment.pathAccService+"op/canary")
.basicAuth("ldsIdentityTest", DecoderRing.pwd)
.check(
jsonPath("$..[?(@.name='JVM:Info')].information.'Thread Count'").saveAs("threads"),
checkIf( session => session("threads").as[Integer] > 1000).jsonPath("$.").exists
))
Now I get:
\CanaryPage.scala:16: missing argument list for method checkIf in trait CheckSupport
Unapplied methods are only converted to functions when a function type is expected.
You can make this conversion explicit by writing `checkIf _` or `checkIf(_)(_)(_)` instead of `checkIf`.
I don't understand what the compiler is trying to tell me to do. I'm scala ignorant and I have stared at the documentation for hours trying to figure out how to use a checkIf to no avail.
Help me Max Bundy! You're my only hope :)