How to Perform Data Driven Testing in SoapUI Pro – SoapUI Tutorial #14

By Vijay

By Vijay

I'm Vijay, and I've been working on this blog for the past 20+ years! I’ve been in the IT industry for more than 20 years now. I completed my graduation in B.E. Computer Science from a reputed Pune university and then started my career in…

Learn about our editorial policies.
Updated January 7, 2025

In this article, we will learn in detail how to perform data driven testing in SoapUI Pro. Let’s get started.

In this SoapUI Pro tutorial, we are going to see Data Driven Testing using SoapUI Pro. Performing load testing and performance testing with huge amounts of data is often time-to-consumer. This can be overcome through Data driven testing in SoapUI Pro.

How To Perform Data Driven Testing in SoapUI Pro

SoapUI Data Driven Testing

What is Data Driven Testing

Reading test data through test scripts and iterating execution multiple times is known as data driven testing. Test data is pre-prepared based on the requirements of external sources that could be any of the following:

  • Excel Files
  • CSV Files
  • ODBC Sources
  • SQL / ADO Objects

While running data driven scripts, it will fetch the data from the external data source file and then put it into the corresponding variables present in the scripts. For example, let us use the login form. This form usually contains the username and password fields. During functionality testing of the login screen, we need to prepare the test data with different combinations of the username and password and there should be variables to obtain the data in the script correspondingly.

When you call the web service from the SoapUI data source test step, it will read the first set username and password. It will then assign the values to the corresponding variables in the script. After that, the web service will start the process internally with the username and password.

Take a look at the flow diagram of common data driven testing. This can be implemented via SoapUI pro.

Data Driven Testing 1

Keyword Driven Testing

Keyword driven testing is a software testing type applicable for both manual and automated testing (most commonly used). It is also called table driven testing. Even though this seems quite simple, it does need more time to collect keywords and appropriate functionalities.

In a keyword driven framework, we prepare test data like data tables along with the keywords. There are several components available in the keyword driven testing framework. They are:

  • Control File
  • Test Cases File
  • Startup Script
  • Driver Script
  • Utility Script

The “Control File” contains test scenarios to be executed/automated. When testing from the initial stage, the user has to select a particular test scenario from the data file. This will be determined based on the flag ( Yes / No ) present in the data file or excel file.

Test Cases File” component contains the detailed steps of flow to be executed and this will be prepared in the form excel containing keywords, objects, parameters and checkpoint columns.

The next component is “Startup Script”. This is the first executable script which instantiates the objects and reads the data from the content file. After that, it will start executing the test scenarios that are marked as Yes in the control file.

Driver Script

The driver script is responsible for reading the test case file as well as validating the keywords. It will then address the respective utility script functions based on the keywords available in the test case file. Apart from this, we need to handle the runtime errors in the driver script itself.

Utility Script

It consists of relevant logical methods/functions based on the keywords. These scripts will be generic and can be utilized across applications.

Detailed steps on how to perform data driven testing on SoapUI Pro

This can be done using Excel, CSV or SQL through JDBC drivers

We will use CurrencyConvertor web service to practice. Before creating the new project in SoapUI Pro, prepare test data based on the input request for the web service as shown in the below screenshot.

Data Driven Testing 2

Once the test data is ready, open SoapUI Pro and follow the steps given here:

Step 1) Create a SOAP project

Step 2) Add the test suite and test case steps with the name of “CurrencyConvertorSoapTestSuite” and “ConversionRateTestCase” respectively

Step 3) Add the service request under the test case as shown below:

Data Driven Testing 3

Next, we configure the data source test steps as described below

1) Double click on the data source test steps present under the project tree

2) On the right side of the screen, select the Excel option from the data source drop down

3) SoapUI displays Configuration screen with File, Worksheet, Start at Cell and Ignore Empty options.

4) File options should be filled with the valid file name selected from a local computer. Next, enter the exact worksheet name in the worksheet text field.

5) Following that, “Start At Cell” text field has a default cell value as “A1”. Change if required.

6) The “Ignore Empty” option helps us to avoid processing blank cells from the selected cell range. If it is checked, SoapUI will not consider the blank cells from the worksheet.

7) Click on the Browse button to select the excel file stored in the hard drive

8) Enter the worksheet name as present in the original excel file. Let us specify “Sheet1” as we have entered the test data in Sheet1.

9) Leave the default Cell name and check the checkbox. Next, we need to add Property names according to the excel headers name. Add a property name icon that will be present in the toolbar with the (+) symbol.

10) When all the required property names are added, we can execute the data source.

11) Click Run icon to start the execution which loads the test data to the SoapUI grid

12) SoapUI Pro will now prompt us to specify the number of rows to be fetched from the excel file. If we need all the rows means, we can specify them as zero. See the screenshot given below for your reference.

