Data Driven Testing Simplified!
Data driven testing is a method that is usually employed when an application is tested using a large number of test data.
What is test data? Test Data are input values(valid and invalid username/password combinations or phone number, etc). Here, test data is read from Excel, JSON, properties file or even from plain text files.
Selenium can be used for Data-Driven Testing but it needs additional APIs to read the test data from text files, and a loop statement in the code which in turn increases the complexity.
But Data-Driven testing in Testsigma is as simple as it can get. You just upload the test data file and start using anywhere on your tests. Let’s see how.
Table Of Contents
Running a Data-Driven test in Testsigma
Pre-requisites: We need a valid test data profile which is mandatory for Data-Driven testing.
There are two simple methods to do this:
1. By Creating a test data profile manually
2. By Importing a test data profile
Method 1: Creating a Test Data profile manually
Here is how Testsigma’s dashboard looks like.
Click on ‘Test Development’ and click on the Create icon at the top right corner. Enter the test data inputs, provide a name for the test data profile and click Create.
Method 2: Importing a Test Data profile
To import the test data profile that you created, click on the Import icon in the test data page, provide a name for the test data profile and upload your file.
There is a sample test data file in the link provided with the format to be used. Now, click Create.
If we have the test data profile ready by either one of these 2 methods, we can create a Data-Driven test case in Testsigma.
Click on the plus icon at the left panel.
Now click on the +Test Case(Create a new Test Case) button, enter the name of your Test Case and click on “Take me to a detailed form” link which shows a few more options.
Now, select the profile that you created, Click the data-driven toggle button and hit Create.
Now that we have imported, let’s see how we can add this to our test steps:
- In your Testsigma account, type in the URL of the page(Orange HRM login page which is open source
- Let’s enter something in the Username field of the page using the grammar, “Enter test data in the ui identifier field”. You may check out this article that explains all the steps required to Enter the test data in the ui identifier field.
You may check out all the grammar used in Testsigma in the NLP Grammar link at the left pane of your Testsigma account or use the Help icon to see the keywords you can use and the examples that would help you with a few examples.
- Now let’s see how we can use the testdata without hardcoding it to the test step.
Delete the text testdata and select the @|Parameter| from the suggestions. Instead, choose the testdata name that comes up on the suggestions. See representation.
- Now, you just need to create a simple Dry Run and click Create and Run.
This is just an example for illustrating data-driven testing. There are a whole lot of possible ways you can put to use the test data without necessarily hard coding it to your test steps.
Test Data management
Managing test data profiles is at its best in Testsigma with options to export, edit and delete test data profiles without downloading any compilers,IDEs or APIs. The test data are organized and well maintained a repository that can be accessed across all your test cases.
Check out this practical guide that explains Data Driven Testing.