Jmeter Webdriver sampler

删除回忆录丶 提交于 2019-12-11 12:58:41

问题


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.


回答1:


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

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.

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.

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:

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.

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 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.

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.



来源:https://stackoverflow.com/questions/29874491/jmeter-webdriver-sampler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!