The Wayback Machine - https://web.archive.org/web/20171207042307/http://oracle.sys-con.com:80/node/37456

Welcome!

Recurring Revenue Authors: Rostyslav Demush, Liz McMillan, Automic Blog, Yeshim Deniz, Carmen Gonzalez

Related Topics: Java IoT, Weblogic, Machine Learning , Recurring Revenue, Log Management

Java IoT: Article

An Introduction to Abbot

A Friendly JUnit Extension for GUI Testing

Graphical user interface (GUI) testing is a potentially problematic area because constructing effective test cases is more difficult than the corresponding application logic. The roadblocks to effective functional GUI testing are:

  • Traditional test coverage criteria like "80% coverage of the lines of code" may not be sufficient to trap all the user interaction scenarios.
  • End users often use a different user task interaction model than the one conceived by the development team.

    Functional GUI testing needs to deal with GUI events as well as the effects of the underlying application logic that results in changes to the data and presentation.

    The common methods for functional GUI testing are the "record and execute" script technique and writing test programs for different scenarios. In the "record and execute," the test designer interacts with the GUI and all the events are recorded in a script. The script can later be replayed to re-create user interactions for a particular scenario. In the test programs, the test designer tries to understand and write tests for the various GUI decision points.

    This article discusses how Abbot can be used to quickly and effectively come up with a comprehensive GUI test framework for Swing GUI applications. Abbot (http://abbot.sourceforge.net/) is a JUnit extension for Swing GUI testing. It provides an interesting framework that can be used for test case generation as well as "record and execute" scripting.

    Introduction to Abbot
    Abbot builds upon the java.awt.Robot class to provide an automated event generation and validation framework for Swing GUI components. The framework can be used to create, record, and execute scripts and programmatic test cases in Java. Abbot also has a script editor called Costello that facilitates the creation of scripts in XML. The framework can also be well integrated to run with JUnit.

    To illustrate the use of Abbot to create a GUI test infrastructure, this article will make use of the following two scenarios.

    1.   GUI already exists: The GUI has been coded and the application needs to be tested, but no unit tests are available. This scenario will primarily make use of the "record and execute" style and then focus on how test suites can be created and run with JUnit.

    2.   GUI has not been coded: The GUI has been designed on paper; however, no working code exists. This scenario will primarily focus on creating test cases in Java. This method will create a homogeneous suite of tests both for the back-end application code and the GUI.

    The two scenarios focus on the end-point cases in functional GUI testing. The principles mentioned can be mixed and matched to suit the needs of the project. To get started with Abbot, download the JAR files and place them in the lib directory of the project.

    Scenario One: GUI Already Exists
    In this scenario, most of the GUI has already been coded. Automated testing is not available and the testing is mainly being done by hand. The goal is to come up with a test suite in the shortest time possible so that the quality metrics for the project can be met effectively.

    The script editor Costello will be used to develop a battery of tests. Costello provides the "record and execute" functionality that will allow us to record different user interaction scenarios with the GUI and test those scenarios efficiently. The scripts that record the user interactions are saved as XML. The salient features of the scripts that help in rapidly creating a functional test framework are:

  • Focuses on test creation: The XML-based scripts can be written rapidly (directly or by using Costello) and are dynamically interpreted by Abbot. There's no need to write new code and compile test cases.
  • Focuses on validating GUI decision points: Abbot allows the test creators to add assertions to check for values resulting from user interactions. The assert tag is used to check for valid results from a user interaction before the script proceeds. This feature is very useful, as it helps pinpoint the step in which the GUI fails and aids in regression testing.
  • Provides infrastructure to create robust scripts: Some GUI "record and execute" tools produce very fragile scripts. These tools not only store the events but also the GUI component position information, such as coordinates, to identify them. These scripts are very fragile because any change in positional attributes (changes in layout or running the script on a different platform) breaks the scripts. Abbot uses a number of attributes to dynamically identify the component without depending on any positional attributes. These attributes in aggregate form a component reference, which can be used within the script even before the component itself necessarily exists.
  • Provides a high-level abstraction over the Java Robot class: Abbot builds on top of the Java Robot class by providing a layer of abstraction. The abstraction layer allows end users to create test cases that can capture high-level semantics like the OK button, Select CO from the list of states, etc. This makes the scripts easy to understand and enhances them in the future.

    An example of a test script in XML is provided in Listing 1.

    With this background about the features of the script, it's time to look into how to use the script editor to create the test cases. The sample GUI shown in Figure 1 is an example from the Java Swing tutorial available at java.sun.com.

    The GUI is a Celsius-to-Fahrenheit converter that takes in a numeric value and on the button click displays the converted result in Fahrenheit. To test this GUI, we can write some simple GUI tests to verify the results on the input of a positive number, a negative number, and a nonnumeric input.

  • More Stories By Satadip Dutta

    Satadip Dutta is a software architect at Hewlett-Packard (http://devresource.hp.com) and has been programming in Java since 1997. His areas of interest include distributed software architecture, Web services, and user interface design. Satadip holds an MS in Computer Science from Virginia Tech.

    Comments (7) View Comments

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


    Most Recent Comments
    Ashwath 01/18/05 02:34:16 AM EST

    I tried to run the code that u haven for 'GUI already exista' scenario. But it doen't work.. give me some eg.s

    tlroche 08/22/03 10:05:14 PM EDT

    "Abbot for SWT" (project name=abbotforswt) is an Eclipse plugin
    which seeks to extend Abbot ... for SWT (but you guessed :-) It is
    currently available only from the IIOSB (a "walled garden" version of
    SourceForge inaccessible outside IBM) @

    https://w3.opensource.ibm.com/projects/abbotforswt/

    (IIOSB residence is intended to be temporary. We are currently in IBM
    Open Source Steering Committee pre-review, and therefore hope to
    contribute our extensions back to Abbot sometime this millenium :-)
    For more detail, including

    * how abbotforswt extends j.a.Robot and Abbot

    * abbotforswt vs blackbox tools (e.g. RobotJ/XDE Tester)

    * related Eclipse 3.0 plan items

    see the (currently rather crude) abbotforswt homepage

    To demonstrate abbotforswt's feasibility, we have taken scenario 2
    from the JDJ article above, recoded its SUT (a dialog) in SWT, and
    designed and implemented an API targeting SWT equivalent to Abbot's
    existing API targeting AWT/Swing. For more details, see our release
    notes.

    Sound interesting? Try it out! However, first:

    <required type="legalese">

    If you are an IBMer and have NOT already completed your "OSPG
    training," please read the Open Source Participation Guidelines
    before you check out any code.

    </required>

    You have 2 installation options. Instructions are for Eclipse/
    WebSphere Studio users:

    0 Install the release zip. Goto our release page

    read the "IMPORTANT NOTICE", then follow the instructions in the
    release notes

    Note that you need not register for IIOSB to get the release, but we
    hope you will, because you're a fine human being. (Apologies for
    speciesism to all the fine non-human programmers out there :-)

    1 Install from CVS. This is a good first step toward becoming an
    abbotforswt contributor!

    - Run your development workbench (devbench) with either Target
    Platform pointing to a WSAD build (which is how I tested), or just
    import org.apache.xerces (should work, but not tested).

    - Create a new CVS repository location with

    host=cvs.opensource.ibm.com
    repository path=/cvs/abbotforswt
    user=anonymous
    no password
    connection type=pserver

    and check out HEAD/abbotforswt.

    - Browse to our release notes

    search or scroll to "run the demo"

    - Skip to step 4

    The demo can then be run in each of 3 ways, all of which are
    documented in the release notes:

    * using Test Collector in a launched WebSphere Studio build

    * using pde.junit to launch an Eclipse or WS build

    * using Eclipse's JUnit to launch just the UI

    tlroche 08/22/03 09:55:08 PM EDT

    "Abbot for SWT" (project name=abbotforswt) is an Eclipse plugin which seeks to extend Abbot ... for SWT (but you guessed :-) It is currently available only from the IIOSB (a "walled garden" version of SourceForge inaccessible outside IBM) @

    https://w3.opensource.ibm.com/projects/abbotforswt/

    (IIOSB residence is intended to be temporary. We are currently in IBM Open Source Steering Committee pre-review, and therefore hope to contribute our extensions back to Abbot sometime this millenium :-) For more detail, including

    * how abbotforswt extends j.a.Robot and Abbot

    * abbotforswt vs blackbox tools (e.g. RobotJ/XDE Tester)

    * related Eclipse 3.0 plan items

    see the (currently rather crude) abbotforswt homepage

    http://w3.opensource.ibm.com/~abbotforswt/

    To demonstrate abbotforswt's feasibility, we have taken scenario 2 from the JDJ article above, recoded its SUT (a dialog) in SWT, and designed and implemented an API targeting SWT equivalent to Abbot's existing API targeting AWT/Swing. For more details, see our release notes @

    http://w3.opensource.ibm.com/project/shownotes.php?release_id=597

    Sound interesting? Try it out! However, first:

    If you are an IBMer and have NOT already completed your "OSPG training," please read the Open Source Participation Guidelines

    http://ltc.linux.ibm.com/open_source/ospg.html

    before you check out any code.

    You have 2 installation options. Instructions are for Eclipse/ WebSphere Studio users:

    0 Install the release zip. Goto our release page

    http://w3.opensource.ibm.com/project/showfiles.php?group_id=1023

    read the "IMPORTANT NOTICE", then follow the instructions in the release notes

    http://w3.opensource.ibm.com/project/shownotes.php?release_id=597

    Note that you need not register for IIOSB to get the release, but we hope you will, because you're a fine human being. (Apologies for speciesism to all the fine non-human programmers

    http://www.newtechusa.com/PPI/pressroom.asp#higher

    out there :-)

    1 Install from CVS. This is a good first step toward becoming an abbotforswt contributor!

    - Run your development workbench (devbench) with either Target Platform pointing to a WSAD build (which is how I tested), or just import org.apache.xerces (should work, but not tested).

    - Create a new CVS repository location with

    host=cvs.opensource.ibm.com
    repository path=/cvs/abbotforswt
    user=anonymous
    no password
    connection type=pserver

    and check out HEAD/abbotforswt.

    - Browse to our release notes

    http://w3.opensource.ibm.com/project/shownotes.php?release_id=597

    search or scroll to "run the demo"

    - Skip to step 4

    The demo can then be run in each of 3 ways, all of which are documented in the release notes:

    * using Test Collector in a launched WebSphere Studio build

    * using pde.junit to launch an Eclipse or WS build

    * using Eclipse's JUnit to launch just the UI

    tlroche 08/22/03 09:51:39 PM EDT

    "Abbot for SWT" (project name=abbotforswt) is an Eclipse plugin which seeks to extend Abbot ... for SWT (but you guessed :-) It is currently available only from the IIOSB (a "walled garden" version of SourceForge inaccessible outside IBM) @

    https://w3.opensource.ibm.com/projects/abbotforswt/

    (IIOSB residence is intended to be temporary. We are currently in IBM Open Source Steering Committee pre-review, and therefore hope to contribute our extensions back to Abbot sometime this millenium :-) For more detail, including

    * how abbotforswt extends j.a.Robot and Abbot

    * abbotforswt vs blackbox tools (e.g. RobotJ/XDE Tester)

    * related Eclipse 3.0 plan items

    see the (currently rather crude) abbotforswt homepage

    http://w3.opensource.ibm.com/~abbotforswt/

    To demonstrate abbotforswt's feasibility, we have taken scenario 2 from the JDJ article above, recoded its SUT (a dialog) in SWT, and designed and implemented an API targeting SWT equivalent to Abbot's existing API targeting AWT/Swing. For more details, see our release notes @

    http://w3.opensource.ibm.com/project/shownotes.php?release_id=597

    Sound interesting? Try it out! However, first:

    If you are an IBMer and have NOT already completed your "OSPG training," please read the Open Source Participation Guidelines

    http://ltc.linux.ibm.com/open_source/ospg.html

    before you check out any code.

    You have 2 installation options. Instructions are for Eclipse/ WebSphere Studio users:

    0 Install the release zip. Goto our release page

    http://w3.opensource.ibm.com/project/showfiles.php?group_id=1023

    read the "IMPORTANT NOTICE", then follow the instructions in the release notes

    http://w3.opensource.ibm.com/project/shownotes.php?release_id=597

    Note that you need not register for IIOSB to get the release, but we hope you will, because you're a fine human being. (Apologies for speciesism to all the fine non-human programmers

    http://www.newtechusa.com/PPI/pressroom.asp#higher

    out there :-)

    1 Install from CVS. This is a good first step toward becoming an abbotforswt contributor!

    - Run your development workbench (devbench) with either Target Platform pointing to a WSAD build (which is how I tested), or just import org.apache.xerces (should work, but not tested).

    - Create a new CVS repository location with

    host=cvs.opensource.ibm.com
    repository path=/cvs/abbotforswt
    user=anonymous
    no password
    connection type=pserver

    and check out HEAD/abbotforswt.

    - Browse to our release notes

    http://w3.opensource.ibm.com/project/shownotes.php?release_id=597

    search or scroll to "run the demo"

    - Skip to step 4

    The demo can then be run in each of 3 ways, all of which are documented in the release notes:

    * using Test Collector in a launched WebSphere Studio build

    * using pde.junit to launch an Eclipse or WS build

    * using Eclipse's JUnit to launch just the UI

    Jeff 04/29/03 08:26:00 PM EDT

    I believe this is a forum in which comments need to be made about the article and its vaildity.

    The above messages should be in English and any concerns/comments should be made available for the benefit for all in the community

    Bhojohori Manna 04/29/03 06:00:00 AM EDT

    Chee chee, Ei rokom gala gali dile hobe.Dada koto bhalo article likheche.

    Utgandu 04/29/03 05:54:00 AM EDT

    Dada,ei jinis poisa diye keu porbe bhebechen apni?USa te theke apnio sobar moto boka patha hoye gechen .Apni ei jinista kotha theke chotha korechen?Ar apni ki GUI Master ke chenen???jobab chai,jobab dao.

    @ThingsExpo Stories
    In his session at 21st Cloud Expo, Carl J. Levine, Senior Technical Evangelist for NS1, will objectively discuss how DNS is used to solve Digital Transformation challenges in large SaaS applications, CDNs, AdTech platforms, and other demanding use cases. Carl J. Levine is the Senior Technical Evangelist for NS1. A veteran of the Internet Infrastructure space, he has over a decade of experience with startups, networking protocols and Internet infrastructure, combined with the unique ability to it...
    To get the most out of their data, successful companies are not focusing on queries and data lakes, they are actively integrating analytics into their operations with a data-first application development approach. Real-time adjustments to improve revenues, reduce costs, or mitigate risk rely on applications that minimize latency on a variety of data sources. In his session at @BigDataExpo, Jack Norris, Senior Vice President, Data and Applications at MapR Technologies, reviewed best practices to ...
    Coca-Cola’s Google powered digital signage system lays the groundwork for a more valuable connection between Coke and its customers. Digital signs pair software with high-resolution displays so that a message can be changed instantly based on what the operator wants to communicate or sell. In their Day 3 Keynote at 21st Cloud Expo, Greg Chambers, Global Group Director, Digital Innovation, Coca-Cola, and Vidya Nagarajan, a Senior Product Manager at Google, discussed how from store operations and ...
    When talking IoT we often focus on the devices, the sensors, the hardware itself. The new smart appliances, the new smart or self-driving cars (which are amalgamations of many ‘things’). When we are looking at the world of IoT, we should take a step back, look at the big picture. What value are these devices providing? IoT is not about the devices, it’s about the data consumed and generated. The devices are tools, mechanisms, conduits. In his session at Internet of Things at Cloud Expo | DXWor...
    It is of utmost importance for the future success of WebRTC to ensure that interoperability is operational between web browsers and any WebRTC-compliant client. To be guaranteed as operational and effective, interoperability must be tested extensively by establishing WebRTC data and media connections between different web browsers running on different devices and operating systems. In his session at WebRTC Summit at @ThingsExpo, Dr. Alex Gouaillard, CEO and Founder of CoSMo Software, presented ...
    WebRTC is great technology to build your own communication tools. It will be even more exciting experience it with advanced devices, such as a 360 Camera, 360 microphone, and a depth sensor camera. In his session at @ThingsExpo, Masashi Ganeko, a manager at INFOCOM Corporation, introduced two experimental projects from his team and what they learned from them. "Shotoku Tamago" uses the robot audition software HARK to track speakers in 360 video of a remote party. "Virtual Teleport" uses a multip...
    An increasing number of companies are creating products that combine data with analytical capabilities. Running interactive queries on Big Data requires complex architectures to store and query data effectively, typically involving data streams, an choosing efficient file format/database and multiple independent systems that are tied together through custom-engineered pipelines. In his session at @BigDataExpo at @ThingsExpo, Tomer Levi, a senior software engineer at Intel’s Advanced Analytics gr...
    SYS-CON Events announced today that CrowdReviews.com has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5–7, 2018, at the Javits Center in New York City, NY. CrowdReviews.com is a transparent online platform for determining which products and services are the best based on the opinion of the crowd. The crowd consists of Internet users that have experienced products and services first-hand and have an interest in letting other potential buye...
    Everything run by electricity will eventually be connected to the Internet. Get ahead of the Internet of Things revolution. In his session at @ThingsExpo, Akvelon expert and IoT industry leader Sergey Grebnov provided an educational dive into the world of managing your home, workplace and all the devices they contain with the power of machine-based AI and intelligent Bot services for a completely streamlined experience.
    SYS-CON Events announced today that Telecom Reseller has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Telecom Reseller reports on Unified Communications, UCaaS, BPaaS for enterprise and SMBs. They report extensively on both customer premises based solutions such as IP-PBX as well as cloud based and hosted platforms.
    "There's plenty of bandwidth out there but it's never in the right place. So what Cedexis does is uses data to work out the best pathways to get data from the origin to the person who wants to get it," explained Simon Jones, Evangelist and Head of Marketing at Cedexis, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
    Leading companies, from the Global Fortune 500 to the smallest companies, are adopting hybrid cloud as the path to business advantage. Hybrid cloud depends on cloud services and on-premises infrastructure working in unison. Successful implementations require new levels of data mobility, enabled by an automated and seamless flow across on-premises and cloud resources. In his general session at 21st Cloud Expo, Greg Tevis, an IBM Storage Software Technical Strategist and Customer Solution Architec...
    SYS-CON Events announced today that Evatronix will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Evatronix SA offers comprehensive solutions in the design and implementation of electronic systems, in CAD / CAM deployment, and also is a designer and manufacturer of advanced 3D scanners for professional applications.
    "IBM is really all in on blockchain. We take a look at sort of the history of blockchain ledger technologies. It started out with bitcoin, Ethereum, and IBM evaluated these particular blockchain technologies and found they were anonymous and permissionless and that many companies were looking for permissioned blockchain," stated René Bostic, Technical VP of the IBM Cloud Unit in North America, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Conventi...
    A strange thing is happening along the way to the Internet of Things, namely far too many devices to work with and manage. It has become clear that we'll need much higher efficiency user experiences that can allow us to more easily and scalably work with the thousands of devices that will soon be in each of our lives. Enter the conversational interface revolution, combining bots we can literally talk with, gesture to, and even direct with our thoughts, with embedded artificial intelligence, whic...
    SYS-CON Events announced today that Synametrics Technologies will exhibit at SYS-CON's 22nd International Cloud Expo®, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Synametrics Technologies is a privately held company based in Plainsboro, New Jersey that has been providing solutions for the developer community since 1997. Based on the success of its initial product offerings such as WinSQL, Xeams, SynaMan and Syncrify, Synametrics continues to create and hone inn...
    SYS-CON Events announced today that Google Cloud has been named “Keynote Sponsor” of SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Companies come to Google Cloud to transform their businesses. Google Cloud’s comprehensive portfolio – from infrastructure to apps to devices – helps enterprises innovate faster, scale smarter, stay secure, and do more with data than ever before.
    "Avere Systems deals with data performance optimization in the cloud or on-premise. Even to this day many organizations struggle with what we call the problem of data gravity - 'Where should I put the data?' - because the data dictates ultimately where the jobs are going to run," explained Scott Jeschonek, Director Cloud Solutions at Avere Systems, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
    Recently, WebRTC has a lot of eyes from market. The use cases of WebRTC are expanding - video chat, online education, online health care etc. Not only for human-to-human communication, but also IoT use cases such as machine to human use cases can be seen recently. One of the typical use-case is remote camera monitoring. With WebRTC, people can have interoperability and flexibility for deploying monitoring service. However, the benefit of WebRTC for IoT is not only its convenience and interopera...
    Digital Transformation (DX) is not a "one-size-fits all" strategy. Each organization needs to develop its own unique, long-term DX plan. It must do so by realizing that we now live in a data-driven age, and that technologies such as Cloud Computing, Big Data, the IoT, Cognitive Computing, and Blockchain are only tools. In her general session at 21st Cloud Expo, Rebecca Wanta explained how the strategy must focus on DX and include a commitment from top management to create great IT jobs, monitor ...