Abbot
From AbbotWiki
| Table of contents |
note
When you login to the wiki, check the box to "Remember my password across sessions": it improve your wiki-browsing experience.
overview
The Abbot (http://sourceforge.net/projects/abbot) SourceForge project is primarily not one thing, it's at least two, depending on how you look at it. At the highest level, it's
- API for automating Java GUIs:
- finding "thingies" (JComponents or Widgets, depending on your tribe) in a runtime UI
- testing thingies (to see if they're in a given state)
- "driving" thingies: clicking, dragging, focusing, or typing a found thingy, "just like a user"
- Costello: record/edit/playback XML scripts using Abbot.
Another way to look at Abbot is as a set of projects in SVN repository (http://sourceforge.net/svn/?group_id=50939):
- abbot (http://svn.sourceforge.net/abbot/abbot/) is the oldest and most-developed of the projects. It contains all the AWT/Swing support, both Abbot and Costello, which makes it kinda monolithic. It is also IDE-agnostic: this is good, in that it can be run from Ant or your favorite text editor, but not great for IDE users. Fortunately we have done some work to document how to create an Eclipse plugin from a checkout of project=abbot (via a target in its build.xml), and we also release binary plugin zips. Users of other IDEs are encouraged to do likewise!
- The other projects in CVS target SWT and related toolkits, and are Eclipse plugins "out of the box":
- abbot.swt (http://svn.sourceforge.net/abbot/abbot.swt/trunk/abbot.swt/) contains only what should be needed to support the API for SWT. But ...
- SWT (http://eclipse.org/swt/) has a hole in its API (https://bugs.eclipse.org/bugs/show_bug.cgi?id=38436). They've "agreed" to fix this, but haven't said when (though their 3.1 Development Plan (http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-swt-home/R3_1/plan.html#Overall_Plan) says they will "investigate" in 3.0 M4 (targetted for 17 Dec 2004). so, to continue to progress, we patch SWT 3.0 in project=org.eclipse.swt (http://cvs.sourceforge.net/viewcvs.py/org.eclipse.swt/) as describe in this post (http://sourceforge.net/mailarchive/message.php?msg_id=9665074)
- abbot.swt.gef (http://svn.sourceforge.net/abbot/abbot.swt/trunk/abbot.swt.gef) provides higher-level API to ease the writing of testcases targeting GEF (http://eclipse.org/gef/) UIs. Note that GEF, like JFace (http://www.cs.umanitoba.ca/~eclipse/11-JFace.pdf) is "SWT under the hood": being able to drive SWT means we automatically are able to drive GEF and JFace, but at a low (thus more painful) level. Part of what Abbot hopes to do is to make it easy to write testcases, so we will try to provide API to shield users from gorp.
- abbot.swt.hierarchy (http://svn.sourceforge.net/abbot/abbot.swt/trunk/abbot.swt.hierarchy) is a small, even primitive plugin, but it lets you inspect a runtime SWT hierarchy, which is useful for writing testcases and debugging them. It needs to be made a view, like Costello's hierarchy browser.
- costello.swt (http://svn.sourceforge.net/abbot/abbot.swt/trunk/costello.swt) contains (incomplete, unfinished ... IT DON'T WORK YET) extensions to provide SWT support to Costello.
installation
Abbot can be installed several ways, so first ask yourself, "what do I want to do with it?"
to work with a standalone AWT/Swing UI
If you only want to use Abbot to test a standalone AWT/Swing UI, you don't even need an IDE, and the easiest thing to do is just Java Web Start it: see the Abbot homepage (http://abbot.sourceforge.net/) for details.
Help! I can't run Costello from the Java Web Start link because the jars are unsigned! Details
to work from Eclipse with a standalone SWT UI
- install eclipse. For now we'll assume you know how to do this :-) but see IMPORTANT note on SWT and Eclipse
- install abbot.* eclipse plugins
- run the standalone abbot.swt API demo with Eclipse's JUnit tooling
to work from Eclipse with a workbench plugin
- install eclipse. For now we'll assume you know how to do this :-) but see IMPORTANT note on SWT and Eclipse
- install abbot.* eclipse plugins
- run the standalone abbot.swt API demo with Eclipse's JUnit tooling
- run your tests using Test Collector (IBM-only)
- run your tests using PDE JUnit
tips, tricks, tutorials
- fixing build problems
- working with SWT wizards
- coping with SWT threading
- creating a custom Matcher
- OutOfMemoryError's
- HOWTO administer bug reports
- passing arguments from a Costello script
- SWT Spy
- automating and managing test execution
- ant-running tests
- "Testing GUIs with Abbot and Costello" (http://www.cafeaulait.org/slides/sdbestpractices2005/guitesting/): Elliotte Harold's talk @ Software Development Best Practices 2005 (as a single file (http://www.cafeaulait.org/slides/sdbestpractices2005/guitesting/Testing_GUIs_with_Abbot_and_Costello.html))
![[Main Page]](/wiki/stylesheets/images/wiki.png)