Thursday, July 19, 2007

Event handling

Events are unscheduled occurrences or conditions to which you want the target application to respond in a specified manner.
TestPartner supports two categories of events: Waits and Whenevers.


A Wait event tells TestPartner to wait for a specified occurrence before proceeding. Wait events are useful in situations where you
cannot anticipate the amount of time a response will take. An example of a Wait event would be waiting for a system login prompt. When your script is running against a network-based application that requires the user to log in, the amount of time it takes for the login prompt to display may vary. To account for this variance, you can insert a Wait event that instructs your script to wait for the login prompt before
proceeding to type a user name and password.



A Whenever event tells TestPartner to watch for a specific occurrence and, if it occurs, perform a special set of steps. Whenever events are useful for trapping unexpected error conditions during a test run. For example, you can include events in your scripts to recognize when the connection to the server has been interrupted by a communications error or a network system message has been received,
so that the script can report or work around the problem.

In a script, TestPartner automatically inserts the Script_Whenever function by default to handle the whenever event. If a whenever event is inserted into a module, shared module, or class module, you must customize the whenever event handler code. To determine what is performed when a whenever event triggers, TestPartner uses the Script_Whenever function to handle the event

No comments: