How to use Robot Framework for API Test in aiTest


  • Python

How Robot Framework is going to be used for API Test in aiTest

Robot Framework provides a keyword-driven approach to test automation, making test cases easy to read and write. It is highly extensible, supporting various libraries and tools for different testing needs. Additionally, it offers robust reporting and easy integration with CI/CD pipelines.

  1. Sign up using your E-mail or Google account.
  2. Once you have reached the URL Test dashboard, navigate to the left-side menu and select the API Test.
  3. Hit the Create Test button.
  4. Configure your test:
    • Name the testrun: Give the name of testrun whatever you want or which is related to your application, So that it will be easy to get that particular testrun details whenever you want. i.e.,, etc.
    • Project: Select a project in which you want to run your test or you can create a project by clicking on the red colored plus sign(+) button.
    • Testrun Description: Write some testrun description to make your testrun more informative.
    • Now here choose AUTOMATION out of POSTMAN and AUTOMATION.
    • Input Options: On selecting AUTOMATION in the previous step, click on Input Options. Choose Robot from the list of options displayed in the dropdown. -Load Configurations: Click the Enable Load Configuration toggle. This will enable the load configuration options below. Configure Load Test
    • Max Users: In the Max Users field, enter the maximum number of users you want to simulate in your load test.
    • Initial Users: In the Initial Users field, enter the number of users you want to start the load test with.
    • Total Duration (in mins): In the Total Duration (in mins) field, enter the total duration of your load test in minutes.
    • Iterations: In the Iterations field, enter the number of times you want to repeat the load test.
    • Ramp Up Time (in mins): In the Ramp Up Time (in mins) field, enter the amount of time you want it to take for the number of virtual users to increase from the initial users to the max users.
    • Ramp Up Users: In the Ramp Up Users field, enter the number of users you want to ramp up each minute during the ramp up time.
    • Upload Your Automation File: Click on the Upload button next to the Upload your Automation file section and upload your automation folder or drag the folder. Click on Upload button.
    • Testrun Command: In Python Write Testrun Command to Run your Testrun Testcases For headless mode: robot TestCases/test_my_application.robot.
    • Report Location: Write Report Location to Stored your testrun Testcases Report Files REST-API-Automation--Robot-Framework-main/output.xml
  5. Once you are done with the above steps you can do either of the following:
    • Run It Now: Immediately run the automation code to test the browser compatibility of your apps with across browsers and versions.
    • Save: Save the configuration for later run as draft testrun.
    • Cancel: Reset and go back to previous page.
    • Update: Update the configurations of the test and run new.


In Testrun command test_my_application.robot is the file name. We need to specify our file name in Testrun command, whatever the file we want to run.

AUT code and can be accessed in aiTest through
  • .zip file

Code Snippets for Reference

Refer the code snippet below:


*** Settings ***
Library    RequestsLibrary
Library    Collections

*** Variables ***
${label}    studentsDetails

*** Test Cases ***
    create session    mysession    ${base_url}
    ${response} =    get on session    mysession    /api/${label}
#    log to console    ${response.status_code}
#    log to console    ${response.content}
#    log to console    ${response.headers}

    ${status_code} =    convert to string    ${response.status_code}
    should be equal    ${status_code}    200

    ${body} =    convert to string    ${response.content}
    should contain    ${body}    Sush

    ${connection_value} =    get from dictionary    ${response.headers}    Content-Type
    should be equal    ${connection_value}    application/json; charset=utf-8

Questions Answered

  • How Robot Framework is going to be used for API Test in aiTest?


The latest tutorials sent straight to your inbox.