Saturday, September 13, 2014

Selenium WebDriver Vs JMeter


Selenium WebDriver Vs JMeter

For any website, testing the front end tier involves simulating a real user performing real functions on the site. This is called real browser testing and its different from synthetic testing where a tool such a Apache-Bench or Jmeter is used to simulate traffic load on the front end of the website. A real broser takes a certain amount of time assembling the Document Object Model (DOM), which includes parsing javascript, and then rendering the page. Tools like Apache-Bench and Jmeter do not test these aspects of a real browser loading.

There are number of tools that can programmatically configure and execute real-browser tests on a website, which can be automated and integrated into QA and continuous integration processes. Selenium is a web application testing system that includes sport for almost major browsers and Watir.

SeleniumJMeter
The general consensus is that UI automation tools such as Selenium are not a good choice for load testing. There are a number of reasons why, but the main one is that it is a LOT slower.You can easily spin up thousands of concurrent requests in a second in a tool like JMeter which to reproduce in Selenium would take multiples of thousands of servers all orchestrated to give you the same amount of traffic.
Use Selenium for your functional tests.Use JMeter for stress tests, and measure performance.
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.


Sources:
1. Pro Website Development and Operations: Streamlining DevOps for large-scale websites by Matthew Sacks.
2. Load Testing, Selenium Vs Jmeter Vs other tools.
3. Looking for open source, Java-based tool for performance testing.