Is it possible to run Coded UI tests without having to connect via remote desktop?

前端 未结 8 1121
陌清茗
陌清茗 2021-02-01 21:30

I\'m attempting to automate Coded UI tests.

My test controller launches the tests on a remote test server, which I normally access via a Remote Desktop connection.

相关标签:
8条回答
  • 2021-02-01 22:23

    From MSDN:

    The computer that is running an agent on which you want to run coded UI tests cannot be locked or have an active screen saver.

    If you are running your CodedUi Tests through Visual Studio (means that tests are executed under your account), I believe that you must be connected via remote desktop to the remote test server.

    However, you can use Microsoft Test Manager to run your tests:

    1. Create a virtual environment.
    2. Setup your virtual machines so they can run automated tests.
    3. Install the Test Controller and Test Agent.
      -Set up the Test Agent to run as Interactive Proccess so it can run CodedUi Tests.
      -Set up the Test Controller to run with Microsoft Test Manager.
    4. Create a Test Plan through MTM and run tour tests in your virtual environment. There is no need to be connected in the remote server now, because your tests will run under the account that runs the Test Agent (note: you should create one for testing purposes).
    0 讨论(0)
  • 2021-02-01 22:25

    --Preferred Solution 1: Have a Hyper-V Client and simply run coded UI tests using a schedule task. No issues at all.

    --preferred Solution 2: You need to have 2 VM. First remote desktop to VM 1, then from VM 1 remote desktop to VM 2 where Coded UI will be running. Once Coded UI started in VM2, simply disconnect VM 1. This will keep the session opened and will never have any issues

    -less preferred Solution 3: Restart VM using command line. Make sue auto-log in is enabled on your VM. Have a scheduled task to run coded UI.

    I used this method and found some of my tests breaks.

    --least preferred Solution 4: use tscon.exe %sessionname% /dest:console I used this method but cannot guarantee that your test will run with out any issues

    0 讨论(0)
提交回复
热议问题