Scripts

The insertion of a Play Script action means that TestDrive will be launched if it is not already running and the Script will be executed against the target application.

The following properties can be updated.

  • Script – The name of the Script that will be run.  Click the drop down arrow to select from the list of Scripts that have been added to the expandable Assets panel.
  • Launch – When a script is recorded, one of its properties is whether or not the application under test was launched by TestDrive or was already open and then attached to.  This value can be changed at any time from the Script Details panel in the Script Editor.  The ‘Use Script Settings’ value means that when the Script is played back, whatever is contained in this value is what will be done.  However it can be overridden here using the alternative values of ‘Always Attach to Running Application’ or ‘Always Start New Application’ values.
  • Start – The screen from which playback should begin.  The default is ‘<Start>’ which is the first screen of the Script, even if the Script changes the initial screen will be used.
  • End – The screen or input on which playback will end.  The default is ‘<End>’ which is the final event in the Script, even if the Script changes the last screen or input will be used.
  • Checking Rule – When a script is played back, there are several quality checks that can be enforced.  These include content checking (has the application changed since it was recorded?), spell checking, link checking and performance checking.  Which of these should be used and how they should be used is controlled by checking rules which are created using the option from the File menu and then assigned to a Playlist here.
  • Application – The Application used during recording is saved with a Script and controls exactly how the Script behaves.  Here it is possible to override the Application that will be used within this Playlist when this Script is played back.  Also just the version number can be changed, therefore if an Application is modified, updating the version number here will enable the changes to take effect for this Script.  This option is also available at the Playlist level.
  • Option Set – The Options used during recording are saved with a Script and control exactly how the Script behaves, from when a new screen picture should be taken through to how the input for the screen should be annotated or described.  Here it is possible to override the Option Set that will be used within this Playlist when the Script is played back.  Also just the version number can be changed, therefore if an Option Set is modified, updating the version number here will enable the changes to take effect for this Script.  This option is also available at the Playlist level.
  • Fail Playlist if – If the Script ends with any of the checked reason codes listed, the Playlist will be given a status of Failed.
  • Store Result in – Specify the name of a Tracked Field that will hold the Reason Code from the list above, this can then be used to condition other processing within the Playlist.
  • Wait for – The total script playback timeout in minutes, if a Script takes more than this length of time to playback it will stop.
  • Play by Position – This option only relates to dynamic input which is input over elements that were not present on screen when the analysis took place and therefore are not included in the Expected Contents list.  For example, combo box items or drop down menu items. By default all input, including dynamic input is played back by value.  This is important because it means that input will be played back correctly even if the elements have moved.  For example, assume a combo box contained the following values at the time of recording and the user clicked on ‘Wednesday’.
  • Monday
  • Tuesday
  • Wednesday
  • Thursday

Next assume that by the time the script is played back, ‘Tuesday’ has been removed from the list so that it now looks like this.

  • Monday
  • Wednesday
  • Thursday

If TestDrive were to play back by position, it would incorrectly click the third element in the list which is ‘Thursday’.  However, playing back by value causes the input to search for the correct element name of ‘Wednesday’, regardless of position. However, there may be some circumstances where playing back dynamic input by value does not yield the correct results.  This could occur if there were multiple occurrences of the same value in the list.  In these situations the ‘By Position’ option can be selected.

  • Unexpected Dialogs – For some applications and therefore Scripts there may be specific screens that sometimes appear and sometimes do not, and if these screens do appear some action may need to be taken before the Playlist can resume along its path.  These are referred to as unexpected dialogs.  Clicking the down arrow enables these dialogs to be configured, please see later section for full information.