Its been more than an year since I started using selenium grid. My client requirements made me look into the source code of selenium grid – to understand how this works. Selenium grid is like an infrastructure in testing. You need it to be up and running all the time. This by itself has become another task for me and my team. The main problem with grid is its stability over time. All my tests run in Ubuntu machines. After running for around 15 to 20 hours the RC’s would become unresponsive. It would start giving null pointer exceptions saying RC’s are not available. Current solution is restarting all the RC s and Hubs.
The testing which I am working for very dynamic in nature. It would suddenly require more number of Remote controls to run the test. Same way, we would want to remove/add/restart RC. I was thinking it would be a good thing to have an application in place which would do this. How about having a web app which can be deployed to add and remove RC. Basically an UI for selenium grid.
My requirements are these
1. Able to provide IP address and portnumber of the RC and Hub
2. Remove the RC from the grid
3. Add RCs to the grid
4. Restart an RC.
Am planning to use RMI to implement this. In a different way though. Am halfway into it, but it got stalled due to my laziness :-(. I will be reworking on this from this week. Lets see how far this goes..
Update :- Seems like I wont need this. Thanks to Grid 2.0, we can do all this by extending selenium classes.
Selenium Grid is an open source tool which helps in web testing. It is something that uses Selenium tool at its core but provides few enhancements which makes it one of the best open source web testing tool out there in the market. Its capabilities include:
- Allows to run multiple tests in parallel and there by reduce the test time
- These multiple tests can be run against different browsers. So all you need to do is write one script change few config values and you can run your tests in different browsers.
- Allows to run tests on different OS platforms. Just like how you can run on different browsers you can run on multiple operating systems too
As with any test automation tool, there are limitations for grid too. To list out a few,
- It has selenium at its core. So all limitations that apply for Selenium applies for grid too
- Selenium grid by itself cannot run multiple tests in parallel. We need to use something like testNG or JUnit to provide multiple tests to the grid
You can find more about grid, and how to run the grid here http://selenium-grid.seleniumhq.org/
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.