Hello,
I'm new to this, so please bear with me.
I'm getting a pesky 500 call on a post from my gatling script that works fine when I use a normal rest client on my machine. Can any of you spot the issue? I appreciate that this is a vague question, but any help you can provide would be appreciated.
Here's an edited version of my script...
val httpConf = http
.noProxyFor("localhost")
.acceptHeader("*/*")
.acceptCharsetHeader("ISO-8859-1,utf-8;q=0.7,*;q=0.3")
.acceptLanguageHeader("en-GB,en-US;q=0.8,en;q=0.6")
.acceptEncodingHeader("gzip,deflate,sdch")
.userAgentHeader("Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36")
.disableCaching
.disableWarmUp
val scn = scenario("Web Service API Test").during(1000 milliseconds) {
exec(http("POST test")
.post("URL REMOVED FOR PRIVACY")
.body(StringBody("""{"params" :[ { "id": "31675801", "paramType": "INPUT", "name": "Input - Input DataId", "type": "int", "value": "240007", "unit": "", "values": "" }, { "id": "31675803", "paramType": "PARAM", "name": "Input - Invert", "type": "bool", "value": 0, "values": ""}"""))
.check(status.is(200)))
}
setUp(scn.inject(atOnceUsers(1)).protocols(httpConf))
Easy isn't it?
Logback gives me the following output...
Request:
POST test: KO status.is(200), but actually found 500
=========================
Session:
Session(Web Service API Test,1781151826160433670-0,Map(728cd795-f875-47ab-b8f7-839fe3d42536 -> 3, timestamp.728cd795-f875-47ab-b8f7-839fe3d42536 -> 1404985727356, gatling.http.cookies -> CookieJar(Map())),1404985727353,46,KO,List(ExitASAPLoopBlock(728cd795-f875-47ab-b8f7-839fe3d42536,<function1>,Actor[akka://GatlingSystem/user/$d/$a#59091219])))
=========================
HTTP request:
POST URL REMOVED FOR PRIVACY
headers=
Accept: [*/*]
Accept-Charset: [ISO-8859-1,utf-8;q=0.7,*;q=0.3]
Accept-Language: [en-GB,en-US;q=0.8,en;q=0.6]
Accept-Encoding: [gzip,deflate,sdch]
User-Agent: [Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36]
stringData={"params" :[ { "id": "31675801", "paramType": "INPUT", "name": "Input - Input DataId", "type": "int", "value": "240007", "unit": "", "values": "" }, { "id": "31675803", "paramType": "PARAM", "name": "Input - Invert", "type": "bool", "value": 0, "values": ""}
=========================
HTTP response:
status=
500 Internal Server Error
headers=
Date: [Thu, 10 Jul 2014 09:48:47 GMT]
Server: [Apache/2.2.15 (CentOS)]
X-Powered-By: [PHP/5.5.13]
Vary: [Accept-Encoding]
Connection: [close]
Content-Type: [application/json]
Any ideas?
Jason