Skip to main content
Version: 23.5

The Variable Watcher

The Variable Watcher, when it is enabled, is the pane on the right-side of the Run window. The Variable Watcher enables you to display the effective SenseTalk variables and edit their values while your script is paused or running. It also provides you the option to configure the types of variables you show or hide: local, global, universal or any combination of them. For more information about SenseTalk variables, see Variables.

note

The Variable Watcher does not continue to display variables after a script finishes running.

The Variable Watcher pane in the Eggplant Functional Run window

Using the Variable Watcher

Information about using the Variable Watcher is provided below, including how to enable it, how to specify what variables you want to show, and how to change variable values.

Note: The Variable Watcher truncates variable values to 40 characters. To see and edit longer values, see Displaying the Expanded Edit Pane below.

Enabling/Disabling the Variable Watcher

To enable or disable the Variable Watcher, from the Eggplant Functional application Run menu, you can choose Show Variables and select an option there. You can also use the Show Variables selection box or menu on the Run window toolbar.

Show Variables menu on the Run window toolbar

The options for using the Variable Watcher follow:

Never: Disables the Variable Watcher and hides the pane from the Run window.

When Paused: Enables the Variable Watcher pane and displays the variables only when your script is paused.

Always: Enables the Variable Watcher pane and displays the variables both while your script is running, and when it is paused.

Note: Even when you use the Always setting, the variables only display while your script is running or paused. You will not see them after your script finishes running.

Specifying the Types of Variables to Show

The Variable Watcher provides the Show Variable Types menu for you to specify the types of SenseTalk variables you want to show or hide. SenseTalk uses local, global and universal variable types. Check marks on the menu indicate the types of variables currently selected to show. For more information about SenseTalk variables, see Variables.

Show Variable Types menu for the Variable Watcher on the Run window The Variable Watcher Show Variable Types menu

To display the Show Variable Types menu, follow these steps:

  1. Click the drop-down button, highlighted in the screen above, to display the Show Variable Types menu. The menu opens, showing the variable types available. These menu items are toggles that show and hide the variable types. The variables selected to show have check marks; the variables that do not have a check mark are hidden. The menu provides the following variable types:

    Show Local Variables and Show Unassigned Locals: shows the effective assigned and unassigned local variables.

    Show Global Variables: shows the effective global variables.

    Show Universal Variables: shows the effective universal variables.

  2. Select the type of variable you want to show. You can select only one option at a time. The menu closes after you make your selection. The selections are listed in the bar at the top of the Variable Watcher pane. For example, Locals and Globals are the currently selected values in the screen above.

  3. If you want to select additional variable types, repeat step 2.

If you change the variable type selections while your script is paused, you will see variables based on your new selections in the Variable Watcher when you continue running your script. If you change selections while your script is running, Eggplant Functional finishes the line of SenseTalk code it is currently processing and then implements the new selections. The Variable Watcher shows the variables based on the new selections when they take effect.

Changing Variables Values

You can change a variable value in the Variable Watcher either when your script is paused or while it is running.

Editing a variable value in the Variable Watcher Editing a variable value in the Variable Watcher

To change a variable value, follow these steps:

  1. Select the variable value you want to change in Value column.
  2. Replace the existing value with the new value you want and press Return.

If you change a variable value while your script is paused, the new value takes effect when you continue running your script. If you change a value while your script is running, Eggplant Functional finishes the line of code it is currently processing and then the new value takes effect. Thus, you may not know exactly when the change takes effect.

Displaying the Expanded Edit Pane**

The Variable Watcher truncates values in the Value column. To see a long variable value, you can display it in an expanded edit pane as follows:

  1. Double-click the variable value you want to change in the Value column to begin editing it. You edit the shorter values right in the column. For longer values, which don't fully display in the column, the expanded edit pane opens as shown below.
  2. View the full variable value.

You can also edit variable values in this expanded pane as follows:

Select the variable value you want to see and double-click it.

  1. Display the variable you want in the expanded edit window as described above.

  2. Replace the value in the pane with the one you want.

  3. Click Save. The new value displays in the pane and at least partially in the Value column above.

    Variable Watcher with large edit pane in the Run window The Expanded Edit pane in the Variable Watcher

Adding or Removing an Item from a List or Property List

If your script includes a list or property list, you can add or remove an item from it using the plus (+) or minus (-) buttons below the Variable Watcher pane. The buttons remain disabled until you click within a list or property list. For more information about using lists, see Lists. For more information about using property lists, see Property Lists.

Adding a List Item or Property

To add a new item to your list or property to your property list, follow these steps:

  1. If you see only the name of the list or property list (like suitePath shown in the screen below), click the disclosure triangle to display its list items or properties. The + button is disabled when the selected list or property list is closed, or it applies to the parent list or property list if any.

  2. Select the appropriate row in the Variable Watcher for where you want to add the new item. The following describes what to select depending on where you want the row inserted:

    • Lists: If you select the row containing the name of the list, the new item is inserted as (item 1) at the top of the list as shown in the screen below. If you select any other item in the list, the new item is inserted underneath the selected item with the name (item x), where x is the number of the item in the list. This also applies to nested lists.

    • Property list: Regardless of what row you select in a property list, the new item is inserted into the list where it fits alphabetically.

    • Click the plus (+) button.

    • If you are adding a new list item, the item is inserted into the Variable Watcher pane. Note that the new item has a name (item x) but not a value.

Variable Watcher with new list item inserted Variable Watcher with a new list item inserted in a list* If you are adding a new item (property) to a property list, the Add Property to dialog box, shown below, opens for you to add your new property name. Note that suitePath shown in the screen below will be the name of the property list you selected and to which this new property will be added.

Enter the name you want for your new property and click OK.

Add Property dialog box The Variable Watcher Add Property to property list dialog box

  • Add a value for your new list item or property by placing your cursor in the Value column to the right of your new item, entering the value you want, and pressing Enter. The value is now saved for your new list or property list item.

Removing an Item from a List or Property List

To remove an item from a list or property list, select the item and click the minus (-) button.