Search code examples
djangogatling

How to test CSRF protected sites using gatling?


I am testing a django powered site using gatling. My forms are protected by a CSRF token:

<input type="hidden" name="csrfmiddlewaretoken" value="EqFQPv1fdfJjAfq4wFcWkVsecmWSisQzQU0ee1utyOEpJd7edxk3DMhAQNMpI2DK">

How can I test my forms using Gatling testing framework?


Solution

  • Use a css selector check to capture it and send it back in the next request. You probably should also have a look at the official tutorials: part1 and part2.