soup

Overview

soup listens to low level input events in the AWT queue, transforms those events in soup.framework.Playable objects that can be replayed either by calling a soup.framework.Robot or by generating the Java code that calls a soup.framework.Robot . There are two implementations of soup.framework.Robot, one (soup.framework.jdk12impl.RobotImpl) works on jdk1.2.2 and the other (soup.framework.jdk13impl.RobotImpl) works on jdk1.3 and above. The proper configuration is made when you build the jar file using the Ant script.

Where to find ...

Tutorial - how to test JUnit GUI using soup.

Download page.

soup project page on sourceforge.

soup mailing list.

Getting Started

Building soup.

To build soup you will need Ant, because the script is in ant, and JUnit , because of its tests. To do that, follow the steps:

The ant script will delete some classes based on the jdk version in JAVA_HOME. It will generate a jar file in \soup\jar\soup.jar.

Running soup.

To run soup you can call:

Where the the_main_class_name is the full name of a class that the main method should open the window to be tested. In other words, soup UI will call, through reflection, the the_main_class_name .main() method.

soup.framework.test.MainComponents is a window that is used in soup tests. You can use it to play with soup.

Soup GUI

soup GUI

The above picture is the soup GUI that can be divided in two parts the tool bar and the controls.

soup controls

These are the, intuitive, controls. From the right to left , they let start recording, play and stop either playing or recording.

soup tool bar

In the tool bar, from the left to right, you can: clear all that you have recorded, save and "save as" what you have recorded, and at last, browse the recorded events. When clicking on this button the following screen will open.

soup event browser

I this screen you have a toolbar and two views of the recorded events. The top view describes the event itself while in the bottom view you see the java code that can play those events. On the top view you can select one or many events (the picture shows the two first items selected). On the tool bar you can copy the source code of the selected events to the clipboard or delete the selected events.

The source code copied to the clipboard could run as in:

import soup.framework.RobotHome;
import soup.framework.test.MainComponents;
.
.
.
void static main(String[] args){
	//here I open the screen.
	MainComponents.open();
	
	// get an instance of Robot that is appropriated 
	// for my java version.
	RobotHome robotHome = RobotHome.getInstance();	
	
	// begin of code generated by soup.
	robotHome.getRobot().mouseMove(339,448);
	robotHome.getRobot().mousePress(16);
	robotHome.getRobot().mouseRelease(16);
	robotHome.getRobot().mouseMove(36,70);
	robotHome.getRobot().mousePress(16);
	robotHome.getRobot().mouseRelease(16);

	// end of code generated by soup.
}

SourceForge.net Logo