pianola: Remotely controlling Java Swing applications

[ deprecated, gui, jvm, library, mit ] [ Propose Tags ]

This is a library for remotely controlling Java Swing desktop applications that have been instrumented with a special pianola agent. The agent exposes the Swing component hierarchy over the network, and accepts requests for generating GUI events. The library handles the interaction on the Haskell side.

[Skip to Readme]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS] 0.1.0, 0.1.1
Dependencies attoparsec (>=0.10), attoparsec-iteratee (>=0.3), base (>=4.4 && <5), bytestring (>=0.9), comonad (>=3.0), comonad-transformers (>=3.0), containers (>=0.4), either (>=3.4), errors (>=1.3), filepath (>=1.3), free (>=3.2), iteratee (>=0.8), logict (>=0.5), msgpack (>=0.7), mtl (>=2.1), network (>=2.4), pipes (>=4.0), streams (>=3.1), text (>=0.11), transformers (>=0.2) [details]
License MIT
Author Daniel Díaz Carrete
Maintainer diaz_carrete@yahoo.com
Category Jvm, GUI
Source repo head: git clone https://github.com/danidiaz/pianola.git
Uploaded by DanielDiazCarrete at 2013-09-16T18:50:31Z
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 1832 total (5 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for pianola-0.1.1

[back to package description]

Pianola is a Haskell library that lets you monitor and control Java Swing applications through a network connection. This can be useful for performing automated GUI testing.

To work with the library, the Application Under Test (AUT) must have been instrumented with a Java-side Pianola agent. For instructions on how to compile an set up the agent, check the README file in the backends/java-swing folder.

A Java Swing example application is included in the backends/java-swing-testapp folder.

For instructions on how to use the library, check out the Haddock documentation for the Pianola.Tutorial package.

The tests folder contains automated tests for the library. For the tests to work, the Java example application must be up and running.

The examples folder contains scripts for interacting with popular Java Swing applications (only DbVisualizer at the moment). Check out the corresponding README for instructions on how to set up the Pianola agent for these applications.

Pianola offers some of the functionality of tools like Marathon, although it doesn't have any recording capabilities. The scripts must be written by hand. Also, unlike Marathon, Pianola doesn't concern itself with launching the AUT, which must be started through other means.


  • I dislike the "recording" approach taken by many GUI test automation frameworks for developing tests scripts. In any minimally complex test case, you will have to refactor the script aggresively anyway, to remove duplication and increase modularity. I prefer to program the scripts in an incremental manner, ideally with the help of a good REPL.

  • Sometimes, it can become inconvenient if the test framework needs to control the launch of the AUT, instead of having it started by other means.

  • Pianola doesn't require the client and the AUT to reside in the same machine.

  • I'm partial to statically typed languages. I find very annoying when a long-running script developed in a dynamically typed language fails midway due to a dumb error like the misspelling of a variable's name. I realize that this inconvenience is solved through unit testing, but when then things you are developing are themselves test scripts, isn't it a bit of overkill to have tests of tests?

  • Related to the previous point: statically typed languages give you more assurances that you don't break anything when refactoring.

  • Haskell is (at least in theory) good at handling tree-like structures, like the containment hierarchy of the components in a GUI.

  • Haskell's higher-order functions should (at least in theory) give more flexibility when locating individual components. For example, identifying a component depending on an arbitrary predicate applied to its text.

  • Marathon is a versatile tool that can handle many corner cases when testing Swing GUIs. Still, there are annoyances. There isn't (to my knowledge) an easy way to identify a component by its text in other manner than by total equality.

  • Marathon annoyance #2: There isn't (to my knowledge) an easy way to handle components which may or may not appear during a test's execution. For example, a warning dialog which appears only occasionally. There doesn't seem to be a "find component, if it exists" operation.

  • Marathon annoyance #3: There isn't (to my knowledge) a way to make Marathon scripts fail quickly when they can't find a component in the GUI. Sometimes they block for a surprisingly long time before failing!