The Vision Behind Selenium Grid
In-Browser Tests Are Slow
In-browser testing involves a full application stack and a flurry of network chats between browsers, web servers, databases and other processes. Not surprisingly, this comes with a lot of performance overhead. As your application grows, the web acceptance build soon takes more than half an hour to run, and accounts for a tremendous delay in the development feedback cycle.
Maintenance Costs Are The Real Challenge
Using Selenium, it is very easy to write or generate a significant number of automated in-browser tests. The real challenge, though, is to keep the maintenance costs low as the application matures, the test suite grows and time passes by. However valuable the tests are, it is hard to maintain a High ROI for your Selenium test suite if maintenance costs grow exponentially. We have seen way too many test suites requiring full time effort of a dedicated QA or developer... just to keep them in the green and find more bugs in the test suite itself than in the application.
Prompt and Reliable Feedback is Crucial
Keeping maintenance costs low is a hard problem which can only be solved by a combination of techniques and best practices. However, none of them will work if your feedback cycle is slow or plagued with intermittent failures. Prompt and efficient feedback is the key to experimentation, innovation and improvement.
Even worse than slow, without a fast feedback loop you will end up chasing a (broken) Selenium build as your development team cranks out new functionality faster than build failures can be diagnosed and fixed.
Hardware is Cheap
In-browser tests are inherently slow, but since commodity hardware is insanely cheap nowadays there is no excuse for not running all these tests in parallel on multiple machines and dramatically speeding up your feedback cycle. This is exactly what Selenium Grid is about.
You do not even need to build or purchase an expensive server farm: in our experience a couple of Mac Minis or Linux Boxes can go a long way and help you keep your build under 10 minutes.
If your CPU use is intermittent or politics make it hard to buy new machines, Selenium Grid also comes with support, out-of-the-box, for Amazon's EC2, a cloud-computing service which provides flexible and cheap on-demand computing resources.
How Does it Work?
Concepts and Architecture
Selenium Grid is a tool that dramatically speeds up functional testing of web-apps by leveraging your existing computing infrastructure. It allows you to easily run multiple tests in parallel, on multiple machines, in an heterogeneous enviroment.
Based on the excellent Selenium web testing tool, Selenium Grid allows you to run multiple instances of Selenium Remote Control in parallel. Even better, it makes all these Selenium Remote Controls appear as a single one, so your tests do not have to worry about the actual infrastructure. Selenium Grid cuts down on the time required to run a Selenium test suite to a fraction of the time that a single instance of Selenium instance would take to run.
Of course, you get to choose which language you develop your tests in: Ruby, Java, Python, C#, PHP, ...
Last but not least, Selenium Grid is easy to use and simple to install.
Your First Steps with Selenium Grid
Installing Selenium Grid
If for some reason you need a previous distribution of Selenium Grid, you can find them on the download page.
Run the Demo
Before you use Selenium Grid on your own project, I recommend that you acquire some practical experience with its mechanics and management scripts by Running The Demo on your local machine.
Once everything is working, you can then decide to Run The Demo on EC2, if you are interested in the cloud computing capabilities.
Examples Bundled in Selenium Grid Distribution
Selenium Grid bundles Java and Ruby examples, which provide a great
starting point to adapt your Selenium Test Suite to Selenium Grid.
Make sure you review them, they are located in the
Adapting your Selenium Test Suite to Leverage Selenium Grid
Selenium Grid Management:
Converting Your Selenium Test Suite to Selenium Grid:
Getting Help, Provide feedback, submit bugs, send patches