For those not familiar with Selenium, it’s a testing library that allows you to write integration tests to run in the browser, and when I say in the browser I mean it, you can tests how web applications behave when using different browsers: Internet Explorer, Firefox, Safari,… and we all know how painful cross-browser compatibility can be.
With Selenium you can write the tests in different languages: Java, Ruby, Groovy,… but, and this is a huge plus, you can also record them in Firefox using the Selenium IDE AddOn, and then run them with playback or export them to any of the languages supported.
Now follow me to this scenario. You have a team of developers writing a webapp. You can take anybody with a minimum experience (an user!) and tell them to use the site while SeleniumIDE records what they are doing. Then export the recording and add it to your integration builds to make sure it doesn’t break in future developments. Imagine also what you could achieve with experienced QA people, that don’t need to be developers at all nor know the internals of your app, and that can apply QA practices, trying to make your webapp break in any possible way. Sounds interesting? Keep reading
Let’s say that the site needs to be supported in different browsers too, Internet Explorer, Firefox and Safari. With Selenium you can run the same tests previously recorded against any browser.
At this point you have a development practice where developers develop, and a QA team that can be just test experts, not developers, either inside or outside your company or department, recording and running tests using only the requirements. Not a bad thing to have, but let’s make it better using automation.
Let’s assume you already have a working automated build and continuous integration, I know for many people is a big assumption, but let’s have hope ;), and assume you are using Maven and Continuum, not necessary, but that’s what I’m more familiar with. It is pretty easy to add Selenium testing to run as part of the build. With the Selenium Maven plugin you can start the Selenium server, launch the tests that will run the browser and execute the in-browser testing, and stop Selenium server at the end. When you have that running on Maven is straightforward to get it working in Continuum. For the gory technical details you can read my previous post Functional testing with Maven, Cargo and Selenium.
Will continue in my next entry…