Teamcity agent screen resolution Follow
Hello all,
Is there a way to set/configure the screen resolution in a teamcity build agent. The build agent is a windows agent and teamcityagent runs as a service on that machine.
Many Thanks,
Aravind
Please sign in to leave a comment.
I have the same issue. Looks like nobody knows the answer!
Hi Steve,
This issue is *not* a TeamCity specific issue, but a Windows specific one. TeamCity is working as a service, which means that the system is starting up a session for it, controlling its screen resolution. In order to configure that, please check with the windows documentation.
This information here might help: https://stackoverflow.com/questions/41244411/selenium-change-resolution-on-node-service
I think that is a cop out. Firefox works fine from Windows when started manually. Problem only occurs when running from TeamCity. Therefore it IS a TeamCity issue. It is run as a WebService, which is headless.
Hi Steve,
I might not have explained myself correctly. The issue happens with TeamCity, but it's not an issue of TeamCity itself. When you open firefox from your own windows session, it inherits the environment of your session. When you run TeamCity as a service, you don't have a UI session, it's a service session. Firefox opened there thus is opened with that session, with different environment. This is because of how windows services work, and has nothing to do with teamcity. Steps on making it work are described in the stackoverflow question, as this is not an uncommon scenario, particularly for UI testing.
There is another workaround: Open a regular user session, stop the TeamCity agent service, open a command prompt and move to the build agent's folder. Run the build agent manually from the console. As long as that session remains open, the teamcity agent will inherit the environment of that session and it will be able to open firefox (or whatever) just fine. For making it work running the TeamCity agent as a service, you will need to modify the environment for the service as described previously.
Hope it's clearer now.
You can use my solution http://www.voip-lab.ru/screen-resolution-in-selenium-tests-in-teamcity/
It looks like the solution provided by Nikita is no longer supported in windows 10 and windows server 2019.
Is there another way?
Hi Jason,
We have this article in our documentation: https://www.jetbrains.com/help/teamcity/known-issues.html#KnownIssues-Windowsservicelimitations.
Nikita Rukavkov Hi Nikita, your solution is the one and working in my case. But the link doesnt work anymore. Could you post the solution here or send a link where it can be accessed? Thanks!
Nikita Rukavkov's link seems to work for me. I've copied her steps below for future reference if it is helpful to anyone. However, keep in mind this will not work in Windows 10 (1803 and later) as the Interactive Services Detection service has been deprecated and removed from Windows 10. Please see the relevant info from Microsoft here: https://social.technet.microsoft.com/Forums/windows/en-US/7266d107-08d1-4f53-ad7d-4cef3d67570d/missing-interactive-services-detection-in-windows10
As Denis Lapuente mentions, it is really a matter of running the agent from the console rather than as a service. If started from the console, the agent inherits the UI from the session. In Windows, you can start the agent from the console with the command <agent home>/bin/agent.bat start. For more information on running the agent from the console, please refer to Starting the Build Agent.