TweetFollow Us on Twitter

Automate your testing... with Eggplant

Volume Number: 19 (2003)
Issue Number: 9
Column Tag: Software Testing

Automate your testing... with Eggplant

Exploring a new tool for performing automatic tests

by Dave Kelly

Test Automation on the Mac - A Brief Overview

Your code has bugs in it. What? So, you don't like hearing that, eh? But it's not your fault. All software has bugs. Finding all the bugs in your software is a big job so you need all the help you can get, right?

Bug finding is an art that complements code writing. Somewhere along the way someone (probably an overworked quality engineer) figured out that time and effort could be saved by using automated testing. There are several automation tools available for testing Windows software including software from Rational, Mercury Interactive, Segue Software, and others. But, until recently there was nothing that come close for Mac OS X. In Mac OS X, the tester has had to rely only on AppleScript or Perl for test automation. It doesn't take too long to realize that although they are very powerful tools, neither AppleScript nor Perl are adequate for testing some things. GUIs and functionality that can only be accessed through the software being tested to name a few. Even the new GUI Scripting (System Events) beta software (see http://www.apple.com/applescript/GUI/) does not allow the GUI of some software to be tested. We're now going to take a look at Redstone Software's Eggplant software for testing Mac OS X software.

Redstone Software, Inc. is a subsidiary of Gresham Computing plc, which is based in Southampton, UK. Gresham Computing (GHT) is traded on the London Stock Exchange. In late 2001, Gresham Computing started work on a new product internally named Operation Screaming Eggplant. Their goal was to deliver a product with high ease-of-use for the neophyte yet still offer powerful capabilities for the experienced tester. The Mac OS X platform was chosen as the base OS for this product for two major reasons. First, they wanted to establish the product before competing in the PC marketplace where competition is much more fierce. Second, they believed that Mac OS X had the right features and extensibility to support the enterprise market.

Redstone Software, Inc. was created in early 2002 and in October of 2002 became the first company to deliver a cross-platform automation tool to the Mac OS X platform. They stuck with the code name and named their product Eggplant. Their belief is that automation products of this kind are traditionally too complex and require specialized development skills that are rarely found in testers. In addition, they also believe that very few automation projects have been successful, although there are cases where automation has worked. In these cases automation is performed for tests requiring special or repetitive computations, such as acceptance tests, where test execution and results are predictable.

It might be interesting to note that Redstone Software uses eXtreme Programming (XP). This is very apparent by their willingness to listen to and support their customers. Through this intense support of their customer's needs, they released several versions of Eggplant--the most recent on being version 1.3 in May 2003. The remainder of this article will focus on Eggplant v1.3.

The Eggplant software runs on your host Macintosh. This is the computer that controls the test. The software you are testing runs on a separate computer called the "System-Under-Test" (SUT). The SUT runs Virtual Network Computer (VNC) server software. VNC is a remote display system that allows you to view the desktop of the "server" computer on another computer anywhere on the Internet. The VNC server software could be running on another Macintosh or it could be running on a Unix or Windows computer. Eggplant is able to connect to the SUT using the VNC server software.

