We are using Selenium for nightly tests of our companys external web site. For this we use Selenium RC and dynamically created test suites.
Our process, which seems more complicated than Ross' is like this:
- Install Selenium RC on the TeamCity server
- Use the Firefox IDE plugin to create tests
- Create a web page that generates a test suite html file with links to all tests in a certain web accessible folder (e.g. http://www.mysite.com/selenium/generateTests.aspx)
- Create a Powershell build step in TeamCity, running a script that downloads the suite and corresponding tests to the build server
- Add a "XML report processing" build feature to scan for test results. This makes TeamCity able to tell you about the test results.
In the powershell script:
- Execute the Selenium RC runtime with inputs that targets the downloaded test suite and which url that is to be the base url. [*1]
- Use XSLT to transform the output to NUnit format [*2]
java -jar C:\Selenium\selenium-remote-control-1.0.3\selenium-server-1.0.3\selenium-server.jar -log C:\Selenium\www.mysite.com\selenium-log.log -userExtensions 'user-extensions.js' -firefoxProfileTemplate 'Selenium FireFox Profile' -htmlSuite *firefox http://www.mysite.com C:\Selenium\www.mysite.com\generated\GeneratedSuite.htm C:\Selenium\www.mysite.com\TestResults.html
nxslt3 $seleniumXmlTestReportPath nunit.xslt -o $nunitReportPath baseUrl=$testBaseUrl