Can I run the CodedUI test with a locked screen?

I wrote a project to test an automatic UI (using a coded UI) and deployed it to a server.
I want to schedule a testing task to show 12:00 every night.

My problem is that the server is locked (the user is still logging in), it cannot work successfully and the error message:

The automation mechanism cannot reproduce the test because it is not able to interact with the desktop. This can happen if the computer starts the test blocking or its remote session window is minimized.

Is there any way to plan that the test code of the encoded interface on the server also always starts?

+4
source share
1 answer

In the general case, it is impossible to run a user interface test if the desktop is locked, the user has not logged in, if there is a screen saver, etc. The workarounds that I saw to avoid these problems are to turn off the screen saver and set the computer to automatically log in so that the user is always registered. To make the machine ready for testing, you can restart it; after a few minutes, he should be sitting on the unlocked screen with a registered user of the test.

Please note that you should only do this for a test client computer and not for a server that is intended to be used for important, safe, or critical tasks .

+2
source

Source: https://habr.com/ru/post/1388098/


All Articles