Get auth token in Gatling -


i'm trying use gatling test api i've got problem. i'm testing login/logout. @ login, user got token, used logout.
when use recorder, keep fix token, , of course, doesn't work when run test. don't find in doc or google how can dynamically token.
know ?
!

edit:

after recording here got

val headers_13 = map(         "accept" -> """*/*""",         "origin" -> """http://site.com""",         "token" -> """token""" )  val scn = scenario("scenario name")         .exec(http("request_1")                     .post("http://site.com/login")                     .headers(headers_1)                         .param("""player[email]""", """email@address.com""")                         .param("""player[password]""", """password""")             )         .pause(757 milliseconds) 

.exec(http("request_13")                     .get("http://site.com/logout")                     .headers(headers_13)             )         .pause(202 milliseconds) 

i try put 2 pieces of code after .post("http://site.com/login") , .get("http://site.com/logout") didn't works

where token? http header? speaking, way save data responses in order reuse further requests check api.

.check(header("tokenname").saveas("token")     ...     .header("tokenname", "${token}") 

Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -