DCSIMG
How To: Run Coded UI Tests From Command Line - Shai Raiten's Blog

Shai Raiten's Blog

It's all about code...

How To: Run Coded UI Tests From Command Line

How To: Run Coded UI Tests From Command Line

One of my previous posts about Coded UI I showed how to Run CodedUI Test From Another Application.
In this post I’ll show how to use Mstest to run Coded UI Tests thought command line.

  1. Open up with Visual Studio 2010 Command Prompt Window.
    image
  2. Browse to your Test directory.
  3. Enter the following command prompt to run all tests
    Mstest /testcontainer:TestProject.dll /test:CodedUITest1

image

enjoy

Comments

falkdj said:

Thank you for your very informative post!

I was wondering if you would be able to clarify something, for me.

I see that you can choose a certain CUI Test in a Test project with the "/test" option.  Assuming a CUI Test has multiple Test Methods inside of it, is there a way to control the execution order of the Test Methods?  It appears that the default execution order is alphabetical.

Thanks very much!

# November 16, 2010 10:02 PM

shair said:

Hi,

You will need to create Ordered Test and there you can define the right Test Order.

# November 18, 2010 1:44 AM

C l e m e n s said:

VS2010 ALM MTLM usages patterns for Windows Azure hosted application development

# March 29, 2011 10:15 AM

Balaji said:

I am only having framework 4.0 installed in my system. Can i able to run it ?

I tried this

C:\WINDOWS\microsoft.NET\Framework\v4.0.30319

Mstest /testcontainer:TestProject.dll /test:CodedUITest1

but error is comming mstest is not recognized

Mail me if you can bala.effie@gmail.com

# June 2, 2011 4:21 PM

Chevy B said:

You must first do a change directory command (CD) to the directory where your test.dll resides. See step 2 in the example above

# January 26, 2012 1:18 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: