Louis Caron
Louis Caron

Reputation: 1350

Porting a pywinauto script from Windows to X11/Xlib

In my organization, I have been using pywinauto to automate some UI procedures that could not be done using the sole command line interface.

In an effort to move away from windows, I am evaluating the effort to port the UI automation script to a Linux environment (our tool has a Linux version, including a similar GUI).

I have had a look at the python-xlib project. But I have the feeling that it is more a framework to develop native X11 applications rather than perform tests on an existing application (I could not find anything like find_window etc...).

Do you have any advice for an X11 framework to automate UI procedures?

Upvotes: 1

Views: 372

Answers (1)

Louis Caron
Louis Caron

Reputation: 1350

Based on several inputs, I finally came up with the following suggestions:

  • use pywinauto which has some beta level of Linux support (this support is based on pyatspi2).
  • use directly pyatspi2 to interact with the widgets if they are exposed. To browse through the exposed widgets of the application you want to automate, you can use accerciser.
  • finally, many framework exist to use only click + keys + mouse locations and are based on image comparison. There are many around, I have not yet tested any of them.

Finally, since my script is meant to run in a docker environment in CI, I installed Xvfb to run the automation in headless mode, without graphics HW.

Upvotes: 2

Related Questions