Reputation: 643
I have a .Net project of a simple web app and I'm trying to use Selenium Webdriver tests with it. I've set up a Selenium test project on the same solution, but the test won't run because the IDE won't run my web app first. So when the test runs and tries to access my URL it's not even there to begin with.
How can I tell Visual Studio that the main app needs to be up and running before the tests are run?
Upvotes: 0
Views: 648
Reputation: 643
Turns out the best solution was to use IISExpress to run my application as the tests were performed, and kill it right after.
The command I'm currently using to start the server is:
start C:\"Program Files (x86)"\"IIS Express"\iisexpress.exe /path:"C:\TeamCity\buildAgent\work\8812f08621aa0565\trunk\MyProject" /port:64356
"Start" tells it to run on another command window. This is followed by the executable for IISExpress, then the path to where the application was built and the port it needs to run in. That little command, when put in a TeamCity build step, takes care of deploying the webapp so Selenium tests can run on it.
Another step is required to kill IISExpress. This runs after everything is done.
I am aware that IISExpress is, by no means, sufficiently robust for a serious CI process, but for now it works just fine as a proof of concept.
Upvotes: 1