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 (EPF) 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.
- 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. - In the Resources pane, shown next to callout 2 in the above graphic, the
myTestFile.txt
file is also located in the Resources pane. - 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:
- Open a Suite window for the
CustomerSuite
. See Suite Window for more information. - Click inside the Resources pane.
- Right-click, then choose Add from the pop-up menu to open a file browser.
- 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:
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.