JMETER + POST + anti-forgery token

时间:2019-10-31
本文章向大家介绍JMETER + POST + anti-forgery token,主要包括JMETER + POST + anti-forgery token使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

JMETER + POST + anti-forgery token

Looking into XSRF/CSRF Prevention in ASP.NET MVC and Web Pages it appears that you're either sending an incorrect __RequestVerificationToken parameter value or completely miss the step.

If the current HTTP request already contains an anti-XSRF session token (the anti-XSRF cookie __RequestVerificationToken), the security token is extracted from it. If the HTTP request does not contain an anti-XSRF session token or if extraction of the security token fails, a new random anti-XSRF token will be generated.

So your test should look like:

  • Open Login Page (HTTP Get Request)

  • Once done you can refer the extracted value as ${token} in the next request

Check out ASP.NET Login Testing with JMeter article for more detailed information and step-by-step instructions if needed

原文地址:https://www.cnblogs.com/chucklu/p/11769739.html