none
Executing Multiple test cases in different test suites RRS feed

  • Question

  • Hi All,

    I have automated quite a number of test cases present in MTM (Microsoft Test Manager) using the coded UI tool in Visual studio Ultimate.

    But i cant execute all of them at once when they are present in different test suites.

    I want to execute all the test cases present in a Test Plan.

    Can you help me?

    Tuesday, August 20, 2013 2:04 PM

Answers

  • Hi Aditya,

    Thanks for your post!

    According to your description, you want to run multiple test cases in different test suites by MTM.

    In my opinion, maybe we can use the tool of TCM.exe to achieve that. For example:

    The following command runs tests using a test point query:

    tcm run /create /title:"Nightly Run" /planid:1 /querytext:"SELECT * FROM TestPoint WHERE ConfigurationId=13" /settingsname:"<Name of your automated test settings>" /testenvironment:"<Name of a matching environment>" /collection:<CollectionURL> /teamproject:<Team Project name>

    Demo: Run all automated test in a test plan:

    tcm run /create /title:"testPlan6" /planid:9

    /collection:http://tfsat:8080/tfs/defaultcollection /teamproject:VSTSProject

    /querytext:"select * from TestSuite WherePlanId=9"

    /settingname:CodeUITestSetting /testenvironment:Win7test /include

    Here is a reference below that you can get more information:

    Running Tests from a Test Plan Using the Command Line Utility

    http://msdn.microsoft.com/en-us/library/ff942469.aspx

    Thanks

    Best Regards


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Wednesday, August 21, 2013 9:57 AM
    Moderator
  • Hi Aditya,

    According to your reply, I would like to know something as follows:

    1. Which version of your MTM?

    2. Do you modify the parameters of the command? Such as /collection: your teamproject url. (This command is only an example which only for my environment, you should modify the parameters.)

    3. Are there any test case in your root test suite which status is Active? Make sure their parent is the root test suite. (You can right click the test case and select Reset test to active) (I tried it in MTM2012)

    Thanks

    Best Regards


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Thursday, August 29, 2013 7:07 AM
    Moderator

All replies

  • Hi Aditya,

    Thanks for your post!

    According to your description, you want to run multiple test cases in different test suites by MTM.

    In my opinion, maybe we can use the tool of TCM.exe to achieve that. For example:

    The following command runs tests using a test point query:

    tcm run /create /title:"Nightly Run" /planid:1 /querytext:"SELECT * FROM TestPoint WHERE ConfigurationId=13" /settingsname:"<Name of your automated test settings>" /testenvironment:"<Name of a matching environment>" /collection:<CollectionURL> /teamproject:<Team Project name>

    Demo: Run all automated test in a test plan:

    tcm run /create /title:"testPlan6" /planid:9

    /collection:http://tfsat:8080/tfs/defaultcollection /teamproject:VSTSProject

    /querytext:"select * from TestSuite WherePlanId=9"

    /settingname:CodeUITestSetting /testenvironment:Win7test /include

    Here is a reference below that you can get more information:

    Running Tests from a Test Plan Using the Command Line Utility

    http://msdn.microsoft.com/en-us/library/ff942469.aspx

    Thanks

    Best Regards


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Wednesday, August 21, 2013 9:57 AM
    Moderator
  • Hi Starain,

    Thank you for the quick reply.

    When I execute the above commands in the developer command prompt,

    message displayed as

    "The request was rejected by the server.
    Technical information:
      A potentially dangerous Request.Path value was detected from the client (:)."

    Also i want to use the Test manager for the execution..

    When i right click on the test plan in the Test , the "Run" as well as "Run with options" are disabled...

    How can these be enabled?

    I have already specified the test environment and test settings in the properties for the plan..



    Tuesday, August 27, 2013 6:13 AM
  • Hi,

    What's the commands that you execute, please provide the detail commands. Could your Visual Studio connect to the TFS on your machine which you run the TCM?

    If there are test cases under the test suite, the Run and Run with options can enable when you right click the test suite. If there aren't test cases under the test suite, the option will be disabled.

    For example:

    Under Test suite A, there are test case 1 and test case 2, when you right click the Test suite A and run, it will run both test case.

    Under Test suite B, there are no test case, only have a Test suite B1 and under Test suite B1, there are test case 3 and test case 4. The option will be disabled when you right click Test suite B, however, the option will be enabled when you right click the Test suite B1.

    So, if you want run multiple test case in difference test suite, you should use the TCM tool or you can develop a application use the API to run the test case.

    Thanks


    • Edited by Clearly09 Wednesday, August 28, 2013 11:41 AM add
    Wednesday, August 28, 2013 11:21 AM
  • Hi clearly09,

    I run the command as specified by starain above its in same format as below :-

    tcm run /create /title:"testPlan6" /planid:9

    /collection:http://tfsat:8080/tfs/defaultcollection /teamproject:VSTSProject

    /querytext:"select * from TestSuite WherePlanId=9"

    /settingname:CodeUITestSetting /testenvironment:Win7test /include

    And yes my visual studio can connect to the TFS.

    Also the run with options can be enabled for different suites in a plan but it can't be enabled for the plan..

    Thursday, August 29, 2013 5:32 AM
  • Hi Aditya,

    According to your reply, I would like to know something as follows:

    1. Which version of your MTM?

    2. Do you modify the parameters of the command? Such as /collection: your teamproject url. (This command is only an example which only for my environment, you should modify the parameters.)

    3. Are there any test case in your root test suite which status is Active? Make sure their parent is the root test suite. (You can right click the test case and select Reset test to active) (I tried it in MTM2012)

    Thanks

    Best Regards


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Thursday, August 29, 2013 7:07 AM
    Moderator