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.
The Eggplant Functional Resources pane
- 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:
An Excel file with 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