Datasets
Datasets can be used to swap test data quickly between runs and to manage sensitive test data securely.
Creating and using datasets
In Editor Tab, click on the "Dataset" dropdown on the "Result" Pane Toolbar, and "Add Dataset" option to create a dataset.
![Add dataset](https://d33wubrfki0l68.cloudfront.net/63b1ab505807be699562d251aa1066e4990ef53d/b4213/images/dataset-add-dataset.png)
Enter a name for the dataset, e.g. "Production".
![Name the dataset](https://d33wubrfki0l68.cloudfront.net/b3399712d20318c45103c6a399b7e2fb0c27dde5/d2765/images/dataset-name-dataset.png)
To add a property to the dataset, enter the property name and value, and press "Add".
![Add a property to the dataset](https://d33wubrfki0l68.cloudfront.net/0d99380cbe47ab8179cc63124e941eba5ac96878/b8eda/images/dataset-add-properties.png)
Save the dataset. You should see the new dataset in your "Dataset" dropdown.
![Dataset added](https://d33wubrfki0l68.cloudfront.net/f087cd80e7344dfc29baa9b01eff507587b819e6/53860/images/dataset-added.png)
When a dataset is selected, the properties and values will be loaded to the DATA
object. You can reference the properties in the dataset like this:
I.goTo(DATA.url);
I.click("Sign In");
I.fill("Email", DATA.email);
I.fill("Password", DATA.password);
I.click("Sign in");
I.see("Incorrect password");
Select a dataset and run the test, the values from the selected dataset will be used during the run:
Selecting the "Production" dataset created, these are the values that will ran with the test:
I.goTo(DATA.url); // DATA.url will be set to "https://netflix.com"
I.click("Sign In");
I.fill("Email", DATA.email); // DATA.email will be set to "[email protected]"
I.fill("Password", DATA.password); // DATA.password will be set to "supersecretpassword"
I.click("Sign in");
I.see("Incorrect password");
Securing sensitive test data
You can manage sensitive test data such as passwords with secret properties in Datasets. The values of secret properties will be masked in the dataset editor and in the test run report so that you can share them without revealing sensitive test data.
When adding a property, change the visibility of the property from "Visible" to "Secret". Let's set password to "Secret".
![Setting secret dataset properties](https://d33wubrfki0l68.cloudfront.net/1c6a26b28b1463a6ee77cfd92a31159ecb6e2902/c3469/images/dataset-secret-properties.png)
Secret properties are masked in the test run reports.
![Secret properties are masked in reports](https://d33wubrfki0l68.cloudfront.net/f6995b8bf582da42bef1f565d6e77e1c9a2fd0a0/f2b0e/images/dataset-run-secret.png)