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

前端 未结 8 1120
陌清茗
陌清茗 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:01

    View/interact with the machine using VNC (for example, TightVNC )

    0 讨论(0)
  • 2021-02-01 22:11

    The easiest solution to this problem was simply to enable auto-logon on my test environment (there are a variety of ways of doing this depending on OS).

    With auto-logon enabled, when I restart the test environment (using the 'shutdown.exe /r' command, which can be scripted), the test environment loads back up with an active, logged on session, and so the tests can run successfully.

    For my nightly test automation, I enabled auto-logon on my test environment and scheduled a restart prior to test execution.

    I have had no issues with this method - and it means I don't have to connect via Remote Desktop.

    0 讨论(0)
  • 2021-02-01 22:18

    this is very easy please check this blog post here this thing is explained in very simple way How to schedule Microsoft coaded UI test execution when you don’t have MS TFS

    1. Create a release of stable coded UI project by following steps i. Open Build > Batch build

    ii. Click rebuild if a release was already built

    1. After successfully building coded UI project navigate to release folder of project and copy testAutomated.dll named with your project name

    2. Place this dll on remote machine where you want to schedule your test execution

    3. Place .dll in some directory of remote machine e.g I am placing in D:\coadedUitest

    4. Install Miscosoft Test agent from this link on this machine where you want to execute test . http://www.microsoft.com/en-us/download/details.aspx?id=38186

    5. After installing test agent verify MS test is present in location

    6. Open note pad and enter following text D: cd coadedUitest set mstestPath="C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE" %mstestpath%\mstest /testcontainer:testAutomated.dll

    7. Save it with .bat extension

    8. Open .bat file by double clicking it to verify tests are executed or not

    9. After successful execution open windows task scheduler and create a scheduled task to run this created .bat file.

    http://testingtoolstecniques.blogspot.com/2014/11/how-to-schedule-microsoft-coaded-ui.html

    0 讨论(0)
  • 2021-02-01 22:18

    UPDATE:

    Using the VSO or TFS2015 build system no longer need a remote connection for the tests to run. Create a build or a release running the task "Visual Studio Test Agent Deployment", then run the "Run Functional Tests" Task.

    The best approach would probably be, create a build that drops your build artifacts, then create a release that deploys the site from the artifacts and runs the Coded UI Tests against that site.

    NOTES:

    • If you start a remote connection manually the run will fail.
    • If you create a remote connection and disconnect instead of logging out the run will fail.
    • Auto login enabled and a restart will still allow these tests to run.
    • Using Hyper-V you can see the desktop of the server running the tests, it is a very small window but gives you an idea of what the server is doing.
    0 讨论(0)
  • 2021-02-01 22:22

    I ran into the same issue with our remote test machine, but our test machines run on Hyper-V. With Hyper-V, the solution is simply to connect via Hyper-V instead of Remote Desktop Connection, and closing the Hyper-V connection won't lock the computer.

    Another suggestion would be to get around the fact that Remote Desktop automatically locks your screen. There's a quick bit about that here: http://homeservershow.com/remote-desktop-session-locks-workstation-after-exit.html

    Basically, run "tscon.exe RDP-Tcp#0 /dest:console" in command prompt from the remote machine when you want to disconnect. The machine should remain unlocked and the tests will run just fine.

    According to @Zatricion, that command can be generalized:

    tscon.exe %sessionname% /dest:console
    
    0 讨论(0)
  • 2021-02-01 22:22

    You can use VMware to run your coded ui tests. if you minimize the VM , test will still continue.

    See this link for more details. http://www.binaryclips.com/2016/03/coded-ui-tests-executing-test-case.html

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