Create Virtual Service from Resource Paths

You can create a REST virtual service (virtual API) by specifying resource URLs manually:

  1. From the main menu, select File > New Virtual API:

    Service virtualization with ReadyAPI: Creating a new virtual API

    – or –

    On the Dashboard, click Virtual API in the New Test tile:

    Service virtualization and API testing: Creating a new virtual API
  2. In the New Virtual API wizard, select REST Resources > Start:

    Service virtualization and API testing: Creating a new REST virtual API from resource URLs
  3. On the next page of the wizard, enter the desired operation URL (path) and specify the operation method (GET, POST, DELETE or another):

    REST service virtualization and API testing: Specify the operation URL and method

    Important

    The URL must start with a slash ( / ).

    Do not use query parameters (they are put after the question mark ( ? ) in the URL string).

    Click Add another resource to create multiple operations.

    After you specified the needed operations, click Next.

  4. On the next page of the wizard, select the project to add the new virtual API to. To create a new project, select <New Project>.

    Service virtualization and API testing: Select a project for new virtual service
  5. After you create a virtual service, ReadyAPI offers you to run it immediately or edit it before starting or deploying.

    If you selected to run the virtual service, ReadyAPI will run the service on your computer, and use the HTTP protocol and port 8088 by default. It will display the Virtual Service Overview window, where you can view and simulate virtual operations:

    Service virtualization and API testing: The Virtual Service Overview window

    You can view the response data for simulated requests directly in the Virtual Service Overview window. To do this, simply select a request in the operation list. You can also check response data on the Transaction Log page of your virtual service editor.

Note

  • ReadyAPI creates virtual operations based on the URLs and methods you specified.

  • For each operation, ReadyAPI creates a sample response with the following data:

    Response body:

    Empty

    Status code:

    200 OK

    Media type:

    application/xml

    That is, the created virtual service is ready for a run as is.

  • When entering the URLs in the wizard, make sure to start them with a slash ( / ) and do not use query parameters in them, that is, do not use substrings like ...?param1=value1....

See Also

Publication date: