Running MSTest Coded UI tests outside of Visual Studio 2010 with NUnit

by Klaus Graefensteiner 1. July 2011 06:11

It is possible. Here is how

Development

Develop your NUnit tests with Visual Studio 2010 and the MSTest Coded UI Test facilities.

Automated Test

On the test or build machine you need to install the VisualStudio 2010 Test Agent and manually add the following assembly to the global assembly cache. Otherwise you will run into the following error when automating against Internet Explorer:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.OLE.Interop,
Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
The system cannot find the file specified.

The fix

The VisualStudio Test Agent installs the Microsoft.VisualStudio.OLE.Interop dll, but doesn’t add it to the GAC (Global Assembly Cache). Visual Studio on the other side does.

MissingAssemblyLocation

Use the GACUtil.exe utility, which can be found on the Visual Studio machine or the Windows SDK. Run this utility with the /i switch and make it point to the assembly.

gacutil /i C:\Program Files (x86)\Common Files\microsoft shared\VSTT\10.0\Microsoft.VisualStudio.OLE.Interop.dll

Ausblick

That’s it. Happy testing!

Tags: , , , , ,

Automation | Visual Studio | Tips & Tricks | Troubleshooting | How To

About Klaus Graefensteiner

I like the programming of machines.

Add to Google Reader or Homepage

LinkedIn FacebookTwitter View Klaus Graefensteiner's profile on Technorati
Klaus Graefensteiner

Klaus Graefensteiner
works as Developer In Test and is founder of the PowerShell Unit Testing Framework PSUnit. More...

Open Source Projects

PSUnit is a Unit Testing framwork for PowerShell. It is designed for simplicity and hosted by Codeplex.
BlogShell is The tool for lazy developers who like to automate the composition of blog content during the writing of a blog post. It is hosted by CodePlex.

Administration

About

Powered by:
BlogEngine.Net
Version: 1.6.1.0

License:
Creative Commons License

Copyright:
© Copyright 2013, Klaus Graefensteiner.

Disclaimer:
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Theme design:
This blog theme was designed and is copyrighted 2013 by Klaus Graefensteiner

Rendertime:
Page rendered at 5/22/2013 12:07:22 AM (PST Pacific Standard Time UTC DST -7)