Run Selenium from visualstudio.com

You can host your project in Visualstudio.com and still run selenium tests in the build. The hosted build controller does not support it (details) and cannot be adjusted. Why not create your own Build Controller in Azure VM? Here is how I did it.

I’ve created a Microsoft Windows 2012R2 server VM and remote desktop into it.

Install Team Foundation Server and configure the Build Controller.
Configure Build Controller

Connect the Build Controller to visualstudio.com. Use the Browse button and connect to “your” visualstudio.com server.
Connect to visualstudio.com

I left the rest on default and let the configuration complete.
Done

In the Team Foundation Server Administration Console > Build Configuration: check the Run the Service Interactively and use the Remote Desktop account for Run the service as.
Run the server interactively

Install Visual Studio 2013. This is on the hosted build controller also.

Now you can select this new Build Controller in build definitions in visualstudio.com.
Change build controller

Problems

I’ve run into some problems before I got my SeleniumDemo to work.

The imported project “C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\WebApplications\Microsoft.WebApplication.targets” was not found. or
TF900547: The directory containing the assemblies for the Visual Studio Test Runner is not valid ‘C:\Program Files (x86)\Common7\IDE\CommonExtensions\Microsoft\TestWindow’.
➡ Solution is to install Visual Studio 2013.

Access denied when hitting IISExpress website
➡ Edit C:\Program Files (x86)\IIS Express\AppServer\applicationhost.config to use WindowsAuthentication. I did revert back to the origional implementation for starting IISExpress found here

Access denied when starting build. Files are in use
➡ Hookup to the AppDomain.CurrentDomain.ProcessExit event for quitting the Webdriver and stopping IISExpress

private void CurrentDomainProcessExit(object s, EventArgs e) {
    WebDriver.Quit();
    WebServer.Stop();
}

About erictummers

My work as a recruited developer changes almost every month. I like challenges and sharing the solutions with others. On my blog I’ll mostly post about my work, but expect an occasional home project, productivity tip and tooling review.
This entry was posted in Development and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s