Skip to content

Using the Test Data in your Automation

How to Use Test Data in a Case?

Once test data is associated with a Case/Suite, it can be used in automation workflows.

Steps to Use Test Data in a Case:

  • Open the Case where you need to use test data.
  • Use the exact variable names defined in the test data (case-sensitive).
  • Reference test data variables in your automation script using ${VariableName} syntax.

Usage Example: Suppose you want to enter an Employee ID into a form field dynamically using the test data associated with the case. Instead of manually entering an ID, we will retrieve it from the Employee Test Data set.

Steps to configure:

  1. Open the Case where you need to use the test data.
  2. Add a new step and select Enter Data from the Action dropdown.
  3. In the Screen Name field, select the relevant screen where the Employee ID field exists (e.g., “Employee Form”).
  4. In the Element Key field, choose the field where the value should be entered (e.g., “EmpID_Input”).

Note: Ensure that the Screen Name and Element Key locators are already defined before using them in the automation steps.

  1. In the Parameter section, enter the variable name for the Employee ID as: ${EmployeeID}
  2. Click Save to store the configuration.
scrn-enter-variable-name-in-parameters-tabular-view
Tabular View
scrn-enter-variable-name-in-parameters-card-view
Card View

Expected Outcome: When the automation runs, the Employee ID field on the form is dynamically populated with the value from the test data set.

Note: Similarly, you can use other test data values like Name, Department, or Salary with different commands such as Click, Select, or Validate etc. by referencing their respective variable names (e.g., ${Name}, ${Department}). Variable names defined in the manage test data section should be exactly same when used in the steps.

Data Driven Testing

Data-driven testing allows test cases to run multiple times using test data. If a test case is linked to multiple values for each variable, it will execute the same number of times as the number of values available.

Usage Example: Processing Multiple Employee Records

Suppose you have already defined Employee_Test_Data with multiple values for each variable as shown in the following screenshot. The test case will execute once for each set of values, ensuring all records are processed dynamically.

scrn-employee-test-data-with-multiple-values
Employee Test Data with Multiple Values

Steps to configure:

  1. Open the Case where you need to use the test data.
  2. Add a new step and select Enter Data from the Action dropdown.
  3. In the Screen Name field, select EmployeeForm.
  4. In the Element Key field, choose EmpID_Input for the Employee ID field.

Note: Ensure that the Screen Name and Element Key locators are already defined before using them in the automation steps.

  1. In the Parameter section, enter ${EmployeeID}
  2. Click Save.
scrn-data-driven-testing-enter-employee-id-tabular-view
Tabular View
scrn-data-driven-testing-enter-employee-id-card-view
Card View
  1. Similarly, add another step for the Name field with the following values:
    • Screen Name: EmployeeForm
    • Element Key: Name_Input
    • Parameter: ${Name}
  2. Add another step for the Department field with the following values:
    • Screen Name: EmployeeForm
    • Element Key: Department_Input
    • Parameter: ${Department}

After adding these steps, the Automation will look like this:

scrn-data-driven-testing-after-adding-steps
Tabular View
scrn-data-driven-testing-after-adding-steps-card-view
Card View

Expected Outcome:

  • The test case will execute three times, each time with a different EmployeeID, Name, and Department.
  • The script dynamically inputs values from the test data and processes multiple records efficiently.

Back To Top