Teamcity agent screen resolution

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

7 comments
Comment actions Permalink

I have the same issue. Looks like nobody knows the answer!

0
Comment actions Permalink

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

0
Comment actions Permalink

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.

0
Comment actions Permalink

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.

0
Comment actions Permalink

It looks like the solution provided by Nikita is no longer supported in windows 10 and windows server 2019.

Is there another way?

 

 

0

Please sign in to leave a comment.