最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Jmeter

运维笔记admin8浏览0评论

Jmeter

Jmeter

Jmeter - 当一个采样器出现故障时,是否可以跳过剩余的采样器(Jmeter - Is it possible to skip remaining samplers when one sampler fails)

我正在自动化测试场景。 我在一个简单的控制器中配置了几个HTTP采样器。 我想在一个采样器发生故障时跳过执行剩余的采样器。

例如:

Simple Controller - http sampler 1 - http sampler 2 - http sampler 3 - http sampler 4

如果'sampler 2'失败,我想跳过执行'sampler 3'和'sampler 4'。

任何帮助都非常感谢。

谢谢。

I'm automating a test scenario. I have configured few HTTP samplers within a simple controller. I want to skip executing the remaining samplers when one sampler fail.

Ex:

Simple Controller - http sampler 1 - http sampler 2 - http sampler 3 - http sampler 4

If 'sampler 2' fails, I want to skip executing 'sampler 3' and 'sampler 4'.

Any help is highly appreciated.

Thanks.

最满意答案

取决于你想要达到的目标。

一种选择:通过在线程组级别提供相应的配置来停止整个测试(或其他)

另一种选择:基于前面的采样器成功有条件地运行采样器:

在http sampler 2之后添加If Controller 使用${JMeterThread.last_sample_ok}作为“条件” 添加http sampler 3和http sampler 4作为If Controller的子项

有关在If Controller中设置各种条件的更多信息,请参见如何使用JMeter的'IF'控制器和Get Pie文章

Depending on what you're trying to achieve.

One option: stop the whole test (or whatever) by providing corresponding configuration on Thread Group level

Another option: conditionally run samplers basing on preceding sampler success:

Add If Controller after http sampler 2 Use ${JMeterThread.last_sample_ok} as "Condition" Add http sampler 3 and http sampler 4 as children of the If Controller

See How to Use JMeter's 'IF' Controller and Get Pie article for more information on setting various conditions in the If Controller

发布评论

评论列表(0)

  1. 暂无评论