Learn, Share and Keep Learning
| Distributed Automated Testing - Hudson, Maven & Selenium |
| Testing Tools - Test Execution | |
|
Selenium Grid allows you to distribute your tests on multiple machines so that you can run your tests in parallel on different browsers. The same results could be achieved using Hudson slaves and maven builds. In this article we will talk about using Hudson to kick off your automated tests on different machines and on different browsers. Before we go on and start talking about setting up slave build machines we will first understand what is Hudson and what is meant by Hudson slaves.
Hudson in simple terms is continuous integration engine which allows developers to continuously integrate their work and allow other users to obtain the build when needed. More information on hudson could be obtained here Still no signs of selenium. Well you could run your selenium tests as maven builds and specify the version of selenium RC to use to run the tests. Please ses a sample POM file structure for running the selenium tests as maven builds. In this POM file you have specifed you need SELENIUM server and its version 0.9.2 to run. For understanding more about the Maven POM files you could use this resource.
In a nutshell, you could use the maven 2 task of Hudson for building your Selenium RC tests written in java.
Then why cannot we run the tests on Hudson server itself?You must be scratching your head about why cannot we run these tests on the hudson server itself where you are running all the builds. The answer is yes you can in a very limited manner and no we can not for more comprehensive cross browser tests. Most of the times Hudson servers are set up on unix machines where there is only one common browser 'firefox ' is available. This firefox is also running headless (without any windows in simple terms) so you could run only a sub set of automated tests especially those which does not involve any flash. Another issue is that you cannot run any tests on other commonly used browsers such as Internet Explorer.We need other machines to: 1. Run a full comprehensive set of tests for Flash objects 2. Run the tests on other commonly used browsers such as Internet Explorer(IE). This leads us to another hurdle 'How to set up your windows slaves for Unix masters?' In the next section we will specify the steps to do that Hudson Linux Master and Windows Slave machineYou could set up different slave machines with different browsers and build/run your tests there.
This section would give you the step by step guide to setup windows Slave for unix master. You need to configure the master machine to use external executors of the builds Set up executors and create projects on master machine1. Go to hudson url('/ http://build..com/hudson/ ') 2. Now click on "Manage Hudson" 3. It should take you to a page where you could configure husdon and mange slaves 4. Click on "Configure Executors" 5. Use this page to configure your slaves
6 . Press Save. 7. Go to the main page 8. Create a new project or use the existing project and configure it as: 9. Press "Save" to store all slave configurations Configuring the slave machine:You need to configure your slave machines environment so that it could be used for running the selenium tests using the maven builds
Configuring Projects:Another important piece missing in this whole master slave is configuring the projects. The selenium tests should be treated as seperate project in Hudson as it will have a separate POM file. As mentioned earlier hudson allows building of maven 2 projects and in maven projects are build by specifying the different profiles. Generally maven projects build using this command
This build profile plays and importan role when you want to run your selenium tests on different browsers. Please see the sample build profile for running the tests on IE. ![]() |