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

Welcome!

Recurring Revenue Authors: Liz McMillan, Pat Romanski, Elizabeth White, 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
    SYS-CON Events announced today that CHEETAH Training & Innovation 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. CHEETAH Training & Innovation is a cloud consulting and IT training firm specializing in improving clients cloud strategies and infrastructures for medium to large companies.
    SYS-CON Events announced today that DXWorldExpo has been named “Global 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. Digital Transformation is the key issue driving the global enterprise IT business. Digital Transformation is most prominent among Global 2000 enterprises and government institutions.
    SYS-CON Events announced today that IBM has been named “Diamond Sponsor” of SYS-CON's 21st Cloud Expo, which will take place on October 31 through November 2nd 2017 at the Santa Clara Convention Center in Santa Clara, California.
    In his opening keynote at 20th Cloud Expo, Michael Maximilien, Research Scientist, Architect, and Engineer at IBM, discussed the full potential of the cloud and social data requires artificial intelligence. By mixing Cloud Foundry and the rich set of Watson services, IBM's Bluemix is the best cloud operating system for enterprises today, providing rapid development and deployment of applications that can take advantage of the rich catalog of Watson services to help drive insights from the vast t...
    SYS-CON Events announced today that EnterpriseTech has been named “Media 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. EnterpriseTech is a professional resource for news and intelligence covering the migration of high-end technologies into the enterprise and business-IT industry, with a special focus on high-tech solutions in new product development, workload management, increased effic...
    IoT solutions exploit operational data generated by Internet-connected smart “things” for the purpose of gaining operational insight and producing “better outcomes” (for example, create new business models, eliminate unscheduled maintenance, etc.). The explosive proliferation of IoT solutions will result in an exponential growth in the volume of IoT data, precipitating significant Information Governance issues: who owns the IoT data, what are the rights/duties of IoT solutions adopters towards t...
    SYS-CON Events announced today that Datanami has been named “Media 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. Datanami is a communication channel dedicated to providing insight, analysis and up-to-the-minute information about emerging trends and solutions in Big Data. The publication sheds light on all cutting-edge technologies including networking, storage and applications, and thei...
    New competitors, disruptive technologies, and growing expectations are pushing every business to both adopt and deliver new digital services. This ‘Digital Transformation’ demands rapid delivery and continuous iteration of new competitive services via multiple channels, which in turn demands new service delivery techniques – including DevOps. In this power panel at @DevOpsSummit 20th Cloud Expo, moderated by DevOps Conference Co-Chair Andi Mann, panelists examined how DevOps helps to meet the de...
    The Internet giants are fully embracing AI. All the services they offer to their customers are aimed at drawing a map of the world with the data they get. The AIs from these companies are used to build disruptive approaches that cannot be used by established enterprises, which are threatened by these disruptions. However, most leaders underestimate the effect this will have on their businesses. In his session at 21st Cloud Expo, Rene Buest, Director Market Research & Technology Evangelism at Ara...
    With the introduction of IoT and Smart Living in every aspect of our lives, one question has become relevant: What are the security implications? To answer this, first we have to look and explore the security models of the technologies that IoT is founded upon. In his session at @ThingsExpo, Nevi Kaja, a Research Engineer at Ford Motor Company, discussed some of the security challenges of the IoT infrastructure and related how these aspects impact Smart Living. The material was delivered interac...
    In his session at @ThingsExpo, Eric Lachapelle, CEO of the Professional Evaluation and Certification Board (PECB), provided an overview of various initiatives to certify the security of connected devices and future trends in ensuring public trust of IoT. Eric Lachapelle is the Chief Executive Officer of the Professional Evaluation and Certification Board (PECB), an international certification body. His role is to help companies and individuals to achieve professional, accredited and worldwide re...
    Multiple data types are pouring into IoT deployments. Data is coming in small packages as well as enormous files and data streams of many sizes. Widespread use of mobile devices adds to the total. In this power panel at @ThingsExpo, moderated by Conference Chair Roger Strukhoff, panelists looked at the tools and environments that are being put to use in IoT deployments, as well as the team skills a modern enterprise IT shop needs to keep things running, get a handle on all this data, and deliver...
    "MobiDev is a Ukraine-based software development company. We do mobile development, and we're specialists in that. But we do full stack software development for entrepreneurs, for emerging companies, and for enterprise ventures," explained Alan Winters, U.S. Head of Business Development at MobiDev, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
    Artificial intelligence, machine learning, neural networks. We’re in the midst of a wave of excitement around AI such as hasn’t been seen for a few decades. But those previous periods of inflated expectations led to troughs of disappointment. Will this time be different? Most likely. Applications of AI such as predictive analytics are already decreasing costs and improving reliability of industrial machinery. Furthermore, the funding and research going into AI now comes from a wide range of com...
    In this presentation, Striim CTO and founder Steve Wilkes will discuss practical strategies for counteracting fraud and cyberattacks by leveraging real-time streaming analytics. In his session at @ThingsExpo, Steve Wilkes, Founder and Chief Technology Officer at Striim, will provide a detailed look into leveraging streaming data management to correlate events in real time, and identify potential breaches across IoT and non-IoT systems throughout the enterprise. Strategies for processing massive ...
    SYS-CON Events announced today that TechTarget has been named “Media 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. TechTarget storage websites are the best online information resource for news, tips and expert advice for the storage, backup and disaster recovery markets.
    SYS-CON Events announced today that SourceForge has been named “Media 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. SourceForge is the largest, most trusted destination for Open Source Software development, collaboration, discovery and download on the web serving over 32 million viewers, 150 million downloads and over 460,000 active development projects each and every month.
    The current age of digital transformation means that IT organizations must adapt their toolset to cover all digital experiences, beyond just the end users’. Today’s businesses can no longer focus solely on the digital interactions they manage with employees or customers; they must now contend with non-traditional factors. Whether it's the power of brand to make or break a company, the need to monitor across all locations 24/7, or the ability to proactively resolve issues, companies must adapt to...
    Amazon started as an online bookseller 20 years ago. Since then, it has evolved into a technology juggernaut that has disrupted multiple markets and industries and touches many aspects of our lives. It is a relentless technology and business model innovator driving disruption throughout numerous ecosystems. Amazon’s AWS revenues alone are approaching $16B a year making it one of the largest IT companies in the world. With dominant offerings in Cloud, IoT, eCommerce, Big Data, AI, Digital Assista...
    SYS-CON Events announced today that CA Technologies has been named "Platinum Sponsor" of SYS-CON's 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. CA Technologies helps customers succeed in a future where every business - from apparel to energy - is being rewritten by software. From planning to development to management to security, CA creates software that fuels transformation for companies in the applic...