Creating Scripts with Eggplant Functional
Scripts are the basis of your automated testing with Eggplant Functional (EPF). Scripts are created using a language called SenseTalk, an English-like scripting language for controlling your system under test (SUT). Scripting with Eggplant Functional is easy, and a variety of script creation workflows are possible. Read on to learn about the different approaches to script creation, and find the approach that works best for you and your team.
The Suite window and Viewer window are essential to script creation. The Suite window is where all of your scripts and images are managed, and the Viewer window is where you capture your images for use with your scripts. You can capture images manually, by using Turbo Capture, or by using assisted scripting.
Additional methods of searching for elements on the SUT are available, including OCR (Optical Character Recognition) for reading and finding text, and Find by Description which uses an AI model (LLM) to search for elements based on a description that you provide.
Suites
Before you can create your first script, you must create a suite. Eggplant Functional organizes and stores your scripts, images, results and schedules in folders called suites.
To create a new suite, choose File > New Suite in Eggplant Functional. This opens the Suite window with the Guide page by default. For information about the Suite window and how to use it, see Suite window.
Eggplant Functional creates each suite folder with the following subfolders by default: APITests, Features, Images, Resources, Results, Scripts, and TableScripts. You can use the Default Suite Directory General Preference to specify the location where you want Eggplant Functional to create your suite folders. When you create your scripts and save them, Eggplant Functional stores them in the suite's Scripts subfolder. After you run a script or scripts, Eggplant Functional stores the results and information about the run in the suite's Results subfolder.
Scripts
Before scripts can be arranged into larger tests, they must be created using Eggplant Functional, using one of the script creation workflows:
- Assisted Scripting: Use the toolbar icons in the Viewer window to insert actions into a script.
- Turbo Capture: Record your interactions with a live SUT, then create SenseTalk code to reflect those actions.
- Autosnippet Generation: This workflow creates short script pieces that can be used as handlers or snippets. It's optimized for use with Eggplant DAI, but you also can use it to make your scripts more modular, which is an Eggplant Functional best practice.
- Manual Script Creation: Write SenseTalk code in the Script Editor.
After scripts have been created, they can be combined to create larger tests, and these script structures can be managed using a primary script, using Eggplant DAI, or with keyword-driven testing. If you've generated snippets, you can integrate them with Eggplant DAI.
SenseTalk
SenseTalk is an English-like scripting language, which is used to write Eggplant Functional scripts. For more information on SenseTalk, see the following:
Methods for Interacting with Elements on the SUT
Eggplant Functional is a visual testing tool. There are multiple methods that you can use to search the screen of your SUT for elements to interact with:
- Find by Description: Search for elements on the SUT screen by providing a description of the element to an AI model.
- Image Capture: Capture images of the SUT screen to then search for or interact with using SenseTalk.
- OCR: Use optical character recognition (OCR) to search for or read text on the screen of the SUT.
If you are able to utilize its features, we recommend that you start your automation journey using Find by Description, as it provides the most intuitive scripting experience. Please note that use of this feature may incur additional costs in the form of tokens through your AI provider. For more information on tokens, see AI Model (LLM) Token Usage.