
By Satadip Dutta | Article Rating: |
|
July 18, 2009 12:45 PM EDT | Reads: |
68,273 |
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:
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:
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.
Published July 18, 2009 Reads 68,273
Copyright © 2009 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
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.
![]() |
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 https://w3.opensource.ibm.com/projects/abbotforswt/ (IIOSB residence is intended to be temporary. We are currently in IBM * 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 Sound interesting? Try it out! However, first: <required type="legalese"> If you are an IBMer and have NOT already completed your "OSPG </required> You have 2 installation options. Instructions are for Eclipse/ 0 Install the release zip. Goto our release page read the "IMPORTANT NOTICE", then follow the instructions in the Note that you need not register for IIOSB to get the release, but we 1 Install from CVS. This is a good first step toward becoming an - Run your development workbench (devbench) with either Target - Create a new CVS repository location with host=cvs.opensource.ibm.com 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 * 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 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 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. |
![]() Dec. 6, 2017 09:15 PM EST Reads: 1,266 |
By Pat Romanski ![]() Dec. 6, 2017 08:15 PM EST Reads: 2,312 |
By Liz McMillan ![]() Dec. 6, 2017 05:15 PM EST Reads: 1,427 |
By Pat Romanski ![]() Dec. 6, 2017 05:00 PM EST Reads: 1,088 |
By Pat Romanski ![]() Dec. 6, 2017 04:30 PM EST Reads: 553 |
By Elizabeth White ![]() Dec. 6, 2017 03:00 PM EST Reads: 675 |
By Liz McMillan ![]() Dec. 6, 2017 11:15 AM EST Reads: 1,601 |
By Liz McMillan ![]() Dec. 6, 2017 11:00 AM EST Reads: 731 |
By Liz McMillan ![]() Dec. 6, 2017 11:00 AM EST Reads: 1,215 |
By Elizabeth White ![]() Dec. 6, 2017 10:15 AM EST Reads: 731 |
By Elizabeth White ![]() Dec. 6, 2017 10:00 AM EST Reads: 671 |
By Elizabeth White ![]() Dec. 6, 2017 10:00 AM EST Reads: 962 |
By Liz McMillan ![]() Dec. 6, 2017 06:45 AM EST Reads: 3,460 |
By Elizabeth White ![]() Dec. 6, 2017 03:45 AM EST Reads: 1,226 |
By Liz McMillan ![]() Dec. 5, 2017 09:30 PM EST Reads: 9,500 |
By Pat Romanski ![]() Dec. 5, 2017 11:30 AM EST Reads: 2,410 |
By Elizabeth White ![]() Dec. 4, 2017 04:45 PM EST Reads: 2,708 |
By Elizabeth White ![]() Dec. 4, 2017 03:34 PM EST Reads: 590 |
By Liz McMillan ![]() Dec. 1, 2017 02:00 PM EST Reads: 1,422 |
By Liz McMillan ![]() Dec. 1, 2017 12:00 PM EST Reads: 1,229 |