We are evaluating Gatling here at Hulu. Like others in this thread, we are using Gatling for more than just load. We are using it to validate certain features under load.
The fact that Gatling is in Scala and is a full-featured programming language rather than a GUI based application is good.
We are having some problems with Gatling. We need to do branching logic for checks. By that, I mean we have multiple ways for a response to pass and multiple ways to fail.
As far as I understand, Gatling only has one linear set of checks for each request:
exec (
http("GET url")
.get("/path")
.check(
xpath("//tag1"),
xpath("//tag2"),
xpath("//tag3"),
)
)
Currently the way that it works is that if the check for xpath(“//tag1”) passes then xpath(“//tag2”) can run, if that passes, then “tag3” can run.
What we need is branching of the checks. I propose two different notations:
/* Simple if Pass Parent - then check children in block */
xpath("//tag1") {
xpath("//tag1A"),
xpath("//tag1B"),
xpath("//tag1C"),
},
/* Case Pass / Fail / Other - Check children block */
xpath("//tag2") {
case check if check.passed => {
xpath("//tag2PASS1")
xpath("//tag2PASS2")
xpath("//tag2PASS3")
}
case check if check.failed => {
xpath("//tag2FAILED1")
xpath("//tag2FAILED2")
xpath("//tag2FAILED3")
}
case check if session("foo").as[String] == "FOO" => {
xpath("//tag2/foo_is_FOO1")
xpath("//tag2/foo_is_FOO2")
xpath("//tag2/foo_is_FOO3")
}
}
Also, there were functions on the check class that don’t seem to do what I want:
/* Things that don't quite work */
xpath("//tag3")
.onSuccess({
xpath("//tag3ON_SUCCESS1")
xpath("//tag3ON_SUCCESS2")
xpath("//tag3ON_SUCCESS3")
})
.onFailure({
xpath("//tag3ON_FAILURE1")
xpath("//tag3ON_FAILURE2")
xpath("//tag3ON_FAILURE3")
})
)
Eventually, we need to see what passed and what failed in the test output:
---- Errors --------------------------------------------------------------------