In this tutorial, we will record a simple interaction with a web service for which we do not have an API definition.
1. Open the Discovery Dialog
To start recording requests to your service, open the REST Discovery dialog:
-
Select File > New Empty Project and select:
-
Select Discover API in the flyout menu:
-
Select Use the built-in browser and click Add API:
-
ReadyAPI will offer you to specify an API definition to filter the recorded requests. Click Record without Definition:
ReadyAPI will open the Recording Overview dialog and prepare to start recording requests.
2. Record Requests
When you open the Recording Overview dialog, the recording is running.
-
Click to pause the recording.
-
Enter https://petstore.swagger.io/ and press Enter:
-
Click POST in the pet Everything about your Pets resource to expand the
/pet
operation: -
The editor contains example values for the request:
-
Click Try it out to get a request body with sample values:
-
Click to resume the recording.
-
Click Execute to send the request. The website will send the request and show the response, and ReadyAPI will record the interaction. The Recorded requests field now shows that ReadyAPI records one request:
On the next step of the tutorial, we will create the API definition.
3. Create Service Definitions
Now that you have recorded the actions, generate service definitions from them:
-
Switch to the Transactions page and view the recorded requests and responses:
-
ReadyAPI shows the recorded request. You can click requests and responses to examine details of the recorded operations.
-
Make sure to select the request you sent. Click Generate services.
If you recorded several requests, clear unnecessary ones. Select only the /v2/Pet POST
request with theapplication/json
content type. -
In the Generate Services dialog, select the Generate Test Case option to create a ReadyAPI Test test for the API you have recorded:
-
Click OK and enter the test suite and test case names.
-
ReadyAPI will add the resources to the project and show the information dialog. Select Close REST Discovery and click OK:
You have recorded the API request to the web service and can now reproduce it in ReadyAPI.