Handling ASP.NET MVC’s Anti-Forgery Tokens when load testing with JMeter

JMeterでクッキー使うときにクッキーマネージャかませばいいんだけど、ASP.NETのときに正規表現フィルタでRequestVerificationTokenの値を取って埋める必要がありまっせと言う話。

https://buildmeasurelearn.wordpress.com/2016/11/23/handling-asp-net-mvcs-anti-forgery-tokens-when-load-testing-with-jmeter/

Some key points to note:

  • The Reference Name field names the variable that we will then reference in the POST request we make to login.
  • The Regular Expression field tells JMeter that we want to extract the value from the string using:
name="__RequestVerificationToken" type="hidden" value="([A-Za-z0-9+=/\-\_]+?)"