The Loadmill's API testing module allows users to easily create automated API tests taken from real user sessions.
In this quick guide to Loadmill we will learn how to:
Create and run a simple API test by using our Chrome recorder extension.
Create and run an API test from scratch in Loadmill.
We do not ask for any credit card or personal information other than your name and email so it only takes about five seconds. You can also login using your Google or GitHub account.
In order to use Loadmill effectively, we highly recommend to read Core definitions. Don't worry, it is only a 2 min read. 😉
There are two ways to do that:
Recording an API test by using our API Test recorder and running it in Loadmill.
Creating and running an API test from scratch in Loadmill.
Download the extension here.
Open the Chrome Developer Tools and switch to the Loadmill Rec tab.
If you are not logged in to Loadmill, you will be prompted to the login page.
Create a Test Suite in Loadmill that will hold recorded flows, and select it in the extension.
Clear the captured requests list and navigate to the tested website.
Use the filter and the request's delete buttons to filter out irrelevant requests. You can also see the request and response body by clicking on the expanding arrow within requests.
When you are done recording your session, click the "Upload" button at the bottom.
Go to Loadmill and open the recorded test in your Test Suite.
Run the Test Suite by pressing the "RUN SUITE" button and see your results. 🥳 Visit this page to learn more about the Loadmill Chrome recorder extension.
Go to the API Tests tab.
Click NEW TEST SUITE, give it a name.
You can notice that there is one test flow already created in it and you just need to fill it out. The first request will be to get our login page, enter its name, put URL -
4. Click ADD REQUEST. This will be an authentication request that will dynamically extract an access token and will allow the user to log in to the app by using his username and password. Find more information about dynamic parameters here.
5. Enter request name - Authentication request - extract token using JSONPath from the response, select "POST" as Method, put URL -
6. Press Advanced. This is a place where we set the request body, headers, extractions and assertions. Enter Content type -
application/x-www-form-urlencoded , body -
7. The warning you've got means that the parameters we set in the body as username, password, client_secret are not defined yet. Go to the Parameters tab and add them as shown below:
8. Now go back to the "Flows" tab and run your first API Test Suite by pressing the "RUN SUITE" button. That's it, you can see your results live in Loadmill.
🎉 This is only the beginning, continue exploring our guides to master your Loadmill skills!
We are always here if you need any help! Click on the bubble chat button in the lower-right corner of the screen or drop us a line at [email protected].