How can i do test login scenario with csrf field in it ? like laravel or ci..
This is so far the code that i wrote
config:
target: "http://aimsis-exam.dev"
phases:
-
duration: 10
arrivalRate: 200
payload:
path: "user.csv"
fields:
- "username"
- "password"
scenarios:
-
name: "Access Page with Autoplay Music"
flow:
-
get:
url: "/test"
-
name: "Access Exam Web"
flow:
-
post:
url: "/login"
body: "user={{ username }}&pass={{ password }}"
Grab the CSRF token value from the HTML response, then use that in your POST request.
See this for more details: https://artillery.io/docs/testing_http.html#extract-and-reuse-parts-of-a-response-request-chaining
Oke done, thanks for the clue @hassy
@hassy link is broken Where can we find modern docs?
I have the same problem with logging in, please do help!!!
I think the latest link for @hassy comment is https://artillery.io/docs/http-reference/#extracting-and-reusing-parts-of-a-response-request-chaining
Most helpful comment
@hassy link is broken Where can we find modern docs?