Skip to main content

test automation for java UI applications from python

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyjt-0.6.0.tar.gz (12.0 kB view hashes)

Uploaded Source

Built Distribution

pyjt-0.6.0-py3-none-any.whl (12.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page