Setting general playback preferences in test scripts

You can set the general playback preferences in test scripts. The preference set in the script, if any, takes precedence over the one that is set through the Preferences dialog and it applies globally to all the scripts. Hence, ensure that the script includes a reset command that reverts the preference to its earlier setting.

The following table lists the code snippets to be inserted for each general playback preference:

Preference

Code snippet

Show exception dialog
setOption(IOptionName.SHOW_EXCEPTION_DLG, true);
// actions
resetOption(IOptionName.SHOW_EXCEPTION_DLG);
Perform playback in interactive mode
setOption(IOptionName.PERFORM_PLAYBACK_IN_INTERACTIVE_MODE, true);
// actions
resetOption(IOptionName.PERFORM_PLAYBACK_IN_INTERACTIVE_MODE);
Note:

This setting works only if IOptionName.SHOW_EXCEPTION_DLG is set to true.

Maximum time to attempt to find Test Object
setOption(IOptionName.MAXIMUM_FIND_OBJECT_TIME, maximumtimeinseconds);
// actions
resetOption(IOptionName.MAXIMUM_FIND_OBJECT_TIME);
Pause between attempts to find Test Object
setOption(IOptionName.FIND_OBJECT_DELAY_BETWEEN_RETRIES, pausetimeinseconds);
// actions
resetOption(IOptionName.FIND_OBJECT_DELAY_BETWEEN_RETRIES);
Skip Verification Points
setOption(IOptionName.SUPRESS_VP_PERFORM_TEST, true);
// actions
resetOption(IOptionName.SUPRESS_VP_PERFORM_TEST);
Timeout used in waitForExistence() method
setOption(IOptionName.MAXIMUM_WAIT_FOR_EXISTENCE, maximumwaittimeinseconds);
// actions
resetOption(IOptionName.MAXIMUM_WAIT_FOR_EXISTENCE);
Retry time used in waitForExistence() loop
setOption(IOptionName.WAIT_FOR_EXISTENCE_DELAY_BETWEEN_RETRIES, delaytimeinseconds););
// actions
resetOption(IOptionName.WAIT_FOR_EXISTENCE_DELAY_BETWEEN_RETRIES);