windows server problem

0

I am using this server, a Windows server. Because I am using a Python code that uses pyautogui, selenuim Selenium works normally even when I do not open an rdp connection to the server. Rather, pyautogui. If I minimize the rdp program with which I opened or closed the connection, pyautogui does not work. What is the solution?? ???????????????????

asked 21 days ago27 views
2 Answers
0

The issue you're experiencing with pyautogui not working when the RDP connection is minimized or closed is related to how Windows handles display and input when there's no active RDP session. This is a common challenge when running UI automation tools like pyautogui on remote Windows servers.

The root cause is that Windows changes the display settings and input handling when there's no active RDP session, which affects tools that rely on screen interaction like pyautogui.

To address this problem, you need to configure the Windows server to maintain a consistent display resolution and input handling, even when there's no active RDP session. Here are some potential solutions:

  1. Use a virtual display adapter: Install a virtual display adapter driver on the Windows server. This will create a persistent "fake" display that pyautogui can interact with, even when no RDP session is active.

  2. Configure autologon: Set up Windows autologon to ensure there's always an active user session, even when no one is actively connected via RDP.

  3. Use remote control software: Instead of RDP, consider using remote control software that doesn't affect the server's display settings when disconnected.

  4. Adjust Windows settings: Try modifying Windows settings to maintain a consistent resolution and display configuration, regardless of RDP connection status. This may involve registry changes or group policy adjustments.

  5. Use alternative automation methods: Consider using tools that don't rely on screen interaction, such as Selenium's headless mode or other API-based automation approaches.

If these solutions don't resolve the issue, you may need to explore more advanced options or consider redesigning your automation approach to work within the constraints of remote Windows server environments.
Sources
How to change default Windows resolution? (Autologon resolution without active rdp session, e.g. for UI test automation with selenium) | AWS re:Post
Free EC2 doesn't work | AWS re:Post

profile picture
answered 21 days ago
AWS
EXPERT
reviewed 21 days ago
0

To add to rePost agent answer, you probably need to configure a higher default screen resolution, enable Windows autologon, and configure pyautogui to run on Windows startup. You may have to disable windows screen lock and monitor screen off.

Try the guidance in this article, and connect using DCV.

AWS
EXPERT
answered 21 days 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