Previous Topic: Ensure Step Response Time AssertionNext Topic: Ensure Properties Are Equal Assertion


Scripted Assertion

The Scripted Assertion assertion lets you write and run scripts. The result must be a Boolean, or false is returned.

Complete the following fields:

Name

Defines the name of the assertion.

If

Specifies the behavior of the assertion from the drop-down list.

then

Specifies the step to which to redirect if the assertion fires.

Log

Identifies event text to print if the assertion fires.

Click Run Assertion to execute the assertion.

Language

Designates the scripting language to use.

Values:

Default: Beanshell

To use additional scripting languages, see "Enabling Additional Scripting Languages."

Copy properties into scope

Allows you to specify which properties to download for use in the step.

Values:

Default: Test state properties

Enter your script into the script editor on the left.

All the objects available for use in the script editor are listed in the Available Objects panel on the right. The list includes primitive types of data (strings and numbers) and objects such as EJB response objects that were executed in the test case. Double-click an entry in the Available Objects table to paste that variable name into the editor area.

Click Test to open a window with the result of the script execution or a description of the errors that occurred.

When you save the test case, the assertion is checked for syntax errors.

Some things to remember: