Skip to main content

pyUIauto

PyPi version PyPi license PyPI pyversions

Python UI Automation library, for cross-platform applications, interfacing through the accessibility API.

Description

This library / framework takes two popular UI automation libraries and combines their functionality by wrapping them into custom components and creating methods that function in similar ways for both OS. This project was originally designed as part of a QA automation project to perform end-to-end testing on desktop applications.

⤴️: Open source: This project is open source and welcomes any pull requests and further improvements!

Getting Started

Dependencies

Python Packages:

  • pywinauto (Windows / Linux)
  • atomacos (MacOS)
  • pyautogui

OS Compatibility:

  • Windows
  • MacOS

( Currently untested on Linux )

Example

# Import the tools needed
from platform import system
import os
from pyuiauto.application import UIApplication
from pyuiauto.components import UIButton

# Finding the path location of the application
app_paths = {
  "Darwin": "/Applications/Visual Studio Code.app",
  "Windows": os.path.expanduser('~') + "\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe"
}

if system() in app_paths:
  appPath = app_paths[system()]
else:
  raise NotImplementedError("The current OS is not currently supported: " + system())

# Setting up an application template, launching the app, and connecting to it
app = UIApplication(appName = "Visual Studio Code", appPath = appPath)
app.launchApp()
app.connectApp()

# Finding the window component and searching for elements within this window component
main_window = app.window(title = "Visual Studio Code", timeout = 2)
main_window.findR(title = "Toggle Primary Side Bar (Ctrl+B)", control_type = UIButton).press() '''  press will invoke a button without manually moving the mouse and clicking it 
                                                                                          (a button could be invoked even if it isn't currently visible)  '''
main_window.findR(title = "Open Folder", control_type = UIButton).click() ''' however, click will move the mouse to the button location and click it
                                                                    (sometimes this can be more reliable) '''

# Closing the window and terminating the application
main_window.close()
app.terminateApp()

Authors

ex. Harvey Fretwell

ex. pyWinAuto

ex. atomacos

ex. pyAutoGUI

Version History

  • 0.1
    • Initial Release
    • 0.1.1
      • Added UISystemTrayIcon and UIPopupMenu manager
    • 0.1.4
      • Fixed some issues with setValue() method on buttons and menus
    • 0.1.5
      • Added context managers for better popup menu handling
    • 0.1.6
      • Added isOnTop method for components
      • Fixed isVisible method for components
      • Added checks for components existing in helper methods
    • 0.1.7
      • Added MacOS compatibility
      • Fixed getValue method for mac on menu items (with a bit of a work around ... hoping to find a better solution soon)
      • Fixed menu path select and system tray popup select methods on mac
    • 0.1.8
      • Fixed progress bar get value method
      • Added better python intellisense for pylance
      • Added further checks for system tray icon
      • Updated application.py
      • Upgraded package versions
    • 0.1.9
      • Added CheckBox component
    • 0.1.10
      • Added popup button for MacOS
    • 0.1.11
      • Fixed getChildren
      • Fixed popup menu navigation
    • 0.1.12
      • Fixed Windows UIRadioButton getValue

Acknowledgments

Metadata

Release files for pyUIauto 0.1.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyUIauto 0.1.12
File Size Uploaded
pyuiauto-0.1.12.tar.gz 42.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyUIauto 0.1.12
File Interpreter ABI Platform
pyuiauto-0.1.12-py3-none-any.whl Python 3 none any Details

Total release size: 87.2 kB

Release files / pyuiauto-0.1.12.tar.gz

Download URL pyuiauto-0.1.12.tar.gz
Size 42.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5f38f181e46dc8bb3a56191fa67f083d37681440f8efda12a804a7bb3fb0f12e
BLAKE2b-256 checksum
How to use checksums
a133f17dd6495c1956a777385bd70ff09481ba339d7b4df8ef9b58b4876fd794
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.7 Darwin/24.5.0

Release files / pyuiauto-0.1.12-py3-none-any.whl

Download URL pyuiauto-0.1.12-py3-none-any.whl
Size 44.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f095a28dd03481933819f494e0f2c98693db604a673f0f4105270ddf6953ab06
BLAKE2b-256 checksum
How to use checksums
efa50035b57c7c744efafc0cb9cf8c969118712e13d9b67d19598314a8e8955d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.7 Darwin/24.5.0

Release history Release notifications | RSS feed

This release

0.1.12 This release

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page