Maximize your coverage with test parameterization and data-driven testing

Simple non-intrusive offer, pillar, blog, or a guide
Learn More

When you test application logic and functionality you often have to test the same logic with multiple input values, which can quickly escalate the number of test cases you have to create. 

Data-driven testing helps you quickly execute the same test multiple times using datasets for different output values, saving you time and effort. Test parameterization is a type of data-driven testing that allows you to execute the same test, multiple times using different parameters. 

Xray Cloud has a parameterized tests feature, that executes the same test with different input values, multiple times, without ever having to clone or replicate it. With this feature, you can minimize repetitive test cases, save time on execution and increase your test coverage. 

Let’s explore how you can optimize your efforts with data-driven testing and test parameterization.

 

What is data-driven testing? 

Testers frequently have multiple data sets for 1 test but creating individual tests for each data set takes time and effort. With data-driven testing, you can keep data separate from tests and execute different combinations of test data to generate results efficiently. 

You can quickly define a large number of tests with different output values and reuse your data sets. Data-driven testing increases your coverage, eliminates repetitive tests, and most importantly saves significant time on test execution. 

 

Benefits of data-driven testing and test parameterization

  • Tests are easier to understand, maintain and manage
  • Execute the same test several times with different inputs which reduces test cases you have to create
  • Reduces manual effort on execution
  • Time efficient, saving time on creating repetitive test cases
  • Better organization of tests and results 
  • Reduces duplicate and redundant testing

 

When to use data-driven testing and parameterization

Data-driven testing helps save time and effort if you have multiple variations of the same case and workflow and want to increase the coverage by creating different scenarios. 

Data-driven testing works best for scenarios where you want to test application logic and or functionality. Examples of this include: shopping cart logic where coupons and discounts are applied, user login and management where users have different permissions, and ticket buys.  

 

Data-driven testing and test parameterization in Xray Cloud

Parameterized tests in Xray are defined just like any other test with the addition of some parameter names within the specification. With test parameterization, you can execute the same test 3 different times using the 3 iterations and have just 1 test. 

Parameters are embedded within the test specifications using the notation: ${PARAMETER_NAME}

Parameters, along with their values, are defined within a dataset. A dataset is a collection of data represented in a table, where every column of the table represents a particular variable (or parameter), and each row corresponds to a given record (or iteration) of the dataset.

The number of rows in the dataset determines the number of iterations to execute. If the dataset contains a single row, there will be a single execution parameterized with the values defined on the dataset row.

In Xray Cloud, there are two different types of parameters that you can have: 

  • Text - where the parameter value will be set using an open text field.
  • List - where the parameter value can be selected from a predefined list of options. 

List parameters can be created using either ad hoc or predefined lists. Some examples of predefined lists include: Profiles, Users, Roles, Colors, Credit card types, addresses, etc. 

Note: In Xray Cloud, you can create predefined lists in order to use the list parameters in multiple datasets, saving you time. If multiple projects make use of the same list, you can also create a global list so that it can be used by different projects. This way you have a central place to manage common parameter lists.

 

Take advantage of data-driven testing in Xray Cloud

Data-driven testing amplifies your efforts so you can test large sets of variations, quickly and efficiently. With the newest release of Xray Cloud, you can take advantage of test parameterization and data-driven testing right away. 

Test parameterization keeps your testing organized and clean, so you can focus and work faster and more efficiently. 

Learn more about data-driven testing and test parameterization in Xray Cloud.

Xray Academy: Take our course "Parameterized Tests and Data-Driven Testing for Xray Cloud" and learn how to make the most out of test parameterization, data-driven testing, and data sets. 

Comments (0)