Data-driven testing in Testsigma 
Tags: testing, testsigma, testautomation, datadriventesting
Published: 2019-06-03 15:52:08

<a rel="noreferrer noopener" aria-label="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). (opens in a new tab)" href="https://testsigma.com/automated-data-driven-testing" target="_blank">Data driven testing</a> 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 <a href="https://en.wikipedia.org/wiki/Data-driven_testing">Data-Driven Testing</a> 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.

<b>Running a Data-Driven test in Testsigma</b>
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

<b>Method 1: Creating a Test Data profile manually</b>
Here is how Testsigma’s dashboard looks like.

<img src="https://testsigma.com/blog/wp-content/uploads/Dashboard_Testsigma-1024x502.png">

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.

{% vimeo 340010622 %}

<b>Method 2: Importing a Test Data profile</b>
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.

{% vimeo 340010672 %}

If we have the test data profile ready by either one of these 2 methods, we can create a Data-Driven test case in <a href="https://testsigma.com/">Testsigma</a>.


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.

{% vimeo 339999812 %}

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 <a href="https://testsigma.com/" target="_blank">Testsigma account</a> 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.

{% vimeo 340006839 %}

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.

<b>Test Data management</b>
<a href="https://support.testsigma.com/support/solutions/articles/32000018296-how-to-manage-test-data-">Managing test data profiles</a> 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 <a href="https://dzone.com/articles/data-driven-testing-using-testsigma">practical guide that explains Data Driven Testing</a>.