- getting started
- Get Started with Automating Web Applications
- Get Started with Automating Mobile Web Applications
- Get Started with Automating Android Apps
- Get Started with Automating iOS Apps
- Get Started with REST API Testing
- test cases
- web apps
- How to create web application tests using Test Recorder
- How to create Test Steps for uploading files
- mobile apps
- How to create Android & iOS app tests using Test Recorder
- How to automate Android app tests using local devices
- How to automate iOS app tests using local devices
- How to automate data driven testing
- REST API
- What is JSONPath and How to query JSON using JSONPath
- Contract Testing with Testsigma
- Consumer Driven Contract Testing with Testsigma
- test plans
- How to create test plans to run on your local devices
- How to do cross-platform end-to-end testing with Testsigma
How to do data-driven testing
This tutorial walks you through data-driven testing and how to enable it in the test case. This can involve using external test data profiles as a source within the project to drive its behaviour. The goal is to increase the effectiveness and efficiency of testing by automating repetitive tasks and ensuring comprehensive test coverage. In Testsigma, you can
- The test data and expected output data can be imported or read from external sources.
- Using this data, you can avoid hardcoding the test data into the Test Steps definition in your automated test cases.
Test steps iterate and feed subsequent rows of data into them as input.
Prerequisites
You'll need to know how to create a test cases, test data profile, and runtime variable.
Enable Data-Driven in test case
- On the Create or Edit test case page, click on Show additional options to unhide the features.
- Select the Test data profile from the drop-down menu and turn on the Data driven toggle.
Enabling the data-driven toggle will allow the test to run multiple times based on the number of rows in the Test Data Profile. If the data profile has five rows (sets), the test will run five times automatically, using each data set (row) every time.
You can also select a specific dataset if you want to run the profile only once, using data from that dataset.
Data-driven testing allows you to narrow and customize your test case using filters like iteration, set name, and parameter.
- Iteration: This type of filtering applies only to sequential data sets. The data sets can be filtered using the filter operations greater than, less than, and between.
- Set name: This type of filtering applies to non-sequential data sets. Here, the data sets are filtered by their names using the operations between, equals, contains, starts with, and ends with. Any data set names containing the set name, or part of it are used in the test case.
- Parameter: This type of filtering applies to non-sequential data sets. Here, the data sets are filtered using parameters used in the data sets. Here, filter operations are using Equals, Contains, Start With, Ends With, Is Empty, and Is Not Empty.
- Click Create or Update once the data driven is enabled.
You can use runtime variables in filter values by entering $|Washington, DC|, where Washington, DC is a stored variable, as shown in the example above.
Use parameter names in test case
- Click on test data and select @|Parameter| from the drop-down list when creating test steps in the test case.
- An overlay screen will open, displaying all available parameters in the test data profile.
Now, your test case will use the parameter value from your test data profile.
Run Data Driven Test Case
- Click on Run Now in the top right corner, and the Ad-hoc Run screen will appear. Select the test machine/device and click Run Now.
- Once the test run is complete you will get results for each of the data sets.