Jmeter Webdriver采样器 [英] Jmeter Webdriver sampler

查看:169
本文介绍了Jmeter Webdriver采样器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Jmeter有一个Webdriver采样器.我们必须编写脚本.我们有使用基于硒的工具opkey编写的脚本.我们可以将两者整合吗?这样我们就不必在jmeter中编写脚本.

Jmeter has a webdriver sampler. We have to write the scripts. We have scripts written in opkey, a selenium based tool. Can we integrate both of them. So that we don't have to write scripts in jmeter.

推荐答案

不熟悉opkey,但是Selenium对于超出非常琐碎的负载的任何负载测试都是一个坏主意:

Not familiar with opkey, but Selenium is a bad idea for any load tests beyond very trivial loads:

硒从未打算进行大规模性能测试. Selenium及其更新的头像驱动程序,为每个用户启动浏览器引擎,然后重播其中的所有用户交互.这对功能测试非常有用,因为您是在真正的浏览器引擎中执行客户端代码-但同时这对于性能测试来说是个坏消息.浏览器实例占用大量资源,并且扩展变得困难且昂贵.

Selenium was never intended for large-scale performance testing. Selenium and its newer avatar webdriver, launch a browser engine per user and then replay all the user interactions inside it. This is great for functional testing because you are executing client side code inside a real browser engine - but at the same time this is very bad news for performance testing. Browser instances are resource intensive, and scaling becomes hard and expensive.

即使使用Selenium Grid之类的工具,实际上也意味着要通过并行运行来减少测试执行时间,但实际上并不是生成任何类型的负载.他们在

Even using something like Selenium Grid is really meant for cutting your test execution time by running in parallel, but not really for generating any sort of loads. They say this at the very top of their FAQ.

不仅仅是规模,当负载驱动程序本身非常耗费资源时,施加的负载也会变得不一致.如果您发现性能下降,则很可能是您的负载驱动程序是瓶颈,而不是被测试的应用程序.

It is not just scale, when your load driver itself is very resource intensive, the applied load becomes inconsistent. If you see drop in performance, it could very well be that your load driver is the bottleneck and not the application under test.

话虽如此,只要您的并行用户规模为10人,您绝对可以使用JMeter Sampler或Se Grid或其他工具来进行性能测试.再次引用Grid FAQ:

Having said that, you can definitely use the JMeter Sampler, or Se Grid, or something else to drive your performance test, as long as you're in the scale of 10s of parallel users. Again quoting from Grid FAQ:

例如,要模拟200个并发用户,您将需要200个并发浏览器以及基于Selenium Grid的负载测试框架.即使您在Linux上使用Firefox(这是最有效的设置),您可能也至少需要10台计算机来生成这种负载.当JMeter/Grinder/httperf可以在一台机器上生成相同类型的负载时,这相当疯狂.

To simulate 200 concurrent users for instance, you would need 200 concurrent browsers with a load testing framework based on Selenium Grid. Even if you use Firefox on Linux (so the most efficient setup) you will probably need at least 10 machines to generate that kind of load. Quite insane when JMeter/Grinder/httperf can generate the same kind of load with a single machine.

请注意,当他们说JMeter时,他们指的是HTTP采样器或更简单,更有效的采样器之一-因为即使网络驱动程序采样器文档这样说:

Note that when they say JMeter, they are referring to the HTTP sampler or one of the simpler, more efficient samplers - Because even the webdriver sampler documentation says this:

JMeter允许创建多个线程,每个线程负责在服务器上创建负载.但是,对于Web驱动程序用例,读者应谨慎选择他们将创建的线程数,因为每个线程都将具有与其关联的单个浏览器实例.每个浏览器都会消耗大量资源,并且应该限制读者应该创建的浏览器数量.

JMeter allows the creation of multiple threads, and each thread is responsible for creating load on the server. However, for the Web Driver use case, the reader should be prudent in the number of threads they will create as each thread will have a single browser instance associated with it. Each browser consumes a significant amount of resources, and a limit should be placed on how many browsers the reader should create.

,然后继续建议最多使用(比#of处理器内核少1)-对于大多数非弹性设置来说,这是一个很小的数目.

and then goes on to recommend using a maximum of (1 less than the #of processor cores) - which is a very small number for most non-elastic setups.

这篇关于Jmeter Webdriver采样器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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