home *** CD-ROM | disk | FTP | other *** search
-
- Notes about Non-Component Support for Bongo (jdk 1.1.1 and above)
- 8/8/97
-
- * Introduction
- * Recording
- * General Indexed Identifiers
- * Internal Names
- * Verification of Non Components
- * Known Bugs
-
- Introduction
- ============
-
- JavaStar Non-Component support allows JavaStar to access non AWT based
- components. During recording with a non-component module, the non-
- component module interprets the event and calculates the non AWT component
- where the event occurred. In the recorded script the non AWT component
- is recorded instead of the screen coordinate.
-
- Each non-component toolkit contains a java AWT based top level. This
- is the level where the toolkit inserts all its components. For Bongo
- the base component is called PlayerPanel. For example, when recording
- against the Bongo widgets.gui example app, each recorded event produces
- JS.frame("Example Widgets").member("PlayerPanel").<statement>
-
- Recording
- =========
-
- Without non-component locators, recordings are relatively breakable.
- For example clicking on a button in the Widgets.gui Bongo example without
- the non-component support module produces the following JavaStar code:
-
-
- JS.frame("Example Widgets").member("PlayerPanel").multiClick(71,66,16,1);
-
- This statement will click on a screen location in the Bongo frame.
- If the Bongo layout manager moves its components around, the button
- will not be at recorded screen location (71,66) and the script will
- no longer perform the desired behavior.
-
- With the non-component module, the same JavaStar recording will produce
- a click on a specific object:
-
- JS.frame("Example Widgets").member("marimba.gui.PlayerPanel").getNonComponent
- ("bongo","PopupWidget.Presentation%0.FolderWidget%0.PageWidget%1.
- GroupBoxWidget%3.GroupWidget%0.CommandButtonWidget%0").multiClick(5,10,16,1);
-
- This has all the benefits associated with object-specific recording, and will
- not break because of minor shifts in screen locations.
-
-
- General Indexed Identifiers
- ===========================
-
- The getNonComponent method takes two parameters. The first is the class of the
- non-component locator. After clicking on "Record test", it is necessary to enter all
- non-component classes in the "Non component locator:" field. In this example
- "bongo" was entered in the field to load the Bongo locator. It is also
- necessary to put the location of the locator in the classpath. When playing
- back the script and reaching a statement with .getNonComponent, JavaStar will
- get the first parameter ("bongo") and look for the bongo class in the classpath.
-
- The second parameter is the Bongo specific identifier. The string shows the
- bongo hierarchy. Each component in the hierarchy is separated by ".". Each
- component class is followed by %<index>. The index is the order in which each
- component was created. "PopupWidget" is the top level in bongo and usually
- "Presentation%0" is the next component level. For example CommandButtonWidget%0
- generates the event to the 1st button.
-
- Internal Names
- ==============
-
- Bongo allows each component to have an internal name. This is done by calling
- .setName to a widget or in the Bongo builder tool setting the Name field.
- JavaStar will use the internal name as long as the name is unique in the
- entire bongo application. If the name is not unique JavaStar will use the
- indexed identifier.
-
- Internal names are more reliable since they do not rely on the creation order
- of the components.
-
- For example, if the above button in the widgets.gui example had an internal name
- set to "ok_button", recording clicking the button would produce:
-
- JS.frame("Example Widgets").member("marimba.gui.PlayerPanel").getNonComponent
- ("bongo","ok_button");
-
- Using internal names produces more readable code since it does not have to list
- the entire component hiearchy.
-
- Verification of Non-Components
- ==============================
-
- With standard java components the JavaStar verification and synchronization
- allows to access the simple methods of any components. Simple methods and
- fields are defined as any public methods or class instance variables that take
- no parameters and return String,int,float,double,boolean, or a few java.awt
- types such as Color, Point, Rectangle. More complex methods may be called
- By editing the test manually and using .getValidUnique() to get the actual
- component.
-
- Non-Components will also be fully supported in all of these verification
- techniques. Verification of the bongo widgets may be done by using any of the
- data members or public methods.
-
- Known Bugs
- ==========
-
- Only globally unique internal names are supported. Hierarchical internal names
- are not supported.
-
- Send any questions and comments to javastar-feedback@suntest.com. See
- http://www.suntest.com for the latest information.
-
- Dan Schaffer
- 8/8/97
-