JMeter BeanShell 断言比较

JMeter BeanShell Assertion comparison

我不明白我在 Apache JMeter 中的 BeanShell 断言响应。

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

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

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

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

该行为完全符合预期。 39000 大于 25000,因此您的断言永远不会失败。

参见: