Okay, I’ve got another feeder/http POST body question. Thank you for all of your help so far - Gatling is an awesome tool, and I feel like I’m so close to getting it to work for our project.
I’m continuing to work on my registration load test, and now I’m running into the following issue when attempting to use a feeder to generate my JSON POST body - some lines don’t seem to be correctly handling double quotes in my CSV file. (Of three requests, one worked, two mysteriously didn’t.)
Relevant script pieces:
val userData = csv(“test.csv”).queue
val httpConf = http.baseURL(“http://myappurl.com/api”)
val scn = scenario(“Register user”)
.feed(userData)
.exec(
http(“POST registration”)
.post("/user/register")
.headers(headers_1)
.body(StringBody("""{“username”:${username}, “email”:${email}, “imei”:${imei}, “gcmId”:${gcmId}, “age”:${age},“albumSelection”:${albumSelection},“latitude”:${latitude},“longitude”:${longitude},“emailOptIn”:${emailOptIn},“termsOptIn”:${termsOptIn} }""")))
My CSV file looks like this:
username,emailOptIn,albumSelection,termsOptIn,age,gcmId,longitude,latitude,imei,email
““tester7105408553"",true,"“clean”",false,"“62"”,"“7105408553"”,0,45,"“999997105408553"”,""tester7105408553@mailinator.com””
““tester7317165156"",true,"“clean”",true,"“59"”,"“7317165156"”,176,65,"“999997317165156"”,""tester7317165156@mailinator.com””
““tester6271383680"",true,"“explicit”",true,"“37"”,"“6271383680"”,-42,-82,"“999996271383680"”,""tester6271383680@mailinator.com””
It seems like everything is correct there, but when I run with logging turned on, I see the following messages:
Session:
Session(Register user,1,Map(latitude → 65, email → “tester7317165156@mailinator.com”, username → tester7317165156", imei → “999997317165156”, age → “59”, longitude → 176, termsOptIn → true, emailOptIn → true, gcmId → “7317165156”, albumSelection → “clean”),1382385464346,0,List(),List(KO),List(),List())