Data Driven Testing 55

13) Finally, click OK to populate the data present at the bottom of the section.

Data Driven Testing 66

14) To iterate row by row during execution of the test suite, add a data source loop under the test suite where the data source test step is added.

15) For that right click on the test step node and then click Add Step -> Data source Loop

16) Enter data source name in the Add Step popup and then click OK

17) After adding data source loop, we need to configure the data source step and target step. For that, right click on the data source loop step and click “Configure” option. Make sure that the data source step should be “data source” and target step as “conversion rate”

18) Click OK to close the popup

Now it is time to execute the test suite by passing various input data. Double click on the test suite name and then click the Run icon. After the execution of the test suite, SoapUI Pro will show us the test results.

Conclusion

This is a really useful feature to maximize the amount of testing in a faster and enhanced fashion. However, it is sensitive to changes made to the UI during future releases. It is easy to recover by making appropriate changes to the data tables.

The next SoapUI tutorial is the last in the series and will talk about exporting requests and responses to external files.

Please post your feedback and questions in the comments section below. We would love to hear from you. 

Was this helpful?

Thanks for your feedback!

Recommended Reading

  • Soapui and pro features

    In this article, we will look in detail at the 7 important features of SoapUI and SoapUI Pro. Let's get started. SoapUI is a great tool for functional testing, web service testing, security testing and load testing.  This is the 2nd tutorial in our SoapUI web service testing tutorial series.…

  • 4 Important Features of SoapUI Pro for Pro Audience – SoapUI Tutorial #12

    In this article, we will look at the 4 important features of SoapUI Pro for Pro Audience. Let's get started. SoapUI comes in two versions - Open Source Free (SoapUI) and SoapUI Pro (now SoapUI NG pro). So far we were discussing common automation concepts and functional testing basics such…

  • soapui tutorials

    In this article, we have compiled a list of Soap UI Tutorials for the benefit of our readers. Let's get started. STH is coming up with another testing tool tutorial. You know how detailed and useful these tutorials are. The tools are SoapUI and SoapUI Pro. We suggest that our…

  • Properties in SoapUI

    In this tutorial, you will see how to use properties in SoapUI Groovy Script. Let's get started.  Properties are the central repository to store our information temporarily. They can contain login information like username and password, session data like session id, page context, header information and so on. This is…

  • soap vs rest services

    This tutorial talks in detail about SOAP (Simple Object Access Protocol) and REST (Representation State Transfer) based services and their advantages. Let's get started. In an earlier tutorial, we discussed the features of SoapUI Pro and briefly touched upon SOAP vs REST web services.  => Click here for the complete…

  • working with soapui properties

    This tutorial is all about working with SoapUI properties. Let's get started. In the last SoapUI tutorial we saw how to add properties in Groovy script. The property in SoapUI is similar to a variable/ parameter and in this tutorial, we will talk about how to use one in a…

  • Assertions in SoapUI

    This article is all about understanding assertions in SoapUI. Let's get started.  So far, we have been working on the basics of SoapUI such as creating projects, adding WSDL, sending a request & receiving responses and generating test assets to go along with them. In this 5th SoapUI tutorial, we…

  • Introduction to BigData

    This Tutorial Explains all about Big Data Basics. Tutorial Includes Benefits, Challenges, Technologies, and Tools along with Applications of Big Data: In this digital world with technological advancements, we exchange large amounts of data daily like in Terabytes or Petabyte. If we are exchanging that amount of data daily then…


7 thoughts on “How to Perform Data Driven Testing in SoapUI Pro – SoapUI Tutorial #14”

  1. Can any one share the code of Data Driven Framework in TestNG (Without data Provider) it should have file input or output functionality.

    Reply
  2. HI,

    Is it possible to connect to a database with JDBC connection?

    Also with Soap UI is it possible to test Db tables using sql query count functionality?

    All I wanted is to retrieve the count of records for evert table.So it is possible to have those queries set in soapUI Pro and running them would retrieve all results at one go?

    Thanks

    Reply
  3. Hi, good tutorial, is it possible to use the response values to send a new request? If anyone knows how to do it please share the answer. Thanks.

    Reply
  4. Good one.. very easy to perform this heavy task… thanks for sharing…

    where can we see all inputs and output records ???

    Reply
  5. Good one,, it makes life so easy.. but how to save all these results.. i added a groovy script follwoing the next tutorial ,, but its not capturing all execution results but its limited to only 1 request and response…

    how can we loop the groovy to capture all results from 1st to 5th execution

    def request = context.expand(‘${ConversionRate#Request}’);
    log.info(request);
    def response = context.expand(‘${ConversionRate#Response}’);
    new File(“c:/Automation/”+a.count+”_request.txt”).write(request+response);

    Reply

Leave a Comment