Test parameterization

Add to your test cases parameters, which means tests variables. And during the execution, each parameter creates a new particular test. Test case execution is like on the parallel mode.

 

 

Test Case Parametrization Test Management

Test data is the backbone of a good software testing process. Test data reflect data that a real customer would enter into your app or platform. Thus, test data should fit for testing your purposes and be complete and suitable for the specific test scenario.

If your data set is not quality, that can cause a lot of bugs and faults in production. So the best thing to do is to care about your test data set before and change it in time to avoid the Pesticide Paradox (7 Principles of Software Testing).

One of the best practice test frameworks consists in shifting test data into separate classes, files and other entities because maintaining test data is much easier. Moreover, defining these data as values for tests.

Test management system testomat.io supports the possibility specify these values as parameters for tests. It is a powerful practice to improve your testing scenarios. Test management parametrization works:

  • Automated tests
  • Manual testing
  • BDD Scenario Outline

What is Test Parameterization?

The concept of parameters in testing is simply that you can pass a parameter into the test with multiple values. Practically by defining a parameter you can define multi variables tests. During the execution of a test case, the parameters are filled in with their actual value, so a parameterised variation of the original test case is produced.

The main benefits of parameterization are that you can automatically run multiple variations of each test. If a test case has multiple values provided that will cause several runs of the same test for each variation of the parameters. In our test management solution, the concept of parameterization matches the data-driven-testing approach. Parameterization is required to create Data Driven Testing.

Why Data Driven Testing?

Data Driven Testing is important because testers frequently have multiple data sets for a single test and creating individual tests for each data set can be time-consuming. Data-driven testing helps keep data separate from test scripts as we mention at the top and the same test scripts can be executed for different combinations of input test data and test results can be generated efficiently.

Parameterization implementation with manual testing

Providing parameter values as a table. The table rows are used as values for each test. Test management replaces each parameter value in tests. Practically by defining a parameter you can define multi variables tests. This means that when running a test case it will be run multiple times: once for each value row in this table. The test engine will automatically move forward in the table and will use the next row for each next run. Absolutely correct when running manual parameterised tests the test runner will create new abstracted tests and you can check the test result for each of them.

If you create script functions manually, you should add the parameter yourself.

The values of the parameters can be provided on each test case when editing it Hover the call test step and click on the dataset icon located in the actions toolbar. The dataset toolbar will appear.
If there are already parameters defined on the called test, then you can add these parameters using the “Add Parameter” button.

Parameterization implementation with automated testing

When running automated parameterised tests the test runner also automatically recognizes the parameter’s values inside the testing framework and will create new tests. Automation QA engineers are able to check their parameters in the Run report. There they are displayed as an array.

Test parameterization JavaScript, Php, Python, Java, Ruby, CSharp. The script function iterate through the data set to get a parameter.

In Automation testing, parameterized tests are extremely useful when you need to test a series of inputs against the same functionality.

Parameterization implementation with BDD tests

In BDD tests, you parameterize test steps, not scenarios or features. That is, you set parameters for the Given, When, and Then elements and their extenders – the And and But lines. Our test management automatically treats values it finds in step descriptions as parameters. So, to write a scenario template you can use either the Scenario Outline keyword. To specify a parameter, you simply enclose some values in quotes. You can see your parameters in the Scenario Code tab.

It is considered to be a good practice to run tests with different input data to check if the tested application checks incoming values in a proper way.

For example, if your application has a Registration form, you may want to submit different combinations of user names, passwords and emails to check the form behavior. To test that form thoroughly, you can pass both valid and invalid values to it. Test parameterization and data-driven testing maximize your test coverage.

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