Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any way to run pywinauto in remote desktop session? #247

Closed
mineralres opened this issue Oct 18, 2016 · 3 comments
Closed

Is there any way to run pywinauto in remote desktop session? #247

mineralres opened this issue Oct 18, 2016 · 3 comments
Labels

Comments

@mineralres
Copy link

I can run pywinauto in rdp sesion when my rdp terminal is open and show normal, buy if the terminal is closed, some of the win32api function lik win32api.SetCursorPos will run into exception, is there any solution?

@vasily-v-ryabov
Copy link
Contributor

Hi @mineralres, it's a common problem for all GUI automation libraries. There are 3 workarounds.

  • Run RDP in window mode (not full screen), do not minimize it, run pywinauto script and quickly switch to a local machine window.
  • Use VNC server connection (say TightVNC) and do not use RDP (need to reboot remote machine if RDP used). This approach allows safe disconnect (active desktop is still alive on remote machine even if you shutdown your laptop). For automated GUI testing schedule it's usually convenient to set up auto-logon additionally (but not strictly necessary).
  • Do not use TypeKeys, ClickInput and derived functions which require active desktop. Other methods just send window messages that work without active desktop and often for a minimized window. See this thread for example.

Also note that running local CI service (like Jenkins) as a Windows service will not work, you have to use it as usual process, not a daemon.

@mineralres
Copy link
Author

thanks a lot! i got it.

@vasily-v-ryabov
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants