I have a Visual Studio solution which includes a Test project having Selenium Tests.
(I already have a compilation build triggered by version control checkin (Mercurial))
But I want to have a separate (nightly) Build Configuration which runs the Selenium tests, ideally under MSTest.
I assume I need Selenium Server for this? If so, what's the best way to fire it up before running the tests? Should I do this from the MSBuild script or use a Build Step from Team City itself? Do I need to fire up Cassini\WebDev.WebServer first of all so the following can run:
selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://localhost:49192/");
?
I have a Build Server with TeamCity 6.5.1 installed. I have a VS2010 installed.
Surely someone has done this! Desperate for some help here guys. If any one could offer any examples, that would be appreciated.
If you need to coordinate with Selenium tests with the TeamCity server, you can do it by including former created project into your development project files. From that point onward, you can arrange TeamCity build setup to run your Selenium tests on each triggered build.
JetBrains TeamCity is a user-friendly continuous integration (CI) server for developers and build engineers free of charge with the Professional Server License and easy to set up!
Configuring project in TeamCityCreate a new build configuration inside this project. Attach it to the project's VCS root. Add the Maven build step. The Maven build runner supports the TestNG framework and provides real-time reports.
Automation Testing is at the core of any CI/CD pipeline. This is because the whole concept of CI/CD revolves around “build fast, test fast, fail fast.” Tests have to be run as fast as possible so that the feedback reaches the developer early.
I am just about to set up Selenium tests in our TeamCity Server and am still Googling. These are the pages that I found interesting (apart from your StackOverflow question):
Regression testing for any web application with TeamCity, Selenium, and JUnit
Selenium browser UnitTesting from TeamCity
So there is one solution that converts the html files recorded with Selenium IDE to Java to be ran with JUnit in TeamCity and the other approach is creating your test scripts in C#.
And this topic, "Running Selenium Tests through Teamcity, can it be done?" describes a problem while running the Build Agent as a service... I hope that I can continue running the agent as a service.
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:
http://www.mysite.com/selenium/generateTests.aspx
)In the powershell script:
[*1] 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
[*2] nxslt3 $seleniumXmlTestReportPath nunit.xslt -o $nunitReportPath baseUrl=$testBaseUrl
We use TeamCity to build and test our C#-based web application. We run the Selenium Server all the time, using the Java service launcher to start it. The tests connect to localhost
, just like you show in your question.
We use TeamCity's "NAnt Runner" to start the test jobs, and use NAnt's <nunit2>
task to run the tests under control of NUnit. Because we do that, NUnit finds and runs any public method annotated with a [Test]
attribute - it's a very simple, very powerful tool.
This setup works very well for us.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With