等到选项JMeter [英] Wait until option JMeter

查看:86
本文介绍了等到选项JMeter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道JMeter是否有一个选项,您可以在其中等待某些元素消失.

I wanted to know if JMeter has a option where you wait until some element disappears.

仅以加载条为例,该加载条一旦完成或不再可见就可以继续. (还可以监控所花费的时间)

Example a loading bar only once that has completed or no longer visible then to carry on. (Also being able to monitor the length of time taken)

我已经完成了将其编写为Webdriver测试,然后在JMeter中将其作为Junit测试运行的过程,但是我想知道是否有更简单的解决方案.

I have through about writing it as a webdriver test and then running it as a Junit test in JMeter but wanted to know if there is a simpler solution.

欢迎提出任何想法:)

推荐答案

首先,您需要认识到 JMeter是不是浏览器

JMeter不是浏览器,它在协议级别工作.就Web服务和远程服务而言,JMeter看起来像一个浏览器(或更确切地说,是多个浏览器).但是,JMeter不会执行浏览器支持的所有操作.特别是, JMeter不会执行在HTML页面中找到的Javascript .它也不会像浏览器那样呈现HTML页面(可以将响应查看为HTML等,但是计时未包含在任何示例中,并且一次仅在一个线程中显示一个示例).

JMeter is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).

因此JMeter不执行任何客户端JavaScript,实现等到"选项的唯一方法是使用控制器,以便一次又一次地重新执行同一请求,直到响应数据包含(或停止包含)您要查找的元素.

So JMeter doesn't execute any client-side JavaScript, the only way of implementing "wait until" option is using While Controller in order to re-execute the same request again and again until response data will contain (or stop containing) the element you're looking for.

如果您需要评估客户端JavaScript,则唯一的选择就是Selenium.我建议您使用 WebDriver采样器,而不要像这样使用JUnit,这样您就可以赢了不必为任何更改重新编译脚本,它将内联到.jmx

If you need to evaluate client-side JavaScript the only option would be going for Selenium. I would recommend using WebDriver Sampler instead of going for JUnit as this way you won't have to recompile your script for any change, it will be inlined into .jmx

这篇关于等到选项JMeter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