Roman
Roman

Reputation: 51

How to run coded UI test with MSTest.ese without installing Visual Studio 2010

I am working with Coded UI automation. The issue is to customize test case execution. I cannot use TFS or Lab agent or any other tool. The test components (DLL) are executed through a customized UI developed using C# on a 64bit machine with Win7. I am able to run test case now through the code below:

string str = "C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\MSTest.exe"; 
        ProcessStartInfo startInfo = new ProcessStartInfo(str);
        startInfo.Arguments = " /testcontainer:TestProject1.dll";
        Process.Start(startInfo);

But when I want to install this application to another machine I need to install VS2010. This is what I don't want. I have gone through several doc on the internet, but none of them have a clear picture.If any one can help me with a solution.How to make it work.

Upvotes: 4

Views: 8408

Answers (2)

muthukumar
muthukumar

Reputation: 146

I have completed your requirement.See bellow

public void test()
    {
        string testcase = "/testcontainer:\"D:\\testcase\\s\\CodedUITest.dll\"";
        string Path = "C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\IDE\\mstest.exe";

        Process myProcess = new Process();
        ProcessStartInfo myProcessStartInfo = new ProcessStartInfo(Path, testcase);
        myProcessStartInfo.UseShellExecute = false;
        try
        {
            myProcess.StartInfo = myProcessStartInfo;
            myProcess.Start();
        }
        catch (Exception ex)
        {

            MessageBox.Show(ex.Message);
        }
    }

Upvotes: -1

S.Roshanth
S.Roshanth

Reputation: 1507

I am using Visual Studio Agents 2012 to execute coded UI test without visual studio installed, It works fine for me. you can specify test container,test method, result file name and even test setting file by a bat file and call the MStest.exe in test agents. Please refer to this Link

Upvotes: 0

Related Questions