VNC originated from AT&T Laboratories Cambridge's development of very-thin-client ATM network computers called the Videotile (see http://www.uk.research.att.com/tile.html). The VNC viewer and server are basically software-only versions of this ATM Network Computer. VNC is free and is distributed under the terms of the GNU Public License. Eggplant incorporates VNC client software to give it full access to the SUT GUI, keyboard, and mouse using any VNC server. Any VNC client "viewer" can display the desktop of any VNC server; however, to use Eggplant you'll have to use the client that is part of Eggplant itself. VNC clients are available for every major OS including: Mac OS 9, OS X, windows 95/98/ME/2000/XP, UNIX (AIX, Solaris, HPUX), and LINUX (see http://www.uk.research.att.com/vnc/). The Redstone VNC server, OSXvnc 1.2 (see http://www.redstonesoftware.com/osxvnc/) is recommended for use with Eggplant because of fixes made that improve performance and increase stability.

The setup for running Eggplant consists of just starting up the 496KB OSXvnc application and starting the server by clicking the "Start Server" button (see figure 1). The OSXvnc application will need to remain running or the connection will be broken. You'll also want to hide the OSXvnc application before running your test.


Figure 1. OSXvnc Interface

Although the real testing happens on the SUT, the host Macintosh is where the action is. When you open Eggplant the first thing you'll want to do is connect to the SUT, if anything else just so you can see how it works. After entering your license you'll see a window that prompts you to establish a connection with a VNC server. You can connect with the IP address, port and password of the SUT. It is also possible to connect using IP over Firewire or through an SSH connection.


Figure 2. Eggplant connection window

Once the connection is established, you see the Eggplant monitor and can control the SUT. The live remote screen in Figure 3 shows the desktop of the SUT.


Figure 3. Eggplant Remote Screen viewer

At this point, the VNC viewer can only control the remote SUT and capture images. That might be useful for some things but you'll need to create a script in order to begin writing a test. You start by creating a suite. When a new suite is created, Eggplant creates a directory structure to store the scripts, images, and log files pertaining to that suite. The suite window in figure 4 is used to access all of the features of the suite.


Figure 4. Eggplant suite window

Now for the heart and soul of the Eggplant... capturing an image. Once you open a new script you're ready to start capturing. Building test scripts is dependent on being able to capture images through the viewer window. Without capturing images, there isn't much that you can do.

The viewer has two modes, Capture Mode and Live Mode. Eggplant starts out in live mode where you can see and control whatever goes on with the SUT. By selecting "Enter Capture Mode", you are able to select a rectangular section of the SUT's screen through the Eggplant viewer, along with a hot spot, represented by a red crosshair (see figure 5). The hot spot represents the point that will be clicked when the script is run. The rectangular section is the area that will be captured as a snapshot. After selecting the image and setting the crosshair to the point you want to click, you can choose between standard commands that will move the mouse and click or type text on the SUT's screen. The standard commands that can be used are Click, DoubleClick, MoveTo, Drag, Add Image, Wait, WaitFor, TypeText and TypeCommand. These pretty much cover anything you will need to do to test your software.


Figure 5. icon selected and ready to capture

After selecting your image, setting the click point, and selecting a command (example "DoubleClick"), Eggplant will add the image to the suite's set of images and add the command to the script. For this example, this line would be added to the current script window:

DoubleClick "image0001"

Meanwhile, the image is added to the suite's images as in figure 6.


Figure 6. suite images

After capturing a sequence of images/commands, you can go back and establish your initial setup conditions and run the script (or select a portion of the script to run). The viewer screen is compared to the saved image for each command and if it finds a match, the command is executed. If it fails, the failure is stored in the suite's Results log. A log is stored for each time you run the script. During execution you can also log your own results from the script.

It should be apparent that the key is having the saved image match the captured image when the script runs. Eggplant does a great job of finding the correct image on the SUT's screen, but there are certain circumstances you must be aware of. For example, if the desktop background looks like a solid background, but isn't really a solid background, then the image won't be found if it is not exactly where it was when the saved image was captured. The solution then is to make sure that the captured images are over a real "solid" background. Also, it is helpful to only capture the minimum that is required to identify the image being compared. For example, it may only be necessary to capture the text of an image, or maybe just the center portion of the image. It only needs to be enough to be identified as a unique image.

Eggplant is very forgiving when matching captured images. When images are captured, Eggplant attempts to automatically detect the right setting for color matching. In most cases it defaults to "Tolerant" which means that it will allow small variations in the color to be accepted. The "Precise" setting will look for a more exact match in the colors. Then there is the special "Pulsing" setting that allows color matching even when the color is a pulsing Mac OS X Aqua button. It's a good thing they included these color matching options so images, such as pulsing buttons, could be matched.

In Search of the "right" Automatic testing tool

It will help if you know what you're looking for in an automatic testing tool. Regrettably, there isn't much available for Mac OS X to compare with when looking for automation tools. It would still be worthwhile to know what you want the test environment to provide and what you're going to have to add to it to make it work for you. The following is a short list of "stuff" to look for in test automation software and comments about how well Eggplant does in each of the areas listed.

  • Will the test tool interfere with the software under test? The VNC server on the SUT is not very intrusive so you'll hardly even know it's there. You'll have to know your system under test well enough to know if a VNC server would have a material impact on it.

    Eggplant relies on an IP connection. If your software makes changes to network settings Eggplant's connection with the SUT could be broken. This behavior needs to be taken into account when writing scripts.

  • Can the test be controlled by scripts? Eggplant has a built in test script language called SenseTalk. SenseTalk is a HyperTalk-like language. The language is quite powerful so you should be able to do many of the things you need to do.

    The script is run on the host Macintosh (not the SUT) so all of the local commands refer to the host. For example, you can read/write to a local disk file (you might do this to record some test results or get data for a test from a file), but the file must be available to the host computer. If you need access to the SUT's files, there is an approach that may be acceptable. The workaround is to turn on file sharing on the SUT and mount the SUT's disk on the host computer.

  • Can scripts be captured or do I have to modify scripts after capturing them to make them work? Since images are an integral part of the commands it is necessary to capture the images that will be compared. You cannot just start typing without also capturing an image. Some automation tools will claim that all you have to do is capture your script and then run it and you're all set. Eggplant is really very different because you are not capturing your script as much as you are capturing images that the script will use. Even with Eggplant scripts don't write themselves (it is wishful thinking when any company claims their tools will write the scripts for you). With Eggplant, the process of writing the scripts includes creating the images that will be used to compare against when the script runs. Fortunately, this process makes it very easy to get the script up and running.

    Redstone Software makes the claims "Manual test-oriented commands allow the non-programmer to quickly create scripts. Eggplant also offers the flexible and robust SenseTalk scripting language and the ability to test multiple applications and platforms", "Eggplant interactive script development simplifies test automation" and SenseTalk scripting language provides high ease of use and powerful capabilities". Unlike other automatic software test applications, they make no claims that the script can be captured and run without modification. There will be a certain amount of script writing to get your tests up and running, but as they claim, Eggplant simplifies script development.

  • Can scripts be reused? Test scripts can call other test scripts. In this sense, "libraries" of scripts can be written to be used over and over. In addition, scripts belonging to other suites can be called by specifying them in the Helper Suites list.

  • Can scripts be scheduled to run at a certain time? The scheduler can setup a selected batch of scripts so that they will run on specific SUTs, but you are not able to set up a specific time for a script to run. You could set up a script that checked the time before it did anything though. Redstone recommends use of the cron function to schedule tests. The batch of scripts can also be "scheduled" to repeat however many times you specify.

  • Can scripts be easily printed/documented? Yes, scripts can be printed. However, images cannot be printed from the Eggplant application. The images are stored with the suite as .tiff files, and those can easily be printed if necessary. Additionally, scripts can contain comments to further document what is being done.

  • Is there a test infrastructure in place? Not completely. The test suite environment of Eggplant includes a script editor, image list (showing images included in the suite), results list, script scheduler, and Helper Suites list. Eggplant could be improved to include a better debugging environment, the ability to link test requirements to tests being run, and an expanded capability to keep track of test results.

  • Is there a mechanism in place to keep track of test status? The Results tab is actually a very nice system for keeping track of test status. Building a test logging mechanism can be a very time consuming task. Fortunately, with Eggplant you don't need to build anything, and the logging is built right into the script language. Unfortunately, there isn't a way to print the results from within the Eggplant application. But, fortunately, the file is stored as a plain text log file that can be easily printed.

  • Is there an extra cost per user? Can multiple tests be run concurrently? If you want to run multiple test streams against different SUTs at the same time, then that requires multiple licenses. The current pricing scheme for multiple licenses on a single host is as follows. The base license allows execution of one Eggplant test stream for $3400. A second test stream costs $1,700 and the third test stream adds $850. For $5,950, one system can execute three different Eggplant test streams.

    Four or more concurrent stream licenses are $425 each. A lower end Mac can easily handle three streams; higher end Macs can of course run more. What many users do is to use one Mac as an Eggplant execution system and have licenses on other machines for script development.

    The Eggplant pricing is based on the number of test streams being run with no additional charge for the number, location, or type of systems-under-test.

  • Is there any debugging capability built-in? Although there is no ability to add breakpoints, any portion of a script can be run at any time by selecting it and clicking on "Run Selection" in the script editor window.

Summary

Eggplant is a fine application. The really cool thing about it is that it can run tests on multiple platforms (all you need is the VNC server for the SUT you're testing on). Please don't think that Eggplant is for software testing only. Developers can automate the build process. System Administrators using Eggplant can automate server maintenance. Any repetitive task is a candidate for automation. This is the first really usable automatic software tool that has been available for Mac OS X. It is very depressing to hear other companies tell you "Sorry, we don't support the Mac". Well, this changes everything because now there's a tool that works with Mac OS X.

Bibliography and References

Kelly, Dave. "Software Automation and the Product Life Cycle". MacTech Magazine (formerly MacTutor) 13:10.

Cem Kaner, Jack Falk, Hung Quoc Nguyen. "Testing Computer Software". 2nd edn. New York 1999.


Dave Kelly is currently a Software Quality Engineer at EarthLink and has many years of software testing experience at EarthLink, Hewlett Packard, Symantec and Xerox. He has worked and played with the Macintosh since 1984 and was one of the founding editorial board members of MacTutor Magazine (now MacTech Magazine). You can reach him at dkelly@earthlink.net.

 
AAPL
$105.22
Apple Inc.
+0.39
MSFT
$46.13
Microsoft Corpora
+1.11
GOOG
$539.78
Google Inc.
-4.20

MacTech Search:
Community Search:

Software Updates via MacUpdate

Tonality Pro 1.1.2 - Professional-grade...
Tonality Pro gives you the power to create stunning and dramatic black & white images. This is a complete monochrome image editor with more than 150 one-click style presets, totally unique... Read more
VueScan 9.4.49 - Scanner software with a...
VueScan is a scanning program that works with most high-quality flatbed and film scanners to produce scans that have excellent color fidelity and color balance. VueScan is easy to use, and has... Read more
OS X Server 4.0 - For OS X 10.10 Yosemit...
Designed for OS X and iOS devices, OS X Server makes it easy to share files, schedule meetings, synchronize contacts, develop software, host your own website, publish wikis, configure Mac, iPhone,... Read more
TotalFinder 1.6.12 - Adds tabs, hotkeys,...
TotalFinder is a universally acclaimed navigational companion for your Mac. Enhance your Mac's Finder with features so smart and convenient, you won't believe you ever lived without them. Tab-based... Read more
BusyCal 2.6.3 - Powerful calendar app wi...
BusyCal is an award-winning desktop calendar that combines personal productivity features for individuals with powerful calendar sharing capabilities for families and workgroups. BusyCal's unique... Read more
calibre 2.7 - Complete e-library managem...
Calibre is a complete e-book library manager. Organize your collection, convert your books to multiple formats, and sync with all of your devices. Let Calibre be your multi-tasking digital... Read more
Skitch 2.7.3 - Take screenshots, annotat...
With Skitch, taking, annotating, and sharing screenshots or images is as fun as it is simple.Communicate and collaborate with images using Skitch and its intuitive, engaging drawing and annotating... Read more
Delicious Library 3.3.2 - Import, browse...
Delicious Library allows you to import, browse, and share all your books, movies, music, and video games with Delicious Library. Run your very own library from your home or office using our... Read more
Art Text 2.4.8 - Create high quality hea...
Art Text is an OS X application for creating high quality textual graphics, headings, logos, icons, Web site elements, and buttons. Thanks to multi-layer support, creating complex graphics is no... Read more
Live Interior 3D Pro 2.9.6 - Powerful an...
Live Interior 3D Pro is a powerful yet very intuitive interior designing application. View Video Tutorials It has every feature of Live Interior 3D Standard, plus some exclusive ones: Create multi... Read more

Latest Forum Discussions

See All

Rami Ismail Opens Up distribute​() for D...
Rami Ismail Opens Up distribute​() for Developers Posted by Jessica Fisher on October 24th, 2014 [ permalink ] Rami Ismail, Chief Executive of Business and Development at indie game studio | Read more »
Great Hitman GO Goes on Sale and Gets Ne...
Great Hitman GO Goes on Sale and Gets New Update – Say That Three Times Fast Posted by Jessica Fisher on October 24th, 2014 [ permalink ] | Read more »
Rival Stars Basketball Review
Rival Stars Basketball Review By Jennifer Allen on October 24th, 2014 Our Rating: :: RESTRICTIVE BUT FUNUniversal App - Designed for iPhone and iPad Rival Stars Basketball is a fun mixture of basketball and card collecting but its... | Read more »
Rubicon Development Makes Over a Dozen o...
Rubicon Development Makes Over a Dozen of Their Games Free For This Weekend Only Posted by Jessica Fisher on October 24th, 2014 [ permalink ] | Read more »
I Am Dolphin Review
I Am Dolphin Review By Jennifer Allen on October 24th, 2014 Our Rating: :: NEARLY FIN-TASTICUniversal App - Designed for iPhone and iPad Swim around and eat nearly everything that moves in I Am Dolphin, a fun Ecco-ish kind of game... | Read more »
nPlayer looks to be the ultimate choice...
Developed by Newin Inc, nPlayer may seem like your standard video player – but is aiming to be the best in its field by providing high quality video play performance and support for a huge number of video formats and codecs. User reviews include... | Read more »
Fighting Fantasy: Caverns of the Snow Wi...
Fighting Fantasy: Caverns of the Snow Witch Review By Jennifer Allen on October 24th, 2014 Our Rating: :: CLASSY STORYTELLINGUniversal App - Designed for iPhone and iPad Fighting Fantasy: Caverns of the Snow Witch is a sterling... | Read more »
A Few Days Left (Games)
A Few Days Left 1.01 Device: iOS Universal Category: Games Price: $3.99, Version: 1.01 (iTunes) Description: Screenshots are in compliance to App Store's 4+ age rating! Please see App Preview for real game play! **Important: Make... | Read more »
Toca Boo (Education)
Toca Boo 1.0.2 Device: iOS Universal Category: Education Price: $2.99, Version: 1.0.2 (iTunes) Description: BOO! Did I scare you!? My name is Bonnie and my family loves to spook! Do you want to scare them back? Follow me and I'll... | Read more »
Intuon (Games)
Intuon 1.1 Device: iOS Universal Category: Games Price: $.99, Version: 1.1 (iTunes) Description: Join the battle with your intuition in a new hardcore game Intuon! How well do you trust your intuition? Can you find a needle in a... | Read more »

Price Scanner via MacPrices.net

Weekend sale: 13-inch 128GB MacBook Air for $...
Best Buy has the 2014 13-inch 1.4GHz 128GB MacBook Air on sale for $849.99, or $150 off MSRP, on their online store. Choose free home shipping or free local store pickup (if available). Price valid... Read more
Nimbus Note Cross=Platform Notes Utility
Nimbus Note will make sure you never forget or lose your valuable data again. Create and edit notes, save web pages, screenshots and any other type of data – and share it all with your friends and... Read more
NewerTech’s Snuglet Makes MagSafe 2 Power Con...
NewerTech has introduced the Snuglet, a precision-manufactured ring designed to sit inside your MagSafe 2 connector port, providing a more snug fit to prevent your power cable from unintentional... Read more
Apple Planning To Sacrifice Gross Margins To...
Digitimes Research’s Jim Hsiao says its analysts believe Apple is planning to sacrifice its gross margins to save its tablet business, which has recently fallen into decline. They project that Apple’... Read more
Who’s On Now? – First Instant-Connect Search...
It’s nighttime and your car has broken down on the side of the highway. You need a tow truck right away, so you open an app on your iPhone, search for the closest tow truck and send an instant... Read more
13-inch 2.5GHz MacBook Pro on sale for $949,...
Best Buy has the 13″ 2.5GHz MacBook Pro available for $949.99 on their online store. Choose free shipping or free instant local store pickup (if available). Their price is $150 off MSRP. Price is... Read more
Save up to $125 on Retina MacBook Pros
B&H Photo has the new 2014 13″ and 15″ Retina MacBook Pros on sale for up to $125 off MSRP. Shipping is free, and B&H charges NY sales tax only. They’ll also include free copies of Parallels... Read more
Apple refurbished Time Capsules available sta...
The Apple Store has certified refurbished Time Capsules available for up to $60 off MSRP. Apple’s one-year warranty is included with each Time Capsule, and shipping is free: - 2TB Time Capsule: $255... Read more
Textilus New Word, Notes and PDF Processor fo...
Textilus is new word-crunching, notes, and PDF processor designed exclusively for the iPad. I haven’t had time to thoroughly check it out yet, but it looks great and early reviews are positive.... Read more
WD My Passport Pro Bus-Powered Thunderbolt RA...
WD’s My Passport Pro RAID solution is powered by an integrated Thunderbolt cable for true portability and speeds as high as 233 MB/s. HighlightsOverviewSpecifications Transfer, Back Up And Edit In... Read more

Jobs Board

*Apple* Solutions Consultant - Apple Inc. (U...
…important role that the ASC serves is that of providing an excellent Apple Customer Experience. Responsibilities include: * Promoting Apple products and solutions Read more
Senior Event Manager, *Apple* Retail Market...
…This senior level position is responsible for leading and imagining the Apple Retail Team's global event strategy. Delivering an overarching brand story; in-store, Read more
*Apple* Solutions Consultant (ASC) - Apple (...
**Job Summary** The ASC is an Apple employee who serves as an Apple brand ambassador and influencer in a Reseller's store. The ASC's role is to grow Apple Read more
Project Manager / Business Analyst, WW *Appl...
…a senior project manager / business analyst to work within our Worldwide Apple Fulfillment Operations and the Business Process Re-engineering team. This role will work Read more
*Apple* Retail - Multiple Positions (US) - A...
Job Description: Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.