-->

pywinauto can it be made cross platform

2019-07-22 07:20发布

问题:

My Python application has windows is client and server as Linux. My aim is to automate windows GUI application with pywinauto from Linux server.

Can pywinauto be made cross platform?

回答1:

It's not possible using pywinauto immediately. But you may copy pywinauto script to the target Windows machine and run it remotely using Jenkins, for example. Or any other CI server. Master node can be on Linux. So Windows node can run as a slave. But there are several requirements for the Windows slave (this check list is based on my recent experience).

  • Windows slave can be set up with auto logon.
  • VNC server software (TightVNC or UltraVNC, for example) should be installed.
  • Video card drivers should be up-to-date for better screen resolution (and for black screen prevention).
  • Jenkins slave process must run as not a service (i.e. in the existing desktop, so Jenkins task would have an access to the GUI). Just do NOT click menu "Run as a service" in JNLP agent window.
  • Do not use Remote Desktop connection from another Windows machines (reboot may be required to restore GUI session with VNC client/server pair).
  • Of course, Python+pywinauto must be installed on Windows node. Just in case.
  • If UAC is enabled on Windows node, in some cases it should be disabled (if you have to deal with admin access like GUI installers do).

On Linux you need to set up the VNC client and Jenkins. For other CI servers steps may be similar but with some differences.