This topic provides how to automate an API by leveraging algoQA platform when API details are captured from an API collection using algoQA API forms. To create API collection using algoQA API forms, click here.
Tip: Alternatively, if you wish to automate an API by leveraging algoQA platform when API details are captured from an API collection, such as Postman, install the Postman app for different operating systems, such as Windows, Linux and Mac by clicking here.
Upon installing Postman App, create an API collection and include all the necessary requests to perform user actions.
Automation procedure for performing user actions API collection using algoQA
Consider an example of performing user actions using HTTP methods. The HTTP methods indicate the type of operation you want to perform on a specified user.
User actions and HTTP Methods:
API | HTTP Methods to call API |
Login | POST |
Create a profile | POST |
Access the profile | GET |
- Create a project:
- Name: User Actions API
- Select API Automation
- Click Create
Upload an API collection:
In the Main Canvas, click the arrow in the lower-right corner to view the side panel to upload the API collection. Note: Ensure the API collection is in JSON format.
- Execute the API automation
- Let us validate the HTTP method details to log in a user using the POST method, save it and click Send to execute it.
You can confirm the execution status in the status bar as shown: - In the previous example:
- Endpoint: /api/login is the endpoint or URL where the login functionality is implemented.
HTTP Method: POST is used to submit user credentials.
Request Body: The username and password are included in the JSON file that is part of the request body.
- Similarly, you can validate POST and GET methods for user actions, such as creating and accessing a profile and executing it, confirming the execution status.
- Let us validate the HTTP method details to log in a user using the POST method, save it and click Send to execute it.
- Generate scripts
- In the left panel, select the appropriate folder to view the sequence. Select the user actions and click Generate Scripts.
- If needed, you can rearrange the sequence with drag-and-drop functionality and click the Update Sequence button.
In the left pane, click down arrow corresponding to User Management API >Project Directory pane > navigate to the Test Cases folder to access the Feature File.
A system generated Feature File is as follows:
- In the left panel, select the appropriate folder to view the sequence. Select the user actions and click Generate Scripts.
- Download and Execute the script.
- Download the script and save it to your local folder.
- Execute the script
- Navigate to the same folder described in the previous step. Run the following command to trigger the script.
mvn test - Build success message will be displayed and you can view the respective report.
- Navigate to the same folder described in the previous step. Run the following command to trigger the script.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article