Why am I getting :Error : “HTTP request Response Assertion:Test failed:text expected to contain /302/”

前端 未结 2 608
心在旅途
心在旅途 2021-01-25 08:14

08 nov 608 nov 508 nov 408 nov 308 nov 1 08 nov 2

Why am I getting :

HTTP request Response Assertion:Test failed:text expected to contain /302/\"

相关标签:
2条回答
  • 2021-01-25 08:36

    It's because you didn't check in your assertion the correct "Field to Test", you need to check Response Code not Text Response:

    Also your assertion is failing because you don’t get a 302(redirect) but a 200 (success) . So unless you really only want 302, just remove this assertion as bu default JMeter will mark Sample as failed if response code is strictly higher than 399

    0 讨论(0)
  • 2021-01-25 08:52

    Basically you are getting this message because your HTTP response body doesn't contain the search pattern of 302.

    Also be aware that Contains assumes a Perl-compatible regular expression as an input, so double check your pattern, most probably you should switch to Substring option. See Regular Expressions and How to Use JMeter Assertions in Three Easy Steps articles for more details.

    And finally don't use google.com website for load testing practice, Google has intelligent mechanisms of DDoS attacks protection so your IP address can simply be blacklisted. Use either your local intranet resources or special dedicated sites like http://newtours.demoaut.com/ or http://blazedemo.com/ for your experiments.

    0 讨论(0)
提交回复
热议问题