Skip to main content

pyjt - test java UI applications from python

pyjt supports you testing java UI applications from python.

Features:

  • Thread safe call of java ui components
  • Advanced locators to find ui compoments within the component tree
  • Simulate real user interactions by mouse and keyboard

This library makes use of jpype as the interface to the java virtual machine. It basicaly consists of helper functions to control the application from a test automation perspective.

Quickstart

  • Install pyjt

    pip3 install pyjt
    
  • Start testing your app

    import pyjt
    
    pyjt.start()
    
    from javax.swing import JButton
    
    # start your java application here, in this case, we start
    # a hello world application located in HelloWorld.java
    pyjt.start(classpath="myapp/")
    pyjt.run("HelloWorld")
    
    # find the frame window titled "Hello World"
    frame = pyjt.FrameFinder.find(title="Hello World")
    
    # Locate and click a button on the frame
    frame.locate(JButton, text="Ok").click()
    
    # Locate and fill text to an text field
    frame.find_by_xpath('//JTextField[@name="textfield1"]').fill("John Smith")
    
    # Close the frame (application)
    frame.close()
    

Further documentation

Check the documentation on rtfd.io

Release files for pyjt 0.6.0

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

Source distribution (sdist)

Source distribution for pyjt 0.6.0
File Size Uploaded
pyjt-0.6.0.tar.gz 12.0 kB Details

Built distribution (wheel)

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

Total release size: 24.5 kB

Release files / pyjt-0.6.0.tar.gz

Download URL pyjt-0.6.0.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
988d6b173a843702281e4988f6e2cb3ee96a8a05ebfa9e557c64fabbf78a5aa2
BLAKE2b-256 checksum
How to use checksums
b8effe177db65e3242e95d5d6fb3f6914cb14eb2cdce3b97a13bada6786af508
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / pyjt-0.6.0-py3-none-any.whl

Download URL pyjt-0.6.0-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e775a6ae509df649a16e753bd045350541cb41c97fa970ca39c3747d98209f79
BLAKE2b-256 checksum
How to use checksums
e02f132ed5ef8913fc02817422dbc03693f1b3122caa1a4269c024707c382489
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.4
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