Hi there,
Currently browsing through a couple of stress tools and gatling looks promising so far.
It does seem to fit one of my requirements, which is to spawn several different users for a said test.
I found out that Feeders might just do the job, but I have some problems implementing it. This is what I tried so far.
I attempt to have the following structure for my tests :
`
class UserSignIn extends Simulation {
val httpProtocol = http
// […]
val feedUser = jsonFile(“users.json”)
val scn = scenario(“User signing in”)
.feed(feedUser.random)
.exec(SignIn.signin, /* A few more scenarios executing */, SignOut.signout)
setUp(
scn.inject(
atOnceUsers(20)
)).protocols(httpProtocol)
object SignIn {
// A few headers
val uri1 = “https://some.domain”
val signin= exec(
http(“sign_in”)
.post("/api/users/sign_in")
.headers(headers_0)
.body(/…/)
.resource(
// A few more calls
)
).pause(15)
}
object SignOut {
// More cool stuff !
}
}
`
My JSON file looks like this :
`
[
{
“user”: {
“login”: “”,
“password”: “”,
// A few more parameters
}
}, {
// A couple more users
}
]
`
I have no idea how to use the fed user in the body part.
Of course, it returned a 401 (but compiled !).
I tried to add a couple .queryParam() , as specified, which prevented my code to compile.
After messing around and reading stuff here and there, I decided to ask this Google Group.
I also read this article, which was outdated (Gatling: 1.5.3), but decided to give it a try.
So I changed my feeder to use a tsv and used this body line :
.body("${user}") .asJSON
And re-arranged my JSON like this :
`
user
{{“user”:{“login”:"",“password”:""/…/}}
{{“user”:/* …/}}
{{“user” …*/}}
`
This time, I got a different error message :
`
GATLING_HOME is set to //gatling
11:05:37.786 [ERROR] i.g.c.ZincCompiler$ - //gatling/user-files/simulations/user_signin/user_signin.scala:35: type mismatch;
found : String("${user}")
required: io.gatling.http.request.Body
`
I am kind of lost now… Anyone might giving me some advices ?
I hope I provided enough details about my situation.
Thanks,
Alexis