Unexpected Screen Resolution Change in Windows Server during Automated UI Testing via RDP: How to Fix?

47 views Asked by At

I’m running automated UI tests on a Windows Server, which requires an active display. My setup process involves connecting to the server via RDP, initiating a PowerShell script to keep the screen active, and using the “tscon %sessionname% /dest:console” command to disconnect while keeping the session active. This setup has been working for months, with the session remaining active until server restart, making it always ready for UI tests triggered from Jenkins.

However, this setup recently stopped working. The server’s screen size changes to 1536x618 after running the tscon command, as evidenced by screenshots of UI failures. Interestingly, 1536 is 1.25 times 1920, suggesting a display scaling of 125%.

Despite my efforts, I haven’t been able to identify the cause of this issue. Server restarts, ensuring my local laptop isn’t at 125% scaling, and attempting to edit the server’s display settings (which are greyed out) have not resolved the problem. I even manually edited the registry as per the instructions on this page(https://www.inflectra.com/Support/KnowledgeBase/KB623.aspx), but the resolution reverts to 1536x618 whenever I’m not in the RDP session.

However, the server’s screen size started changing to 1536x618 after running the tscon command, which was not the expected behavior. I tried several solutions to fix this issue, including restarting the server, ensuring my local laptop isn’t at 125% scaling, and manually editing the registry. Despite these efforts, the problem persisted, with the resolution reverting to 1536x618 whenever I’m not in the RDP session. This was not the result I was expecting, and I’m currently seeking a solution to this issue.

0

There are 0 answers