Created
January 11, 2013 17:07
-
-
Save groovybayo/4512357 to your computer and use it in GitHub Desktop.
Gatling: debugging session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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