How to change screen resolution in BYOC setup on local Windows

Christiaan's Avatar

Christiaan

02 Oct, 2022 09:08 PM

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?

  1. Support Staff 1 Posted by Feodor Fitsner on 03 Oct, 2022 02:04 AM

    Feodor Fitsner's Avatar

    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. 2 Posted by Christiaan Verw... on 03 Oct, 2022 02:35 PM

    Christiaan Verwijs's Avatar

    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>

  3. Support Staff 3 Posted by Feodor Fitsner on 03 Oct, 2022 03:17 PM

    Feodor Fitsner's Avatar

    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. 4 Posted by Christiaan on 03 Oct, 2022 05:44 PM

    Christiaan's Avatar

    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

  5. Support Staff 5 Posted by Feodor Fitsner on 03 Oct, 2022 05:48 PM

    Feodor Fitsner's Avatar

    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. 6 Posted by Christiaan on 03 Oct, 2022 06:02 PM

    Christiaan's Avatar

    That works too. Thanks again

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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

 

01 Oct, 2024 04:27 PM
26 Sep, 2024 03:49 PM
26 Sep, 2024 09:02 AM
25 Sep, 2024 07:07 PM
24 Sep, 2024 08:39 PM
24 Sep, 2024 06:47 AM