jmeter - 自定义消息在 GUI 版本中有效,但在 CLI 中无效
问题描述
在 Ubuntu 18.04 上使用 Jmeter 5.2.1 版,我们运行了许多测试,其中一些具有自定义消息。下面是代码。
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="C01 - ${marsha} Current Date" enabled="true">
<collectionProp name="Asserion.test_strings">
<stringProp name="1193219718">unsuccessfulSell=true</stringProp>
</collectionProp>
<stringProp name="Assertion.custom_message">C01 - ${marsha} Current Date - Product Not Available</stringProp>
<stringProp name="Assertion.test_field">Assertion.sample_label</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">6</intProp>
</ResponseAssertion>
当我们在 GUI 版本中运行它时,我们会得到如下内容:
C01 - abzcy Current Date - Product Not Available
当我们使用 CLI 运行相同的测试时,我们根本没有收到任何消息。最初我认为它正在工作,但我看到了错误的列。
有什么想法吗?
附件是我所指的规则的屏幕截图。
自定义消息根本不出来。
对于其他断言,我们没有这个问题。
解决方案
鉴于此响应断言配置,我无法重现您的问题:
当我在命令行非 GUI 模式下运行 JMeter 时,如下所示:
./jmeter -n -t test.jmx -l result.jtl
我可以在result.jtl文件 中看到自定义断言失败消息
您是否有机会自定义结果文件配置?特别是jmeter.save.saveservice.assertion_results_failure_message
属性需要设置为true
推荐阅读
- python - Python - 函数内部的while循环没有产生一致的结果
- reactjs - 反应未定义的属性
- angular - 当应用程序在 Angular 中启动时如何调用服务?
- excel - Excell VBA 运行时错误“1004”:应用程序定义或对象定义错误
- java - 用 Java 下载几个文件后,下载速度显着减慢
- python - 使用python下载pdf
- c - 如何在 C 中运行计时器
- javascript - 在 MongoDB 中将 _id 字段设置为 ObjectId,然后再将其写入 DB
- python - 在python中通过命令行强制用户输入
- python - GCD 分数代码错误且未打印出正确答案