Life is a Non-Deterministic Finite State Automata
Automation ? (*pGeekiness)++ : Code /eneration;

October 1, 2010

Long Path Error in MTM / Lab Center / CodedUI

Filed under: ALM,Testing — Tags: , , , , , — admin @ 6:01 am

I was trying to get my CodedUI Tests to run automatically on a Virtual Environment using MTM when I got this error:

"TestOutcome 'Error'; Message 'The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters'."

What a fascinating, informative error message! What path? What filename? Tip guys: String.Format(“{x}”) is powerful conveyer of information! The same problem occured when I kicked off a build with an automated build-deploy-test cycle: all of my tests were marked ‘Not Executed’ and marked as ‘Inconclusive’ with no indication in the log or summary as to why.

A period of much head scratching and elevated blood pressure ensued.

After some investigation and turning on the logging of the Agents and Controllers on the Virtual Machine, and examining all the various .logs, it turns out that the Test Controller (QTController.EXE) on the Virtual Machine uses Application Data as a stem and then adds a Guid and the name of your Virtual Machine to the end of the path: that is the working / staging directory. Ultimately, I had cunningly given my Virtual Machines descriptive names within the Lab Center Environment so I knew what they were but this caused the path limit exception. Not wise!

Rather than recreate my Golden Environment again, I went into QTController.exe.config (search your Virtual Machine for this) and saw this:


Nice! So I modified the QTController.exe.config by adding a key under appSettings in that file:

      <add key="WorkingDirectory" value="C:\Woo" />
      <add key="LogSizeLimit" ... />
      ... etc ...

After rebooting the Virtual Machine, my tests started to work but that only gave me another 30 or so characters to play with.

Ultimately, when you create your Environments, you might need to give your computer a shorter name (taken to the extreme below!) because the controller uses it as part of its path:


Powered by WordPress