I have a csv file that contains the URL and the expected status for the URL. Code is below.
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._
class MySimulation extends Simulation {
object Request {
val request = exec(http(“Test”)
.get("${URL}")
.check(status.is(session => session(“status”).as[Int])))
}
val httpConf = http.baseURL(“https://test.com”)
val records = csv(“data.csv”).records
val users = scenario(“Users”)
.foreach(records, “record”) {
exec(flattenMapIntoAttributes("${record}"))
.exec(Request.request)
}
setUp(users.inject(atOnceUsers(1)))
.protocols(httpConf)
}
When running the simulation I get the message shown in the subject line. It is actually shown for all expected status, like if the test expects 401 then the message would be status.find.is(401), but actually found 401.
Thanks for the help.