Created
September 3, 2014 11:07
-
-
Save swapnil-kotwal-sp/4e5ba56fe7da82b4c751 to your computer and use it in GitHub Desktop.
Basic Login functionality for you web app using Gatling DSL.
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
Make sure you have "login.csv" in gatling data folder and | |
"login.csv" contains proper creadentials to login into your web app. | |
package mywebapp.lib | |
import scala.concurrent.duration._ | |
import io.gatling.core.Predef._ | |
import io.gatling.http.Predef._ | |
import io.gatling.jdbc.Predef._ | |
import mywebapp.config._ | |
object Login { | |
val headers_10 = GatlingConfig.headers_10 | |
val feeder = csv("login.csv").circular//queue :- will move step by step | |
//circular :- it iterate over whatever number of rows available. | |
val login = exec(http("Login") | |
.get("/login")) | |
.pause(1) | |
.feed(feeder) | |
.exec(http("authorization") | |
.post("/auth") | |
.headers(headers_10) | |
.queryParam("""email""", "${email}") | |
.queryParam("""password""", "${password}") | |
.check(status.is(200)) | |
.check(jsonPath("$.Message").is("Success"))) | |
.pause(1) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment