We are running our GUI integration-tests on a Jenkins build-slave. The slave is running Windows Server 2012. Our application is built on Java RCP and uses SWTBot for testing.
The problem is, that most of the time, the tests fail at a point where the user (or in this case SWTBot) presses the key combination Strg+Z. It simply does not seem to have any effect.
Then, if we log on remotely on to the server and actually watch the build process (without interaction), the tests will always complete as success. So I guess it has something to do with actually displaying the Desktop to a session. In rare cases though, the tests are also succeeding without anyone being logged on remotely to our build slave.
Does anyone know what could be going on?
It turned out, that the problem is caused by a locked screen for a disconnected RDP session. You can prevent screen locking by executing the following as a bat script (as admin) => it will disconnect your session without a screen lock:
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (
%windir%\System32\tscon.exe %%s /dest:console
)
Please be aware, that the unlocked screen may pose a security risk.