Hi
I am doing a comparison using JMeter and Gatling.
Can someone help how I would create the 3 following scenarios in Gatling:
In JMeter:
-
Run thread groups in Parallel / Consecutively
I need to run all 2 Gets and 2 Posts in parallel
I also need to run each one after the other -
Include loop of each threadgroup to 10
In Jmeter there is loop count, How can I include loop count of 10 in each request.
- How to pass Json string in the body as ‘raw’ in the postWithContent , I am getting errors with the postwith Comment below
class BasicSimulation extends Simulation {
val httpProtocol = http
.baseUrl(“http://localhost:8063”) // Here is the root for all relative URLs
.acceptHeader(“text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8”) // Here are the common headers
.doNotTrackHeader(“1”)
.acceptLanguageHeader(“en-US,en;q=0.5”)
.acceptEncodingHeader(“gzip, deflate”)
.userAgentHeader(“Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0”)
val scn = scenario(“4 threads”) // A scenario is a chain of requests and pauses
.exec(
http(“Get”)
.get("/dummyGet")
)
.pause(1) // Note that Gatling has recorded real time pauses
.exec(
http(“GetReponse”)
.get("/GetReponse")
)
.pause(1) // Note that Gatling has recorded real time pauses
.exec(
http(“Post”)
.post("/Post")
)
.pause(1) // Note that Gatling has recorded real time pauses
.exec(
http(“postWithContent”)
.post("/postWithContent")
.body(StringBody("""{“name”:“abc”, “add”:“231”, “tel”:“42322”}"""))
)
setUp(scn.inject(rampUsers(10000) during (60 seconds)).protocols(httpProtocol))
}