Discovery Tutorial

In this tutorial, you record a simple interaction with a web service that has no API definition.

1. Open the Discover API Dialog

  1. From the main menu, select File and then New Empty Project.

  2. In the Navigator, click next to the APIs node, and select Discover API.

  3. Select Use the built-in browser and click Add API.

    Discover API dialog with two options for recording HTTP/HTTPS traffic: "Use an external client application or a browser" and "Use the built-in browser," which is selected.
  4. In the Discover API dialog, click Record without Definition.

    Discover API dialog with an empty URL field and the Record Without Definition button highlighted.

2. Record Requests

ReadyAPI opens the Recording Overview dialog when the test recording starts.

  1. In the Recording Overview dialog, click Pause to pause the recording, then enter https://petstore.swagger.io/ in the URL field and click Go.

    Recording Overview window showing the internal browser with https://petstore.swagger.io/ in the URL field and the Go button highlighted, before recording has started.
  2. In the pet Everything about your Pets section, expand the POST method for the /pet resource and click Try it out.

    Recording Overview window showing the POST /pet endpoint expanded with a required body parameter containing an example JSON pet object, and the Try it out button highlighted.
  3. Click Record to resume the recording.

  4. Click Execute to send the request.

    Recording Overview window showing the lower portion of the POST /pet request body with status set to "available" and the Execute button highlighted at the bottom.

    ReadyAPI records the interaction. The transaction counter confirms one recorded request.

    Server response section showing a 200 response code with a JSON response body confirming a new pet was added, with name "doggie" and status "available".

Note

The next section covers generating service definitions from the recorded requests.

3. Create Service Definitions

Generate service definitions from the recorded requests.

  1. In the Recording Overview dialog, click Transactions to view the recorded requests and responses.

    Recording Overview window showing the POST /pet endpoint in edit mode with the request body displayed, 1 transaction recorded, and the Transactions tab highlighted in the top-right corner.

    ReadyAPI displays the recorded request. You can click requests and responses to examine details of the recorded operations.

    Recording Overview Transactions tab showing one recorded transaction: a POST request to https://petstore.swagger.io/v2/pet with an HTTP/1.1 200 OK response, highlighted and checked.
  2. Select the recorded request and click Generate services.

    Tip

    If you recorded several requests, deselect any you do not need. Select only the /v2/pet POST request with the application/json content type.

    Recording Overview Transactions tab showing the POST /pet transaction selected, with a detail panel open displaying 11 request headers, and the Generate Services button highlighted at the bottom.
  3. In the Generate Services dialog, select the Generate Test Case option, and click OK.

    Generate Services dialog with the Generate Test Case checkbox checked and highlighted, Create Load Test unchecked, and the OK button highlighted.
  4. In the Create Test Suite dialog, enter a name and click OK.

  5. In the Create Test Case dialog, enter a name and click OK.

  6. Select Close REST Discovery and click OK.

    Success dialog confirming that REST resources have been added to Project 3, with the Close REST Discovery checkbox checked and the OK button visible.

    ReadyAPI creates a test case with the recorded request.

    Test Case 1 editor showing one recorded REST test step: Pet - Request 1, with status showing Not executed.

You have recorded the API request and can now run it as a test case in ReadyAPI.

See Also

Publication date: