REST API

REST stands for "Representational State Transfer", simply put, it is a way of accessing and manipulating web-based resources using a predefined set of stateless operations. A real-world example could be a web-based Test Management solution that allows the creation, updating and deleting (operations) of Test Cases (resources) via a REST interface. This API could be used as the basis to bulk import or migrate test resources from one solution to another. Because REST is based on HTTP/s, this is fully supported by NeoLoad. A simple example can be found below.

The first step is to create a server entry in NeoLoad for the target system. This is done by right-clicking on the server folder and selecting New HTTP Server.

The API used in this example is a sample provided by "samples.openweathermap.org". Weather related information is returned based on the location we provide. We name the server entry and enter the host details.

The next steps are to create a User Path and insert a standard HTTP request into the Actions section.

When inserting an HTTP request, users can either paste in content from an external source such as a log or trace file or create an empty entry.

In the HTTP request, select the server entry created above and enter details of the URL path where the REST API can be found. In this example we will be using an HTTP GET method and supplying the location.

The next step is to execute the request and view the result by running the Check User Path.

Looking at the response from the HTTP request Action, we can see that the request executed successfully and a JSON response was received.

Just like before, we can take this response and update our test with this expected result by clicking the Advanced button and selecting Update. We confirm we wish to replace the empty response.

We can now leave the Check User Path dialog (closing windows as needed) and view this new response in the User Path by clicking the Advanced button.

Now we have a response in our test, we can create Variable Extractors and do Validations as needed.

While our example is quite simple, you will likely need to provide additional details on the Request Headers tab above to enable you to test your own APIs. These would be provided by your development teams.