pywin32 / pywinauto not working properly in remote desktop when it is minimized
I have a Jenkins pipeline that executes a program in a remote server that uses pywin to manipulate an application for functional tests. My application works great while I have the remote desktop oppened but when I close the remote desktop and run it from Jenkins, the app gets lost. What I do is to open the app and send an enter key. This is my app: os.startfile("C:\\Program Files (x86)\\SAP\\FrontEnd\\SAPgui\\saplogon.exe") time.sleep(5) handle = win32gui.FindWindow(0, "SAP Logon 740") keyboard = Controller() keyboard.press(Key.enter) So I tried to add focus to the app to force the focus