In this tutorial, we will record a simple interaction with a website and generate a test case based on this interaction.
Select File > New Project
Switch to the REST Discovery tab and select Use the built-in browser:
Click OK to start recording.
ReadyAPI will offer you to specify an API definition. It allows you to filter the recorded requests and show only those that were sent to the specified web services.
You can specify the URL of the definition file or the path to the file. In this tutorial, we will use the sample Swagger Petstore service:
Specify this URL in the Discover API dialog and click Add and Record:
ReadyAPI shows the Recording Overview dialog after test recording has started.
Enter http://petstore.swagger.io/ and press Enter:
In the pet Everything about your Pets section, click the GET method that corresponds to the
/pet/findByStatus resource and click Try it out.
The editor will offer you to select one of the available values for the status parameter. Select available and click Execute:
Scroll down to the Responses section and find the response body. It contains a list of pets that is represented by the Pet object, for example:
Copy the value of the id element.
Go down to the store Access to Petstore orders section, click the POST method that corresponds to the
/store/order resource, and click Try it out.
The editor will show a sample request body. Paste the copied pet ID to the petId parameter. For the quantity parameter, specify
1. Click Execute to send the request:
On the next step of the tutorial, we will create a test case based on the recorded requests.
After you record the scenario, you can generate a test case:
Click Generate services.
In the Generate Services dialog, check the Generate Test Case option:
Click OK and enter the test suite and test case names.
Select Close REST Discovery and click OK:
ReadyAPI will create a test case with a sequence of recorded requests: