Get Token value inside script

17 views
Skip to first unread message

Adam

unread,
Jan 19, 2018, 7:27:57 AM1/19/18
to Gatling User Group
Hello!

When i go to login page I get __RequestVerificationToken:

<div class="login-form panel panel-default">
        <form class="test" action="/TestApp/Login/Login" method="post">
            <input name="__RequestVerificationToken" type="hidden" value="zre8wHiyiHi4R-5TZMgCoE0M7veRUtoC7NYzEmMeaLJKove87_LCMEiDcJGeYR3RozvViuwoCpSaPbk-cWWajjnse_KJqLMnbz3bJXD4xkQ1">


Inside RecordedSimulation with Gatling I got saved value for __RequestVerificationToken:

.exec(http("request_17")
.post("/TestApp/Login/Login?ReturnUrl=%2FPortal%2F")
.headers(headers_17)
.formParam("__RequestVerificationToken", "iJMOoffGP1gLJu5NXw7ZSL4W99HvByEIrhkEuBwX7xSrH05oGkUZvGR0kPYtHoxBLnvPwxS8ddldLEf1PoXDC3Ur5QK5_FlHBFH067x1f4w1")
.formParam("UserName", "000001")
.formParam("Password", "Test123!")
.resources(http("request_18")

How can I save __RequestVerificationToken value in this script and pass it to POST request?
Reply all
Reply to author
Forward
0 new messages