Der*_*cht 0 jmeter http-response-codes assertion
我试图在JMeter中声明http响应代码。我认为这确实很简单,但是我遇到了无法解决的问题。
我的服务器可以返回2个响应代码:200和423。200没问题,它可以正常工作,但是我不能断言423,我不知道为什么。
我尝试了以下配置的响应断言:
要测试的字段:响应代码,模式匹配规则:包含
要测试的模式:200-有效423-不起作用200 | 423-200有效,423不起作用(wtf?)
我也尝试了BeanShell Assertion
Failure = !(ResponseCode.contains("200") || ResponseCode.contains("423"));
Run Code Online (Sandbox Code Playgroud)
它也不起作用。我也试图与响应消息匹配以包含“已锁定”-不起作用。服务器响应如下所示:
Thread Name: 10 Users, 100 Repeats 1-10
Sample Start: 2017-05-19 13:06:09 MESZ
Load time: 33
Connect Time: 2
Latency: 33
Size in bytes: 333
Sent bytes:768
Headers size in bytes: 333
Body size in bytes: 0
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""):
Response code: 423
Response message: Locked
Response headers:
HTTP/1.1 423 Locked
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
X-Application-Context: application:capacitytest
Content-Length: 0
Date: Fri, 19 May 2017 11:06:08 GMT
Server: Not_available
HTTPSampleResult fields:
ContentType:
DataEncoding: null
Run Code Online (Sandbox Code Playgroud)
由于“采样器结果”中的原因,响应代码标记为蓝色。不知道为什么。我还通过Beanshell PostProcessor记录了响应代码。423 ...
最后,我要在这里寻求您的帮助。我不知道问题是什么或可能是什么。提前致谢。
| 归档时间: |
|
| 查看次数: |
703 次 |
| 最近记录: |