DCSIMG
Q: Run Web Test Using MSTest Command-Line Failed - Shai Raiten

Shai Raiten

 Subscribe

Q: Run Web Test Using MSTest Command-Line Failed

Run Web Test Using MSTest Command-Line Failed

I got an email asking me to help with msdn forum request.

Q:

I am trying to run a delegated WebTest from the command line using MStest. I have VSTS 2008 Suite Edition Installed. If I go to the command prompt from VSTS first (start-->all programs-->microsoft visual studio 2008-->visual studio tools-->visual studio 2008 comand prompt),
then go to the directory where my Webtest resides, then run my Webtest with mstest, it runs.
But if I go to the command prompt in the normal way, go to the directory where my Webtest resides, the mstest command fails with the error message: " 'mstest' is not recognized as an internal or external command".
I looked in the Forum and found an old entry from 2006 at http://social.msdn.microsoft.com/Forums/en-US/vststest/thread/a6b15c77-6ffc-4c03-9d43-c5f37f922b2d/ that told me to "You'll need to add mstest.exe's location to the PATH environment variable.
Open a command window and execute this command: path=%path%;locationOfMstestExe".

I tried this command at the command prompt from within VSTS and normally.
Then tried to run my WebTest and I get the same error unless I run it from within the VSTS command prompt. How can I fix this? I need to be able to run WebTests in batch mode.

A:

This is the path Visual Studio used.
 
@set PATH=c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE;c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN;c:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools;c:\WINDOWS\Microsoft.NET\Framework\v3.5;c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;c:\Program Files\Microsoft Visual Studio 9.0\VC\VCPackages;%PATH%

@set INCLUDE=c:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\INCLUDE;c:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE;%INCLUDE%
@set LIB=c:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB;c:\Program Files\Microsoft Visual Studio 9.0\VC\LIB;%LIB%

@set LIBPATH=c:\WINDOWS\Microsoft.NET\Framework\v3.5;c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;c:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB;c:\Program Files\Microsoft Visual Studio 9.0\VC\LIB;%LIBPATH%

You can set the PATH by default to use c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE.

Right Click on "My Computer" -> Advanced –>

image

"Enviorment Variables" –>

image

in "System Variables" select "Path" and click "Edit"

image

This is the default - 

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\HPQ\IAM\bin;C:\Program Files\Intel\DMIX;c:\Program Files\Microsoft SQL Server\90\Tools\binn\

Change it to -

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\HPQ\IAM\bin;C:\Program Files\Intel\DMIX;c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE;c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN;c:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools;c:\WINDOWS\Microsoft.NET\Framework\v3.5;c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;c:\Program Files\Microsoft Visual Studio 9.0\VC\VCPackages;

Result:

I added your new path to my path of my environment variable path, and it worked like a champ! Thanks!  -Jill

Comments

Jill Bufford said:

I added your "change it to" path above to the path of our existing path environment variable path, and it worked like a champ!

Thanks so much!

Jill

# December 2, 2008 5:11 PM

Q: Run Web Test Using MSTest Command-Line Failed - Shai Raiten | corporated.net said:

Pingback from  Q: Run Web Test Using MSTest Command-Line Failed - Shai Raiten | corporated.net

# December 2, 2008 9:22 PM

sql server | Digg hot tags said:

Pingback from  sql server | Digg hot tags

# December 3, 2008 7:26 AM

Team System News said:

Shai Raiten on How To: Change Work Item Attachment Size Limit and Q: Run Web Test Using MSTest Command-Line...

# December 9, 2008 8:52 AM

gyncclAinilag said:

yo, beta.blogs.microsoft.co.il great name for site)))

------------------------

sponsor:  http://cigace.ru/

# March 9, 2009 2:03 AM

nick_paslie said:

# June 30, 2009 12:00 PM

nick_chizel said:

# June 30, 2009 12:00 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: