What can I use to do load testing or functional testing of my web server?
Here are some links to open source web server load and functional testing programs or frameworks:
ab – Apache HTTP server benchmarking tool
- Somes with Apache on some platform.
- Very easy to use. Supports parameters such as concurrency and POST data.
- It tells you how many requests succeeded and how many failed (by response code and/or timeout), the request rate, etc. However, you cannot see which ones failed and why, etc.
- No support for distributing work across machines.
Apache JMeter
- Constructs and runs test plans in its GUI. I think you can use the JMeter classes (in Java) directly, instead of using the GUI. Documentation is scarce in this area too.
- Supports distributing work across machines. Multiple machines can load the test and another machine can observe the test.
- Pretty limited in terms of running dynamic test cases: There are built-in functions (like one that gets the current time), regular expression, and JEXL, but you can’t use custom code in test cases easily.
- Sends and receives HTTP requests and responses. Not aware of browser behavior or client-side scripting.
Selenium
- 3 variants:
- Selenium: write test plans in a language called Selenese in the Selenium IDE
- Selenium RC: incorporate test plans into programs; server part is in Java but client drivers exist for Java, .Net, Perl, PHP, Python and Ruby at least.
- Selenium Grid: a version of RC that enables spreading of test load among multiple processes and/or machines
- Functional testing (all) and load testing (RC, Grid)
- Runs in actual browsers so it can be used to test browser behavior or client-side scripting. For example, you can tell the script to click on a specific element in the page, even if the element is created by JavaScript loaded at run-time.
-
FAQ of Grid states that it’s not designed for load testing.
- One of the reasons: it’s resource-intensive to run multiple simultaneous instances of actual browsers.
- Grid’s “principle author” stated that each machine should be able to run 10-20 browser instances. This is still much more resource-intensive than many alternatives. I’ve read somewhere that BrowseMob provides performance-testing service using exactly this software though.
HtmlUnit
- A Java library providing building blocks for testing. I’ve read that front-ends exist.
- Primarily for functional testing, but also used by many for load testing.
- Claims to “understand” page content and runs JavaScript including AJAX.
Simple Test
- Unit testing for PHP
- A browser class that simulates a browser’s behavior is included
- No real support for load testing beyond timing a request, as there is no concurrency (within the program at least).