Skip to main content
Version: 23.5

Resources Pane

The Resources pane appears in the lower left corner of the Suite window. Add any files you want to store with your suite in this pane. For example, if you use data-driven tests, add the comma-separated values (CSV) files for those tests in the Resources pane.

As a best practice, store any files referenced within a script in the Resources pane and not on the local file system. That way you can share suites, including any files stored in the Resources pane, with Eggplant Functional or Eggplant Manager applications installed on other systems.

The following example and graphic shows you how to use the Resources pane to make a script more portable.

  1. Notice the line of code located next to callout 1 in the above graphic. Here the SenseTalk script calls the myTestFile.txt file that is located on the local file system. If that same file is not located on the local file system of a system to which you want to copy this suite, the script will not function correctly.
  2. In the Resources pane, shown next to callout 2 in the above graphic, the myTestFile.txt file is also located in the Resources pane.
  3. In the SenseTalk script, next to callout 3 in the above graphic,the SenseTalk script calls the myTestFile.txt file using the ResourcePath("myTestFile.txt") syntax. See ResourcePath Function for more information.

The suite containing this script and the myTestFile.txt file can now be copied onto another system and function correctly without you needing to copy the myTestFile.txt file to the local file system.

Example of using the Resources pane:

For this example, consider that you have an Excel file, MyCustomers.xlsx, that stores customer information:

You have a SenseTalk script, located in a suite named CustomerSuite, that updates the MyCustomers.xlsx file:

set fileToRead to "MyCustomers.xlsx"
set myExcelDB to (type: "excel", file: ResourcePath("MyCustomers.xlsx"))
set myRecords to the records of myExcelDB

Repeat for each item of myRecords--iterate through the table
put the "company name" of it into myCompany
put the "contact name" of it into myContactName
put the "contact title" of it into myContactTitle
put the "billing address" of it into myAddress
put the "city" of it into myCity
put the "state or province" of it into myState
put myCompany
put myContactName
put myContactTitle
put myAddress
put myCity
put myState
put " ------------------"
end repeat

Notice that the second line of the script shown above references the MyCustomers.xlsx file using the ResourcePath function. For this script to function correctly, you must complete the following steps to add the MyCustomers.xlsx file to the Resources pane:

  1. Open a Suite window for the CustomerSuite. See Suite Window for more information.
  2. Click inside the Resources pane.
  3. Right-click, then choose Add from the pop-up menu to open a file browser.
  4. Select the MyCustomers.xlsx file and follow the interactive instructions.

The script can now access the MyCustomers.xlsx file, located in the Resources pane, and process that information as shown below:

closed

Adding or Removing Resource Files within a Suite

Use the information in this section to add files to or remove files from the Resources pane within a suite.

Step by Step: Adding a File or Files to the Resources Pane

  1. Open the suite window to which you want to add the file. See Suite Window for more information.
  2. Click inside the Resources pane.
  3. Right-click, then choose Add from the pop-up menu to open a file browser.
  4. Select the file you want to add to the resource and and follow the interactive instructions.
note

The Eggplant Functional application creates the Resources directory when you add your first file in the Resources pane. When you add a file in the Resources pane, Eggplant Functional saves a copy of the file directly in the Resources subdirectory of the currently open suite directory.

Step by Step: Removing Resource Files from a Suite

Use the steps shown below to remove a file from the Resources pane.

  1. Open the suite window to which you want to add the file. See Suite Window for more information.
  2. Click inside the Resources pane.
  3. Right-click the file you want to remove.
  4. Select Delete and follow the interactive instructions to remove the file from Resources pane.

Step by Step: Opening files from the Resources Pane

Use the following steps to open a file from the Resources pane within a suite.

  1. Open the suite window to which you want to add the file. See Suite Window for more information.
  2. Click the file in the Resources pane that you want to open.
  3. Right-click that same file, then select Open.
tip

The Eggplant Functional application opens the selected file with the application associated with its file type. For example, if you have data in a text file with a .txt extension, Eggplant Functional might open it with Notepad.exe on Windows.

Step by Step: Searching your existing Resources

Use the following steps to search for a specific resource in your suite:

  1. Open the suite window to which you want to add the file. See Suite Window for more information.

  2. Type part of a resource name in the search field above the Scripts list.

    note

    This search function searches all the panes in the left sidebar simultaneously.

  3. Optional step: To set a search filter, click the magnifying glass beside the Search field and choose Search All, Search Names, or Search Contents from the drop-down list.

tip

The search works as you type, so you might find your results before you finish entering your search term. However, if you have searches that you frequently repeat, you can save your search as an item in the Search History by pressing Return after you type the term. Your search is saved on the drop-down list under the magnifying glass.

For complete information about using the search and replace function in the Suite window, see Using the Search Filter.