After my last post on integrating Selenium RC tests with Hudson,I had few folks asking me on how I organized my test execution code with selenium RC tests.
If you are like me you probably started with running Selenium RC tests on your local machine and didn’t give much thought about integrating with Hudson,but when it was time,there was lot of files moving around and unnecessary cruft of code.
To run this sample,you will need ANT and Java on your machine
So here is a sample TestNG runner code which is ready for Hudson to consume and at the same time having a clean separation between Selenium RC tests and execution.This structure should make things easier when multiple team members are writing test cases allowing easier test code checkin to your version control system.So look at the attached zip file.Please find instructions on how to use this in the README folder.I have also included a sample Selenium RC project which the current TestRunner configuration points to.
This code is not intended to replace the Eclipse+TestNG plugin and it’s use in dev environment is highly recommended.But this code does the next step of getting your Selenium RC tests ready to be used by Hudson.For now the test runner is overtly simplistic and can only run a single TestNG configuration file,but feel free to extend this and make your own modifications to suit your needs.
When you are ready for Hudson to run your Selenium RC + TestNG tests,have your Hudson job execute the STunner/bin/seleniumtestrunner.xml and sit back and watch your tests run.
If your Hudson is on a Unix machine,look at my earlier post on Integrating Selenium Tests with Hudson CI
If you want how to convert your hudson cluster to Selenium Grid ,this post should help you.
Let me know if it doesn’t work for you or other issues that you face.
Follow us on @apexon on twitter to get more updates on Selenium as well how we can help your organization get Selenium ready.We offer multiple Selenium solutions that fits every project size and needs.
Important:The bundle doesn’t contain the selenium-server.jar as the size of the bundle increases.So the very first thing you will need to do is to download selenium server and copy it under ‘server’ directory.