scala - Gatling: RawFileBody not outputting text -


i'm new gatling, working on writing first scenario. can't rawfilebody work. direct traffic through fiddler can see what's going on , file content isn't being outputted request body. using stringbody works fine prefer not using large json payloads.

i've checked file in "...\gatling\gatling-charts-highcharts-bundle-2.1.4\user-files\bodies" directory, i've tried using absolute path, i've tried adding asjson. i've set log levels trace , haven't seen errors or warnings, request body still empty. here's relevant part of script (ignore small mistakes i've had remove lots of proprietary code):

import io.gatling.core.scenario.simulation import io.gatling.core.predef._ import io.gatling.http.predef._  import java.util.uuid  class scenario1 extends simulation {    val uri1 = "http://somehost"    val httpprotocol = http     .baseurl("http://somehost")     .proxy(proxy("localhost", 8888).httpsport(8888))     .inferhtmlresources()     .acceptheader("application/json")     .contenttypeheader("application/json")    val header = map("some" -> "proprietary-header")    object foo {     val bar = exec(http("bar")       .post(uri1 + "/app/myservice")       .headers(header)       .body(rawfilebody("my_request.txt")))   }    val scn = scenario("scenario1").exec(foo.bar)    setup(scn.inject(atonceusers(1))).protocols(httpprotocol) } 

any ideas?

you have baseurl set in http part , add again in .post part. post uses baseurl default , adds whatever specify it. seem calling http://somehosthttp://somehost/app/myservice. other should fine, add .asjson , use absolute path sure. best of luck.


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

node.js - How to abort query on demand using Neo4j drivers -