Kieran France Kieran France is a programmer for IDRSolutions. He enjoys tinkering with most things including gadgets, code and electronics. He spends his time working on the the JPedal library and our internal test suite..

Fest For Beginners – Initial Concepts

1 min read

What is Fest

Recently I have improved the highlighting of PDF files in our Java PDF viewer. With this  improvement I have had to find a way to test the highlights and any future improvements we make to the highlights.

For this reason I have started using a test library called Fest. Fest is a set of APIs that can be used to test java applications which include api to simulate user input and interaction with a user interface. In other words instead of me testing a series of files, performing the same actions on each file, by hand, everytime we want to make a build I can have a computer do it for me.

One of the major advantages I found of performing tests in this way is that calling various function calls from a test running at a lower level than the user can interact is completely ignoring a section of code that may be including other methods or variables that aren’t called at the lower level. By testing using fest we can compare output across a known working version to ensure everything works correctly for the end user without having to dedicate a team members time to sitting there and working through the same test for hours.

Have you convinced you that Fest is very useful for regression testing?

First steps with Fest

In order for the way I have set up Fest to work you will need to have set unique names set to each gui component that you will be using.

Once you have code that will set up and open your application you need to create a BasicRobot object and a FrameFixture object. This can be done as follows.

BasicRobot robotf = (BasicRobot)BasicRobot.robotWithCurrentAwtHierarchy();
//mainFrame is the name of a frame component.
FrameFixture frame = WindowFinder.findFrame("mainFrame").
withTimeout(5000).using(robotf);

Now you have these two object you will be able to simulate user input using FrameFixture. In order to have Fest trigger events as a user would we can call methods named after the various user interface types such as button, checkBox, scrollPane, radioButton…
These methods take a string value that should be the unique name of the component you wish to trigger. This will return a fixture that can interact with the user interface as the user would using methods like click.
frame.button(“openButton”).click();

These are the initial concepts that you need to keep in mind if you wish to use Fest for your own tests. If you wish to try Fest yourself it can be found at http://fest.easytesting.org/

I’ll be covering it in more detail in my coming articles.

IDRsolutions develop a Java PDF Viewer and SDK, an Adobe forms to HTML5 forms converter, a PDF to HTML5 converter and a Java ImageIO replacement. On the blog our team post anything interesting they learn about.

Kieran France Kieran France is a programmer for IDRSolutions. He enjoys tinkering with most things including gadgets, code and electronics. He spends his time working on the the JPedal library and our internal test suite..

One Reply to “Fest For Beginners – Initial Concepts”

  1. What I really like about being able to name the components is that it works if you change platform or look and feel. Tools which use co-ordinates to show where to click all break in this case.

Leave a Reply

Your email address will not be published. Required fields are marked *