You can always create scripts manually from scratch by creating a new Eggplant Functional script in the Script Editor and writing your own SenseTalk code. In addition, after you generate code through one of the methods described above, most scripts will require some further organization and editing, which you can also accomplish in the Script Editor. For more complex workflows, manual SenseTalk scripting is required.
There are several ways to insert commands and images into a script:
- Type commands, functions, and image names in the Script Editor.
- Choose commands from the Control menu.
- Choose commands from the Insert drop-down list on the Script Editor toolbar.
- Use the SenseTalk Browser in the right sidebar of the Script Editor to find and insert commands, functions, and code snippets.
- Copy, cut, and paste with the Edit menu or associated keyboard shortcuts.
- Drag image, script, suite, and SUT names into the Script Editor from other windows.
The Script Editor includes a code completion feature. When you have typed at least one character in the Script Editor, auto-completion attempts to finish your current word. Suggested completions include variables, commands and functions, and names of scripts or images from your current suite.
Suggested word or code completions appear in a pop-up box:
To select an item from the list of options, you can use your arrow keys, your mouse, or keep typing until the item you want is the first in the list. (Note that, by default, the first item is selected for you.) To insert the selected item, hit Tab (the default choice) or Enter. Note: To change auto-completion preferences, go to eggPlant > Preferences, and select the Completion pane on the Scripts tab.
The bottom part of the auto-completion pop-up box shows you what will be inserted for each option. Note that you can insert blocks of code with this method, such as if/then/else structures or repeat loops. In such cases, the inserted code typically has variables or tokens that you will need to replace with the specific values appropriate to your script, as shown below:
If you don't want to use any of the suggested auto-completion options, you can just keep typing, or press Escape to dismiss the pop-up box. Remember, you can use the preferences settings to control what items are suggested and other details about how auto-completion works.
Auto indenting puts tab or space characters inside control structures to make scripts easier to read. (Control structures include handlers, repeat loops, if/then/else and try/catch commands.)
By default, the Script Editor updates indentation when you press Return or Tab. (You can change this behavior in Script Editor preferences.)
By default, each type of script element (such as command, variable, and image name) is written with a different color in the Script Editor. This can make it easier to track what is happening in the script.
If you use incorrect syntax (that is, code that doesn’t make sense to Eggplant Functional) the entire line or block that contains the error is not colored; this is a visual cue that there is a problem in the script.
Colorization can be customized extensively in the Script Editor preferences.
The Edit and Format menus contain many of the features you find in word processors. Use these menus for standard editing tasks such as finding text, cutting and pasting, and changing font styles.