Skip to main content

How to Do Load Testing


How do you do load testing in Selenium? While there are plenty of resources citing that while it can be done, there are better tools for the job. Tools like JMeter are often recommended, but they can be intimidating and challenging to get started with.

There are other approaches to this, and it can be a bumpy road to do load testing, and you might go down a rabbit-hole struggling with Selenium infrastructure and third-party tools.

A Solution

Rather than invest time, money, and frustration into JMeter, a Selenium infrastructure, or a third-party provider, we can generate a good amount of load by leveraging an existing Selenium script, a proxy server, and an HTTP client library along with some parallel threads.

With a proxy server we can capture the HTTP requests generated by Selenium and replay them with an HTTP client library in parallel -- effectively replicating the same actions hitting the web server simultaneously, in large numbers.

Let's continue with an example.

About The Author

Dave Haeffner is the original writer of Elemental Selenium -- a free, once weekly Selenium tip newsletter that's read by thousands of testing professionals. He also created and maintains the-internet (an open-source web app that's perfect for writing automated tests against).

Dave has helped numerous companies successfully implement automated acceptance testing; including The Motley Fool, ManTech International, Sittercity, and Animoto. He is also an active member of the Selenium project and has spoken at numerous conferences and meetups around the world about automated acceptance testing.

Dave Haeffner profile picture