To test a SOAP service in ReadyAPI, you need a WSDL definition of this service. This definition describes operations of the service, and the format of requests and responses. ReadyAPI uses this information to simulate requests.
REST services can also have definitions. Most frequently-used definition formats are OpenAPI (formerly known as Swagger), WADL, and some others. You can load these definitions in ReadyAPI and create test cases based on information in these definitions.
In a general case, a REST service may have no definition at all. You can create tests for such services in ReadyAPI by recording requests to service URLs (this is called API Discovery). ReadyAPI will get information on request and response parameters based on the tracked traffic. However, this “observational” data is not as precise as information from a definition, so, we recommend using definitions when it is possible.
We will create a test for the Petstore sample web service. This is a REST service. You can find its definition here –
This definition has an OpenAPI 2.0 (Swagger) format. No need to download the definition now. ReadyAPI will do this later when we create a functional test. See below.
From the main menu, select File > New Functional Test:
– or –
|Note:||The New Test tile you see on your screen may differ from the one descried above, because the tile content depends on the ReadyAPI license you have. For details, see the tile description.|
In the subsequent dialog box, select API Definition:
|Note:||If you have an open project in ReadyAPI, the dialog box will display one more option – “ReadyAPI Project: API from an existing project”.|
In the subsequent wizard, specify the URL of your web service’s definition. In our case, it is
Click Next to continue.
On the next page of the wizard, select if you want to create a new project for the definition you have added, or add it to the existing project.
Click Next to continue.
On the last page of the wizard, select if you want to have one test case for all operations defined for your web service, or use multiple test cases (one per each operation). Let’s use the latter option:
Click Finish to create a test.
ReadyAPI will create a test project and add test cases to it.
After that it will display one more dialog box, where you can run the created tests or add a data source to them. In this tutorial, we will not use these options. Close this dialog:
You can see the project in the Navigator panel on the left. On the next step of this tutorial, we will explore the created project, the service and its operations.