Question about queryParamSeq on HTTP request

Hi, I’m trying to make some tests using Gatling, and I’m having a bit of trouble (using 2.1.3 along with the gatling-sbt plugin).

The following code works to test an expected 400 error for an invalid API key:

exec(http(“API”)
.get("/api/v1/transaction")
.queryParam(“api_key”, “123”)

.check(status.is(400))

)

This does not:

exec(http(“API”)
.get("/api/v1/transaction")
.queryParamSeq(Seq((“api_key”, “123”)))
.check(status.is(400))

)

Specifically, I get the following error:

17:35:09.287 [ERROR] i.g.h.a.HttpRequestAction - ‘httpRequest-3’ failed to execute

But this works:

exec(http(“API”)
.get("/api/v1/transaction")
.queryParamMap(Seq((“api_key”, “123”)).toMap)
.check(status.is(400))

)

To make sure it wasn’t to do with our server messing up, I’ve tried giving it a valid API key, and changing it to check for a 200 status, and I still get the same result - it works for individual queryParam calls or for queryParamMap, but not for queryParamSeq. Can anyone see something that I’m doing wrong?

Hi Clint,

This was indeed a bug, and a tricky one: https://github.com/gatling/gatling/issues/2536

Thanks for reporting!

Until we release the fix, you could use the following workaround:

.queryParamSeq(session => Seq((“api_key”, “123”)))