Skip to content

Instantly share code, notes, and snippets.

Created August 19, 2014 05:11
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Gatling Test 1
package computerdatabase
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._
import io.gatling.jsonpath._
class Test1 extends Simulation {
val httpConf = http
.baseURL("") // Here is the root for all relative URLs
.acceptHeader("application/json") // Here are the common headers
.acceptEncodingHeader("gzip, deflate")
.userAgentHeader("Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0")
val headers_10 = Map("Content-Type" -> "application/json") // Note the headers specific to a given request
val scn = scenario("Scenario Name") // A scenario is a chain of requests and pauses
.foreach("${pList}", "player") {
exec(session => {
val playerId = JsonPath.query("$.playerId", "${player}")
session.set("playerId", playerId)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment