Grasping Data Driven Testing in SoapUI Pro:
This SoapUI Pro tutorial is going to delve into the setup of Data Driven Testing via SoapUI Pro. Conducting load testing and performance testing with enormous quantities of data can be cumbersome. Data driven testing in SoapUI Pro provides a solution to this predicament.
Recommended IPTV Service Providers
- IPTVGREAT – Rating 4.8/5 ( 600+ Reviews )
- IPTVRESALE – Rating 5/5 ( 200+ Reviews )
- IPTVGANG – Rating 4.7/5 ( 1200+ Reviews )
- IPTVUNLOCK – Rating 5/5 ( 65 Reviews )
- IPTVFOLLOW -Rating 5/5 ( 48 Reviews )
- IPTVTOPS – Rating 5/5 ( 43 Reviews )
What You Will Learn:
What is Data Driven Testing?
Also called data-focused testing, data driven testing involves using test data to feed into test scripts and repeating the process numerous times. Test data is pre-prepared in accordance with the requirements and can be drawn from various external files such as Excel and CSV files, ODBC sources, or SQL/ADO objects.
During data driven scripting, the test script pulls data from the external data source file and fills the relevant variables in the script. For instance, think about a login form that requires a username and password. To test the functionality of the login screen, multiple combinations of usernames and passwords need testing. The test data for these combinations is pre-prepared, and the script contains variables to hold the data.
When summoning the web service from SoapUI data source test step, the first set of username and password is accessed. These values are then allocated to the corresponding variables in the script. The web service then continues with its internal process using the provided username and password.
Consider the flow diagram of typical data driven testing that can be applied using SoapUI Pro.
Keyword Driven Testing
Keyword driven testing is a method of software testing operable for both manual and automated testing. Also referred to as table driven testing, albeit simple, it necessitates extra time to gather keywords and establish suitable functionalities.
In a keyword driven structure, test data is organized into data tables along with keywords. The framework comprises numerous components:
- Control File
- Test Cases File
- Startup Script
- Driver Script
- Utility Script
The “Control File” encompasses the test scenarios to execute or automate. When testing from the inception, the user picks the specific test scenario from the data file. This selection relies on the flag (Yes/No) present in the Excel or data file.
The “Test Cases File” segment contains the detailed flow steps to execute. These steps are represented in an Excel format, with columns for keywords, objects, parameters, and checkpoints.
The “Startup Script” is the first executable script that creates objects and reads data from the content file. It then begins executing the test scenarios marked as “Yes” in the control file.
The “Driver Script” has the responsibility of reading the test case file, authenticating keywords, and invoking the respective utility script functions based on the keywords specified in the test case file. Additionally, runtime errors need to be managed within the driver script.
The “Utility Script” consists of methods/functions that are logical and based on the keywords. These scripts are universal and can be reused throughout applications.
Comprehensive instructions on executing data driven testing in SoapUI Pro:
Data driven testing in SoapUI Pro can be conducted using Excel, CSV, or SQL via JDBC drivers.
We’ll be using the CurrencyConvertor web service for practice. Before starting a new project in SoapUI Pro, prepare the test data in accordance with the input request for the web service, as shown in the screenshot below:
With the test data prepared, follow these steps in SoapUI Pro:
Step 1: Establish a SOAP project
Step 2: Include test suite and test case steps with the names “CurrencyConvertorSoapTestSuite” and “ConversionRateTestCase”
Step 3: Include the service request under the test case, as illustrated below:
Next, set up the data source test step as outlined below:
1) Double-click on the data source test step under the project tree
2) On the right-side screen, choose the Excel option from the data source dropdown
3) SoapUI will depict the Configuration screen with options for File, Worksheet, Start at Cell, and Ignore Empty.
4) Input the correct file name in the File field, selecting it from your local device. Then enter the exact worksheet name in the Worksheet field.
5) The “Start At Cell” field’s default value is “A1”; modify it if necessary.
6) The “Ignore Empty” option allows you to bypass processing empty cells from the selected cell range. If checked, SoapUI will exclude the blank cells.
7) Click on the Browse button to select the Excel file stored on your hard drive.
8) Specify the worksheet name exactly as it is in the original Excel file. Let’s assume it is “Sheet1”, as that’s where the test data is kept.
9) Leave the default cell name as is and check the checkbox. Subsequently, add property names according to the Excel header names. The “Add Property Name” icon, denoted by a plus (+) symbol, can be found in the toolbar.
10) Once all the required property names are added, you are all set to execute the data source.
11) Click the Run icon to initiate execution, which loads the test data into the SoapUI grid.
12) SoapUI Pro will prompt you to define the number of rows to be fetched from the Excel file. If you wish to retrieve all the rows, you can specify zero. Refer to the screenshot below for reference.
13) Lastly, click OK to display the data at the bottom of the section.
14) To cycle through the rows during the test suite execution, add a data source loop under the test suite where the data source test step is added.
15) Right-click on the test steps node, then select Add Step -> Data source Loop
16) Input the data source name in the “Add Step” popup, then click OK
17) After adding the data source loop, set up the data source step and target step. Right-click on the data source loop step, then select the “Configure” option. Ensure that the data source step is set to “data source” and the target step to “conversion rate”.
18) Click OK to close the popup.
You can now execute the test suite by supplying various input data. Double-click the test suite name and then click the Run icon. After the test suite execution is finished, SoapUI Pro will display the test results.
Wrap-up:
Data driven testing is an incredibly useful feature that facilitates extensive testing in a faster and more efficient way. Nonetheless, it is susceptible to any UI changes in future releases. Recovery can be realized by making suitable changes to the data tables.
The upcoming SoapUI tutorial will be the last one in this series and will discuss exporting requests and responses to external files.
Don’t hesitate to express your thoughts, comments, and queries below.