Screen resolution in selenium tests in teamcity

Many developers and testers try to change screen resolution in teamcity service. Default screen resolution is 800×600, but its so small. As one of solution is to start teamcity agent like a simple application. But this solution is bad. Because you need to use one license on Windows Server and start teamcity agent after Windows server finished to boot.

I found a solution which allows you without hacks.

  1. Open services.msc. Open properties in teamcity agent service and check on checkbox Allow service to unteract with desktop.
  2. Open registry and change this key HKLM\SYSTEM\CurrentControlSet\Control\Windows\NoInteractiveServices to 0.
  3. Change Interactive Service Detection start mode to auto and start it.
    sc config UI0Detect start= auto
    sc start UI0Detect
  4. Connect to server using RDP.
  5. Enter this text command in commandline rundll32 winsta.dll,WinStationSwitchToServicesSession. RDP session will broken but it’s ok.

Thats all. When you will run a new end2end tests you see that screen resolution will increase.