Force display to remote VM

Hi everyone!

I’m working on deploying a bot that interacts with web elements on a remote virtual machine located behind a VPN. The issue is that when the bot runs unattended, it frequently fails during web automation tasks like clicking on elements, entering text into fields, or retrieving element properties. The error message is always the same: “CAN_NOT_FIND_HTML_ELEMENT”.

However, when I log back into the virtual machine via AnyDesk (I don’t have direct RDP access), the target webpage appears to load perfectly fine, and there are no visible issues with the elements.

Has anyone else encountered a similar issue when deploying a bot in such an environment? Also, does anyone know how to force the VM’s graphical environment to remain active or consistently rendered when unattended?

Hi Roy, are you waiting for the element before using it? The error message doesn’t seem to be related to a problem with the display.

yes…he error message doesn’t seem to be related to a problem with the display.

One thing that sometimes helps is keeping an active RDP/session open on the VM so the display stays “alive.” Some automation tools won’t render UI properly if the VM session is locked or disconnected. You could also try using a virtual display/monitor driver on the VM so it always thinks a screen is attached. That has fixed similar issues for me before.