none
Additional deployment items for automated CodedUI test started from Microsoft Test Manager RRS feed

  • Question

  • I've successfully associated a CodedUITest to my test case. Then I've set up a Test Controller and Test Agent connected to the Team Project. Now I can run the automated test from within Microsoft Test Manager (from a test plan configured to run automated tests on the corresponding test agent). But my CodedUI test is for a desktop application and needs additional deployment items (actually the target application exe and addtional dlls). For a local test run from within Visual Studio I specify the additional deployment items in the local.testsettings file. But where can I do this for test runs from within MTM?

    The whole infrastructure seems to be set up correctly, since I can see how the test is started on the test agent machine (I log in interactively with the same user as the agent is set up to run the tests). But soon after starting the CodedUI test I get an exception when launching my exe, whicc of course is not deployed from the build results:

    ...OnTestInitialize threw exception. Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToLaunchApplicationException: Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToLaunchApplicationException: "The application cannot be started because it cannot be found in the specified location, or the user does not have sufficient permissions to start the application." File: MyApplication.exe..

    BTW, deployment items form a .testsettings file from within Visual Studio work for remote execution of the CodedUI test on another test controller/test agent machine (which of course is not associated to the Team Project!).

    Thomas Hensler


    Remove nospam. to reply!
    Friday, February 25, 2011 12:43 PM

Answers

  • Hi Thomas,

    The testsettings from VS arent used when running tests from MTM.

    You can solve your problem by following any of the two approaches.

    1) Specifiy the deployment items in the testsettings in the Lab Manager and use this testsetting to run your tests. Please refer http://msdn.microsoft.com/en-us/library/ee518927.aspx . You will have to make sure that the path you specify in the deployment items exists on the test controller or specify a shared network path.

    2) Add DeploymentItem attribute to your test class/ test method. Please refer http://msdn.microsoft.com/en-us/library/ms182475(v=vs.80).aspx .You will have to make sure that bthe files are part of the project with copy to output propety set as copy always. You can test this first by removing the deployment items from the testsettings in VS so that the DeploymentItem attribute is used.

    Thanks,

    Anuj

    Friday, February 25, 2011 6:26 PM

All replies

  • Hi Thomas,

    The testsettings from VS arent used when running tests from MTM.

    You can solve your problem by following any of the two approaches.

    1) Specifiy the deployment items in the testsettings in the Lab Manager and use this testsetting to run your tests. Please refer http://msdn.microsoft.com/en-us/library/ee518927.aspx . You will have to make sure that the path you specify in the deployment items exists on the test controller or specify a shared network path.

    2) Add DeploymentItem attribute to your test class/ test method. Please refer http://msdn.microsoft.com/en-us/library/ms182475(v=vs.80).aspx .You will have to make sure that bthe files are part of the project with copy to output propety set as copy always. You can test this first by removing the deployment items from the testsettings in VS so that the DeploymentItem attribute is used.

    Thanks,

    Anuj

    Friday, February 25, 2011 6:26 PM
  • Hi Anuj,

    approach 1 from your suggestions does not really make sense for us, because we need to deploy files from the build results of course and the directories for the build results change with every build. But we cannot change the deployment settings in the test environment every time we select another build to test. I think the intention to use the deployment settings in the test environment is for more "static" items.

    approach 2 works. But it has the big disadvantage, that we have to redudantly specify the deployment items in the code for every test class/method. And we have quite a long list of items (as usual for a desktop application). Probably there is an idea for an improvement in MTM.

    Thanks,

    Thomas


    Remove nospam. to reply!
    Monday, February 28, 2011 2:15 PM
  • Glad to know Thomas that the second approach works for you. Agree that its a pain to add the DeploymentItems attribute to each test class/method.

    Thanks,

    Anuj

    Monday, February 28, 2011 10:24 PM