Artillery: Test Login Scenario with CSRF field

Created on 20 Jan 2017  路  5Comments  路  Source: artilleryio/artillery

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 }}"

Most helpful comment

@hassy link is broken Where can we find modern docs?

All 5 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hassy picture hassy  路  3Comments

ericmacfarland picture ericmacfarland  路  6Comments

SamDecrock picture SamDecrock  路  5Comments

CaseyBurnsSv picture CaseyBurnsSv  路  4Comments

sonisaurabh19 picture sonisaurabh19  路  5Comments