Lesson 6: Abstracting data by using a dataset

When you record a test, you perform a sequence of steps that you expect a user to perform. When you run this test, it uses the same data that you used during recording. However, in a real-life scenario, although a user might follow the same steps, the data that they enter into the application might be different at different point of time. To vary the data in the test, you use a data pool, which contains variable data. At run time, this variable data is substituted for the actual data in the recorded test.

About this task

For this tutorial, you recorded a test in which you searched for ‘HCL OneTest Studio’ and saw pricing. Now, you will create a dataset that will consist of HCL OneTest UI, HCL OneTest Performance, and HCL OneTest API. When you run the test, it will also search for these products.

Procedure

To create a dataset:
  1. In the Test Navigator view, right-click myProj and click myProj > New > dataset
  2. In Name, type Productsdataset and click Next.
  3. In Variables (or columns), type 1 for product name.
  4. In Records (or rows), type 3 and click Finish. You entered 3 because your dataset will contain three products in three rows.
  5. You are asked whether to open the dataset editor. Click Yes.
  6. In the dataset editor, click Variable1:String and change the column name to ProductName.
  7. Click each cell and enter data so that your dataset looks like this:dataset
  8. Press Ctrl + S to save the changes.

Results

After creating dataset, you must associate it to the test so that you can substitute the recorded values with the values from dataset.