删除JMeter Assertion失败错误

时间:2017-01-09 07:00:21

标签: jmeter

我正在尝试在我们的某个Web服务器上进行负载测试。我用BlazeMeter" BlazeMeter |的chrome扩展记录了一个web浏览会话负载测试云2.3.1"。 在那之后,当我运行负载测试时,我得到响应代码:200用于某些css样式表。但是那个HTTP请求在"中检索css样式表查看结果树" JMeter得到RED,JMeter的Dashboard报告(http://jmeter.apache.org/usermanual/generating-dashboard.html)说,这是一个断言失败的错误。响应消息告诉我们如下所述的一些错误消息:

Response message: Embedded resource download error:http://f...content-available-to-author-only...s.com/css?family=Lato:100,300,400,700 code:Non HTTP response code: java.net.UnknownHostException message:Non HTTP response message: f...content-available-to-author-only...s.com: Name or service not known,

如何通过编辑css样式表或如何跳过此错误并使其通过来删除此错误? 完整的样本结果如下:

Thread Name: Thread Group 1-1
Sample Start: 2017-01-09 11:59:45 BDT
Load time: 1031
Connect Time: 508
Latency: 764
Size in bytes: 24175
Sent bytes:1094
Headers size in bytes: 331
Body size in bytes: 23844
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: 200
Response message: Embedded resource download error:http://f...content-available-to-author-only...s.com/css?family=Lato:100,300,400,700 code:Non HTTP response code: java.net.UnknownHostException message:Non HTTP response message: f...content-available-to-author-only...s.com: Name or service not known, 

Response headers:
HTTP/1.1 200 OK
Server: nginx/1.10.1
Date: Mon, 09 Jan 2017 05:59:46 GMT
Content-Type: text/css
Content-Length: 21431
Last-Modified: Mon, 09 Jan 2017 05:51:50 GMT
Connection: close
ETag: "587324f6-53b7"
Accept-Ranges: bytes
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Frame-Options: DENY


HTTPSampleResult fields:
ContentType: text/css
DataEncoding: null

抱歉,语言不好。

1 个答案:

答案 0 :(得分:2)

当嵌入式资源下载失败时,有一个控制JMeter行为的属性,默认情况下,父样本将被标记为失败。如果您不想将httpsampler.ignore_failed_embedded_resources属性值设置为true。它可以通过两种方式完成:

  1. 将下一行添加到 user.properties 文件(位于JMeter' s" bin"文件夹中)

    httpsampler.ignore_failed_embedded_resources=true
    
  2. 通过-J命令行参数传递属性,如:

    jmeter -Jhttpsampler.ignore_failed_embedded_resources=true -n -t ...
    
  3. 参考文献: