In ReadyAPI, you can use different input data to control the test scenario, ensuring the web service works properly in different cases. For that purpose, you can use data sources, which can gather and store information you need to perform any tests you need.
Data Source Types
In ReadyAPI, you can use data sources of different types. Some of them allow using external storages like databases or Excel sheets, and other can generate random data right during the test run.
To learn about available data source types, see Data Source Types.
Availability
You can use data sources in functional tests to populate testing properties and switch between different data:
-
To learn how to use data source test steps, see Data Source Test Step.
-
To learn about data source loops, see Data Source Loop Test Step.
In virtual services, you can use the data source’s data to form the service’s response. To learn how to do that, see Data Sources in Virtual Services.
Note: | Data sources are a Pro feature. To use them in functional tests and virtual services, you need ReadyAPI Test and ReadyAPI Virtualization licenses respectively. |
Generate Data Source Automatically
ReadyAPI can automatically generate values for parameters in request test steps. The value type is deduced from the type of the parameter that is specified in the service definition or, if it's not possible, from the parameter name.
If you choose to generate values automatically, ReadyAPI will create a Data Generator data source and will fill it with properties based on the request parameters. The request parameters will automatically refer to the data source properties using property expansions. The request test steps, for which properties were generated, will be within a data source loop.
When you run a test case, the data source will generate random values of the specified type and insert them into the request as parameters.
How to generate values automatically
There are two ways to generate values automatically:
-
On the test case level - In this case, ReadyAPI will be able to generate values for several requests in one test case.
-
Add the Data Source test step in the test case editor and select Yes in the Generate properties dialog:
Note: If you choose to generate values automatically, ReadyAPI will simply create an empty data source test step. You can configure it at any time. -
In the Create Data-Driven Loop dialog, check the parameters for which you want to generate properties automatically and click OK:
-
-
On the test step level - In this case, ReadyAPI will generate values only for one request test step.
-
Click Generate Values in the request test step editor.
-
In the Create Data-Driven Loop dialog, check the parameters for which you want to generate properties automatically and click OK:
-
Database Data Sources
To use database data sources in ReadyAPI, you need properly configured connection strings.
Some of database drivers have prebuilt connection strings. You can find them in the ReadyAPI preferences, on the JDBC drivers page, or see Preconfigured JDBC Drivers.
You can configure additional connection strings in the Databases manager. To learn how to do that, see Database Manager.
See Also
Basic Concepts of Data-Driven Testing
Database Manager
Data Sources and Data-Driven Tests