首页 文章

删除JMeter Assertion失败错误

提问于
浏览
0

我正在尝试在我们的一个Web服务器上进行负载测试 . 我使用BlazeMeter "BlazeMeter | The Load Testing Cloud 2.3.1"的chrome扩展记录了一个Web浏览会话 . 之后,当我运行负载测试时,我得到响应代码:200用于某些css样式表 . 但是,在JMeter的"view results tree"中检索css样式表的HTTP请求变为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 回答

  • 2

    有一个属性控制JMeter 's behavior when embedded resource download fails, by default parent sample will be marked as failed. If it is something you don' t只想将 httpsampler.ignore_failed_embedded_resources 属性值设置为 true . 它可以通过两种方式完成:

    • 将下一行添加到user.properties文件(位于JMeter的"bin"文件夹中)
    httpsampler.ignore_failed_embedded_resources=true
    
    • 通过 -J 命令行参数传递属性,如:
    jmeter -Jhttpsampler.ignore_failed_embedded_resources=true -n -t ...
    

    参考文献:

相关问题