Script tests

The Automation Scripts application has a Test Script button to help test the script that you wrote.

You can use this feature to prepare the test data and run the script from the test dialog. All the logs are printed in the Process Log text area without enabling any logging if the service variable was used for the log. In cases where the script needs a Maximo® business object (MBO) for the test, the dialog provides a way to select the MBO for testing the script by using the object path. The following sample shows how to set the object path.
ASSET[assetnum='SPFN0001']

If you set the path value to just ASSET, the test framework creates a new MBO for the asset and uses it for this script.

This sample selects an asset with assetnum SPFN0001 and uses the MBO for the mbo variable in the script context. This functionality can be used for testing object, attribute, action, or condition launch point scripts. The dialog enables you to set attribute or value pairs to prepare the MBO for the test by using the Set Attribute Value table. The process makes a best attempt to not commit the modified MBO, but in certain cases this committing is unavoidable. For example, in cases where the event is after a commit, the MBO is already committed. For other cases, the script code itself might initiate a commit.