This chapter presents JavaStar tools and guidelines for using the added facilities found in the JavaStar Application Program Interface, or API. You use the API by adding your own Java code to existing JavaStar scripts or writing scripts from scratch.
While JavaStar provides you with fully-functional tests without requiring you to use the API, your tests will be stronger if you know what is available and use the methods to enhance your testing.
The JavaStar API includes classes and methods that assist test development. You can modify your scripts to use API features that aren't available when you record GUI interaction. You can also access custom components directly and call any public methods you need for verifying the state of your GUI or performing actions. Because Java is a powerful language, your tests can use more of the object-oriented features it provides when you add your own code.
In addition, some people prefer to write their tests from scratch. That way, they can add their own methods to the script class as they go along. If you're one of these people, you'll find JavaStar provides you with many tools to help you create flexible scripts. Before writing a script, however, you'll need to familiarize yourself with the script format that JavaStar expects.
After reading this chapter, you should know:
In addition, you should know how to do these common functions using the API:
GUINotFoundExceptions
with internal checks that do not cause an exception
This chapter does not attempt to teach you Java--it assumes that if you want to add custom code, you're already familiar with the syntax of that code--but it does guide you through an exercise of adding Java statements to a script.
Topics:
Send feedback to
JavaStar-feedback@suntest.com
Copyright © 1998
Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, CA 94303.
All rights reserved.