How to change screen resolution in BYOC setup on local Windows
I've been experimenting with a BYOC setup. But I'm struggling to change the screen resolution of the AppVeyor Agent to anything other than 1024x768. I need this for my Selenium tests, which fail un such low resolutions.
I did NOT experience this issue before in the regular AppVeyor environments (non-BYOC), where this Powershell script is capable of changing the resolution just fine:
https://github.com/appveyor/ci/blob/master/scripts/set-screenresolution.ps1
Unfortunately, this script doesn't work with the local AppVeyort agent. All I'm getting is "Unable To Process Your Request. Sorry For This Inconvenience" when it runs as part of an AppVeyor build on my own BYOC. The error code is -1. If I run the Powershell script myself on the same machine, it does change the resolution successfully. My hunch is there is a rights issue, but it's really hard to figure out where to look. Any ideas on what could cause this?
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Feodor Fitsner on 03 Oct, 2022 02:04 AM
So, is it "Process" type of cloud, right? If so, see what user account is used to run AppVeyor Host Agent (
appveyor
by default). If you are saying you can run the script and it changes the resolution then you can configure host agent windows service to use your account instead. Hope that helps.2 Posted by Christiaan Verw... on 03 Oct, 2022 02:35 PM
Hi Feodor,
Thanks for responding so quickly!
Yes, it is a "process" cloud indeed.
I tried setting the Appveyor Host Agent to my own (admin) account as you
suggested. It doesn't seem to make a difference, unfortunately,
When I make screenshots during the Selenium run after failed tests, it
shows a 1024x768 resolution. On the regular AppVeyor cloud, the resolution
is correctly increased
I'm not sure how to move forward. Is there a way for me to access the
locally-running process when it's running its tests?
*Vriendelijke groet / best wishes*
*Christiaan Verwijs*
Captain Curly | +31(0)624950109
Read our latest writing on Medium <http://bit.ly/2CdRdad>
Check out upcoming workshops, classes & free meetups <http://bit.ly/2FO0i9n>
Visit us at the theliberators.com
<http://bit.ly/2CdRdad>
Support Staff 3 Posted by Feodor Fitsner on 03 Oct, 2022 03:17 PM
I think I know what's going on. As Host Agent is running as a windows service it doesn't have an access to a desktop. Inside AppVeyor cloud VMs build agent is running in interactive mode with an access to a desktop.
Try running host agent as a program from a command line. Stop AppVeyor Host Agent windows service then run
C:\Program Files\AppVeyor\HostAgent\appveyor-host-agent.exe
from command line. Let me know if that worked.4 Posted by Christiaan on 03 Oct, 2022 05:44 PM
That works! Wow, thanks. Great support Feodor. Resetting the screen resolution now works and my Selenium test battery also passes on the BYOC local cloud. That's wonderful!
I also tried to check the "Allow service to interact with the desktop" box for the Windows Service. But that didn't work, probably because it uses a Local System Account and not an elevated account.
Do you know if there is a way to allow this while running as a Windows Service? I can imagine that that is more convenient for others also? I'm happy this workaround works though
Support Staff 5 Posted by Feodor Fitsner on 03 Oct, 2022 05:48 PM
We've never been able to make "Allow service to interact with the desktop" work.
Current solution is to run Host Agent or Build Agent with "Run" section in the Registry.
6 Posted by Christiaan on 03 Oct, 2022 06:02 PM
That works too. Thanks again