Like most of the people who start using selenium grid, I was also looking at ways to increase the Remote Control (RC) utilization of grid. My selenium hub console would show a lot of RCs under the available section, but they never become active. Even when there are many tests pending to be executed why would hub not use the available RCs. Initially I thought this would be a limitation with hub. But that was not the case. The problem was in the number of tests which I could trigger at the same time.
The basic rule of Grid utilization
In simple words, we can say that RC utilization is directly proportional to the number of tests that are triggered. You can have 100 RCs registered to your hub, but if your code doesn’t have the logic to trigger 100 tests simultaneously you are not going to utilize all the RCs.
Setting up Grid
To do this, first you need to make sure that the Grid is totally separate from the test code. It should be an independent setup which just receives input and processes it. So you should start your Grid separately and get it running. Now you can trigger multiple tests at the same time all pointing to the same hub. If you are using Hudson/Jenkins to trigger your tests then you can trigger multiple tests at once all pointing to the same hub so that Hub is going to have more requests coming in.
So you have all your tests in selenium 1.x code and you want to run the tests in Firefox 4. Thanks to Selenium 2.0 (which supports FF4 and IE9), this can be achieved easily. Here is what you have to do
1. Download Selenium 2.0 standalone server from here
2. Copy this jar file to /seleniumgridfolder/vendor
3. Delete the existing jar file which starts with selenium-server*.jar
4. Open the grid_configuration.yaml file under the seleniumgrid installation folder
5. Add a new browser under environments as given below
– name: “*firefox4”
browser: “*firefox C:\Program Files\Mozilla Firefox 4.0 Beta 11\firefox.exe (Or whatever is the path to Firefox.exe”
6. Launch your Hub.
7. Launch RC with environment as *firefox4
That’s it! Your tests will now run in Firefox 4.