Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

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

Currently, the tests only run when I have connected via Remote Desktop, and the window must be open. When I close the Remote Desktop session, the tests do not run.

If it isn't possible to run coded UI tests without remote desktop, how can I automate connecting via remote desktop?

Thanks

like image 520
Ciaran Gallagher Avatar asked Jul 31 '12 16:07

Ciaran Gallagher


People also ask

Can GUI testing be automated?

Benefits of Automated GUI testingGUI testing is mostly performed manually. However, while assessing the performance of small straightforward testers, a lot of developers write scripts for automated testing.

What is coded UI testing?

Coded UI tests (CUITs) drive your application through its user interface (UI). These tests include functional testing of the UI controls. They let you verify that the whole application, including its user interface, is functioning correctly.

Is UI testing necessary?

Thus, User Interface Testing is essential while developing web and mobile software applications. The article is a complete guide with checklists and examples for user interface testing.


Video Answer


2 Answers

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
like image 108
mejdev Avatar answered Oct 21 '22 12:10

mejdev


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.

like image 4
Ciaran Gallagher Avatar answered Oct 21 '22 10:10

Ciaran Gallagher