🔄 Swap out test data in UI-licious with Datasets!
Tags: uilicious, releasenotes, testing, webdev
Published: 2019-02-14 04:15:16

---
title: 🔄 Swap out test data in UI-licious with Datasets!
published: true
description: Setup secure datasets for different environments and user roles
canoical_url: https://uilicious.com/blog/swap-out-test-data-in-ui-licious-with-datasets/
tags: uilicious, releasenotes, testing, webdev
---

![run-with-dataset.gif](https://thepracticaldev.s3.amazonaws.com/i/rgefcjppjw8if31e4k3l.gif)
<figcaption>Swap out test data with Datasets!</figcaption>

Happy Valentines, everyone!

This is our first release note of the new year, and we're happy to announce the release of Datasets for [UI-licious Studio](https://uilicious.com/)!

Datasets lets you configure different sets of test data to run a test with.

It's useful when you want to:

* Setup tests for different **environments** e.g. staging, production
* Test the same user journey but for different **roles**
* Store **sensitive** test data like passwords that cannot be written in plain text in the test scripts, and also mask them in test reports.

*(Note: Datasets is only available on the professional edition of UI-licious Studio. You can [run public tests for free](https://snippet.uilicious.com/test/public/1VBEfXDTJYacreZWGcahGV) on UI-licious Snippets.)*

---

## Setting up and using Datasets

Datasets work by populating in the `DATA` object in your tests.

Let's use this test for logging into Salesforce for example:

```javascript
// Login to Salesforce
I.goTo("https://login.saleforce.com/")
I.fill("Username", DATA.username)
I.fill("Password", DATA.password)
I.click("Log in")

// Verify that user is logged into the correct instance of Salesforce
I.amAt(DATA.url)

```

We'll set the `username` and `password` to log with, and `url` for the instance that user is expected to be directed to for each test run using a dataset.

Let's add a dataset (right beside the "Run" button):

![Screen Shot 2019-02-12 at 4.07.53 PM.png](https://thepracticaldev.s3.amazonaws.com/i/r86hyye3c9z5ejvwwctr.png)

Give your dataset a name "John Doe", and add the `username` property and value as below:

![2\. add-dataset-username.png](https://thepracticaldev.s3.amazonaws.com/i/8l2h1a3kgluqz95plp9x.png)

Add the `password` property and its value as below, but remember to check mark it as a **secret** if you want to mask its value in the test reports.

![3\. add-dataset-password.png](https://thepracticaldev.s3.amazonaws.com/i/dnofknslvht1lv6na2el.png)

Finally, we'll add the `url` property and it's value.

![4\. add-dataset-url.png](https://thepracticaldev.s3.amazonaws.com/i/ileptg5otbykm92ga33q.png)

Now, let's run the test with the "John Doe" dataset, and voila!

![5. run-dataset.png](https://thepracticaldev.s3.amazonaws.com/i/moi3i43py2uqpk10d0pw.png)

```
1. I go to "https://login.salesforce.com/" ------ 2.3s SUCCESS
2. I fill "Username": "johndoe@uilicious.com" --- 5.9s SUCCESS
3. I fill "Password": "[truncated]" ------------- 1.8s SUCCESS
4. I click "Log in" ----------------------------- 6.1s SUCCESS
5. I am at "https://ap4.lightning.force.com/" ---      SUCCESS
```

The value of `password` has been masked in the result because it is set as a secret property in this dataset.

---

# What's else is new and improved?

For the past months, we've also been focusing on making performance improvement, and developing new features for the test engine so that you can create more elaborate and readable tests.

## 🚀 Test engine

* Drag and drop commands:
  * `I.dragTo` - Drag an element to another target element.
  * `I.dragBy` - Drag an element in a direction using (x,y) pixel offset.
  * `I.dragUp`, `I.dragDown`, `I.dragLeft`, `I.dragRight` - Shortcuts for I.dragBy
* `I.getValue` - Reads and return the value of an input field. This allows you to extract the value of an input field and set it to a variable.
* New scroll commands for convenience - `I.scrollUp`, `I.scrollDown`, `I.scrollLeft`, `I.scrollRight`.
* Error suppression - For all I and UI commands, you can suppress the error with the `$` variant of the command - e.g. `I.see$("Flying pigs")`. This may be useful when you want so suppress the errors for commands used as conditional expressions in if/else blocks.
* Error and log suppression - For all I and UI commands, you can suppress the error and logs with the `$$` variant of the command - e.g. `UI.execute$$(...)`.
* `UI.context` can now be used to explicitly switch the context to an iframe. This is useful in cases where security policies on the web application or on specific browsers prevents UI-licious from normally being able to access and evaluate the contents of iframes and test it.

See the [list of commands](https://docs.uilicious.com/scripting/list_of_commands.html).

## 📈 Reports
* Better logs to indicate errors in the test script itself.
* Improved the performance of retrieving the status of the jobs on the monitoring dashboard.
* `UI.execute` now prints out a snippet of the script to execute to make the test reports and flow easier to understand. And you may also override the log message for UI.execute.
* Added duration to test run reports sent through webhooks

---

## Thank you!

A great big thank you to users who have kindly lent themselves to beta test this new feature and trying to break it and giving us comments on improve the user experience!

## Feedback?

We always love hearing feedback from users, and finding out the sorts of creative things people are doing with UI-licious, so feel free to drop us a note at support@uilicious.com!