Skip to content

Data-driven testing

Data-driven testing runs one test case against multiple sets of input and expected values, so you don’t repeat the test by hand for each data set. For example, a form test recorded with one set of values may pass, while other values would trigger errors. Data-driven runs find those cases.

CloudQA offers four approaches:

  1. A CSV file, with the variable approach or the input fields approach
  2. Random variables
  3. A test suite
  4. An environment-level data file
  • CloudQA runs the first test case using the number of rows entered, then moves to the next test case.
  • You can use a maximum of 20 rows of data.

Use this when only some input fields need different data, for example an email ID and a last name.

  1. In Edit Steps, select the input field and name it __variable name__, with double underscores on each side.

    An input field named as a variable

  2. In the Actions column of the test case, select Custom Execute.

  3. Select Use a CSV file for Data Driven testing, then select As variables.

  4. Upload a CSV file. The header row contains the variable names used in the test, followed by rows of data.

    A CSV file whose headers match the variable names

  5. Select Execute.

Use this when every input field in the test, for example in a “create customer” test, should be tested with different data.

  1. In the Actions column of the test case, select Custom Execute.
  2. Select Use a CSV file for Data Driven testing, then select As input fields.
  3. Download the file template, enter your data and save it.
  4. Choose the file and execute the test.

Random variables supply new values on every run without a data file. See Random variables.

Run a whole suite, or all of its test cases, with different data. You don’t need to turn the setting on for each test case.

  1. In Edit Steps for the test cases, name the input fields __variable name__, as in the variable approach above.

  2. Open the Test Suites tab and create a test suite.

  3. In the Actions column of the suite, select the play button, then select Use a CSV file for Data Driven testing.

  4. Upload a CSV file whose header row matches the variable names, followed by data rows.

    The data-driven option when running a test suite

  5. Select Execute.

Use this when an application has several environments and each needs its own data file.

  1. Replace step values in your test cases with variables, for example __username__ for a username.
  2. Make sure the variables match the headers in your CSV file.
  3. Open application Settings, then Environments.
  4. Select Edit on an environment, upload the CSV file (header row with variable names, followed by data rows) and select Save.

Uploading a data file to an environment

  1. On the Test Case page, select Custom Execute in the Actions column.
  2. Choose the Environment/Base URL.
  3. Select Use a CSV file for Data Driven testing.
  4. If the file was uploaded at the environment level, the Environment Variables File option appears. Select it.
  5. Execute the test case.

Choosing the environment variables file for a test case

  1. Open the Test Suites tab and create a suite.
  2. Select the play button in the Actions column.
  3. Choose the Base URL, select Use a CSV file for Data Driven testing, then select the Environment Variables File option.
  4. Execute the suite.

Choosing the environment variables file for a test suite