【问题标题】:JMeter BeanShell Assertion comparisonJMeter BeanShell 断言比较
【发布时间】:2016-08-10 20:36:57
【问题描述】:

我不理解我在 Apache JMeter 中的 BeanShell 断言响应。

int varcount = Integer.parseInt(vars.get("getcount"));
if ((varcount) < 25000) {
    Failure = true;
    FailureMessage = "testnsg";
}

getcount 值是 39000。当它低于 25000 时,我需要收到警报并停止测试。但是,上面的脚本运行良好,没有任何错误,当我将比较更改为 ((varcount) &gt; 25000) 然后我得到一个警报,结果是"

Assertion error: false
Assertion failure: true
Assertion failure message: testnsg

这与我的预期相反。有什么想法吗?

【问题讨论】:

    标签: apache jmeter beanshell


    【解决方案1】:

    这种行为是完全可以预料的。 39000 大于 25000,因此您的断言永远不会失败。

    见:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-11-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多