Managing Data
There are two data structures managed by the Shared Data Server:
Saving and Loading Data
All data stored in the Shared Data Server can be saved to a file. The data is stored in a .pcl
file using Python's pickle format.
- To save data, select File > Save Data (
Ctrl+S
) or File > Save Data As. - To load data, select File > Open (
Ctrl+O
)
Data loaded using the File > Open option replaces all keys, values and lists currently stored in Shared Data Server.
Saved Data Location
If the Shared Data Server application was started with the workspace and project names passed as parameters (which happens automatically when launching from Studio or Test Controller), then the default location for saved data will be:
<workspace folder>/projects/<project name>/data/<project name>.pcl
When the Shared Data Server application is launched, it will load data from the .pcl
file most recently saved.
Importing and Exporting Lists
Data stored in shared lists can be imported or exported using .csv
files.
- To export all shared lists, select File > Export shared lists to CSV
- To import data into shared lists, select File > Import CSV file to shared lists
Unlike opening a .pcl
file, importing shared lists does not remove other data from the Shared Data Server. Any lists whose keys match those in the .csv
file will be replaced with the values from the .csv
file, but any other lists will remain as they are.
CSV File Format
This information may be useful for reading the .csv
files exported by Shared Data Server, or for constructing .csv
files to be imported into Shared Data Server.
The first line in the .csv
file (the heading line) contains the names of the lists.
Each other row contains the nth value in the list, so the lists effectively appear in columns.
key_1 , key_2 , key_3
value_1a , value_2a , value_3a
value_1b , , value_3b
value_1c , ,
The example above uses spaces to pad the .csv
file so it is easier to see how the list keys and values are stored. However, a .csv
file would usually be stored more compactly, e.g.:
key_1,key_2,key_3
value_1a,value_2a,value_3a
value_1b,,value_3b
value_1c,,
For example, importing the following .csv
file will result in three shared lists: Animal
, Mineral
, and Vegetable
.
Animal,Mineral,Vegetable
horse,bauxite,cabbage
dog,granite,leek
In Shared Data Server:
Key | Value |
---|---|
Animal | horse , dog |
Mineral | bauxite , granite |
Vegetable | cabbage , leek |