Skip to content

Instantly share code, notes, and snippets.

@groovybayo
Created January 11, 2013 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save groovybayo/4512357 to your computer and use it in GitHub Desktop.
Save groovybayo/4512357 to your computer and use it in GitHub Desktop.
Gatling: debugging session
package org.aamc.pdws
import com.excilys.ebi.gatling.core.Predef._
import com.excilys.ebi.gatling.http.Predef._
import com.excilys.ebi.gatling.jdbc.Predef._
import com.excilys.ebi.gatling.http.Headers.Names._
import akka.util.duration._
import bootstrap._
import assertions._
class TarzanSimulation extends Simulation {
val httpConf = httpConfig
.baseURL("http://localhost:9090")
.acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
.acceptCharsetHeader("ISO-8859-1,utf-8;q=0.7,*;q=0.3")
.acceptLanguageHeader("en-US,en;q=0.8")
.acceptEncodingHeader("gzip,deflate,sdch")
.userAgentHeader("Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11")
val headers_1 = Map(
"Cache-Control" -> """max-age=0"""
)
val headers_2 = Map(
"Cache-Control" -> """max-age=0""",
"Content-Type" -> """application/x-www-form-urlencoded""",
"Origin" -> """http://localhost:9090"""
)
val scn = scenario("Scenario Name")
.exec(http("request_1")
.get("/tarzan1/home")
.headers(headers_1)
)
.pause(10 milliseconds)
.exec(http("request_2")
.post("/tarzan1/j_spring_security_check")
.headers(headers_2)
.param("""j_username""", """user0""")
.param("""j_password""", """password""")
)
.pause(10 milliseconds)
.exec(session => {
println(session)
session
})
.exec(http("request_3")
.get("/tarzan1/logout/index")
)
setUp(scn.users(1).protocolConfig(httpConf))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment