How to change default Windows resolution? (Autologon resolution without active rdp session, e.g. for UI test automation with selenium)

1

Hello,

I search for a solution on AWS EC2 Windows Instance to change the default resolution, to have a specific resolution, even if **no **active RDP session is connected.

For Autologin after instance is started, I use official MS Sysintenals Autologon: https://docs.microsoft.com/en-us/sysinternals/downloads/autologon

Everything is working fine with Autologon without RDP. I can simply reboot the instance or start new instanced, Autologon is happening, and also scripts (and UI test automation) is starting and running fine. But changing resolution of apps, e.g. the browser, is not working, this seems to be related to windows resolution itself. Because when I connect with RDP to the machine, all changes to app/browser windows sizes are working fine, with exactly the same scripts. But without an active RDP session, just with Autologon after reboot, resolution changes on app/browser are not done, this seems to be related because Windows resolution is too small without active RDP session.

I found a lot of topics and tried all solutions: This one: https://superuser.com/questions/853252/how-to-change-the-default-resolution-in-windows-for-automatic-logon. Or using PowerShell command itself, e.g.: “Set-DisplayResolution -Width 1920 -Height 1080 -Force”

But now one fix the problem.

Someone have a solution to set a specific windows resolution for a session with**out **active RDP connection (e.g. session per Autologon)?

Thanks a lot

Seb
asked 2 years ago1193 views
1 Answer
0

Hello Seb,

I understand you are having problems with performing UI tests on a EC2 Instance via Selenium.

I did some research on the articles you linked in your post. It seems that some users experienced mixed results from the solutions posted.

I did some general research on Selenium and how others have tried tackling the problem outside of AWS. Other people are experiencing the same frustrations as you, and are also experiencing mixed results. Because of this, I do not think this is an AWS-specific issue.

I looked for a definitive answer and seem to have found one in a Stack Overflow article [1], which uses an Azure VM. This is what I found:

  • This is a limitation with Windows since it uses RDP (or VNC, etc) to set the screen resolution.
  • It is not currently possible to change the resolution of a Windows instance unless you use RDP or a test agent.
  • This is likely due to a device <-> driver issue on windows

There are workarounds available.

I found an article that some users were using for workarounds to perform their UI tests. It suggests automating RDP sessions to set the resolution (in your case, an EC2 instance) for the UI test [2].

[1] Increase the screen resolution on Test Agent - Stack Overflow (https://stackoverflow.com/questions/45829787/increase-the-screen-resolution-on-test-agent)

[2] Automate your remote desktop sessions - OutOfMemoryException (https://outofmemoryexception.wordpress.com/2016/03/29/automate-your-remote-desktop-sessions/)

Please let me know if this response helps or if you have any other questions. If the above steps do not resolve your issue, I strongly encourage you to contact an AWS support engineer who will be able to assist you.

answered 2 years ago
AWS
SUPPORT ENGINEER
reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions