Skip to main content

Editing a SenseTalk Script

After you open a suite, you can start editing the SenseTalk scripts in your test suite. For those who aren't familiar with VS Code, when it is combined with Eggplant Studio there are a myriad of editing features which help you to create and edit your SenseTalk scripts.

Opening a script file

Opening a file in VS Code is quick and easy due to VS Code's intuitive user interface.

  1. Ensure your test suite is open. If needed, please skip back to the previous pages for details of how to open a suite
  2. Select the file icon in the top left of the application to reveal the file explorer tree. (In the screenshot below, the file icon can be seen in the black bar on the left hand side of the image.)
  3. Click on the file you wish to open.

Opening a file

Editing a SenseTalk script

Eggplant Studio contains a wealth of features to help you extend and maintain your SenseTalk scripts. Here are a few examples of how using Eggplant Studio can enhance your SenseTalk script editing experience.

  • SenseTalk syntax highlighting, including folded code
  • auto complete image and script paths in your SenseTalk script
  • display an image preview when hovering over an image path in your SenseTalk script
  • extends VS Code's Intellisense to provide code completion suggestions for SenseTalk
  • auto closing a properties block
  • auto code indentation in your SenseTalk script, while ignoring auto formatting of code that has been commented out
  • add an image path to your SenseTalk script by clicking the image and then holding the shift key before you drag it into your script
  • preview script documentation and definitions while you're editing your SenseTalk
  • extract a custom selection into a new script and automatically include references to relevant script params
  • extract a custom selection into a new handler in the same script
  • automatically rescope global variable after extracting them to new script or handler

Code completion suggestions for SenseTalk

Creating a new script file

If you are not familiar with VS Code, you may be wondering how to create a new script file in your test suite. Fortunately, this process is very simple.

  1. Ensure your test suite is open. If needed, please skip back to the previous pages for details of how to open a suite
  2. Select the file icon in the top left of the application to reveal the file explorer tree. (In the screenshot below, the file icon can be seen in the black bar on the left hand side of the image.)
  3. Right click on the folder you wish to add the new file to. In your test suite, your SenseTalk scripts will probably be located in the scripts folder.
  4. Select New file from the context menu and press enter.

Creating a new script file

Running lines of your script

Eggplant Studio leverages VS Code's ability to run lines of your script on a line by line basis. Before you're able to run or debug your script, you will need to have installed Eggplant Functional (EPF) on your local machine and connected to your System Under Test (SUT).

We are going to discuss running a script later stage of our walkthrough, but first we will look at how to capture images to use in your scripts.

Customizing your editor layout

VS Code provides a flexible development experience, which includes arranging open files using different configurations. If this is something you are interested in trying, please review VS Code's documentation for more details.