How to use Robot Framework for MBT, Load and Stress Test in aiTest

Language

  • Python

How Robot Framework is going to be used for MBT, Load, Stress 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 Multi-Browser 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. test-example.com, test-demo.com, 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.
    • AUT URL: Application Under Test URL. e.g. https://example.com
    • Now here you can choose Repo Details or Your Automation Code.
    • Repo Details: Provide the repo details User’s Git Repository URL, User’s Git Username, User’s Git Token or Password, Report File Location and Testrun Command.
    • Your Automation Code: If you select “Your Automation Code” in the previous step, you will need to upload your automation code in a zip file.
    • Testrun Command: 1)In Python Write Testrun Command to Run your Testrun Testcases For headless mode: robot ./TestCaseSuite/test_my_application.robot.
    • Report Location: Write Report Location to Stored your testrun Testcases Report Files Report/Test_Report.xml
  5. Select Browsers: At the end select the browser on which you want to run your test. Currently, we have 3 browsers such as, Google Chrome, Mozilla Firefox and Microsoft Edge with their different browser versions.
  6. 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.

Note:

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
  • GIT
  • .zip file

Code Snippets for Reference

Refer the code snippet below:

Python

  
*** Settings ***
Library    SeleniumLibrary

*** Variables ***
#${CHROME_DRIVER_PATH}    C:\\New Chrome Driver\\chromedriver-win32\\chromedriver.exe
${BROWSER}    %{browser_name}
#${BROWSER}    firefox
#${BROWSER}    edge


*** Test Cases ***
LoginTest
    Setup Browser    ${BROWSER}

    # Use the defined options to open the browser
    Go To    https://klarity-develop.demandscience-apps.com/auth/signin
    
    # Perform actions
    Maximize Browser Window
    Input Text    id=input_email    Admin
    Input Text    id=input_password    admin123
    Wait Until Element Is Visible    id=action_signin    timeout=10s
    Execute JavaScript    document.getElementById('action_signin').scrollIntoView()
    Execute JavaScript    document.getElementById('action_signin').click()
    Close Browser

*** Keywords ***
Setup Browser
    [Arguments]    ${browser}
    ${args}=    Create List    --headless    --no-sandbox    --disable-dev-shm-usage
    ${options}=    Evaluate    sys.modules['selenium.webdriver'].${browser.capitalize()}Options()    sys, selenium.webdriver
    FOR    ${arg}    IN    @{args}
        Call Method    ${options}    add_argument    ${arg}
    END

    Run Keyword If    '${browser}' == 'chrome'    Create Webdriver    Chrome    options=${options}
    ...    ELSE IF    '${browser}' == 'firefox'    Create Webdriver    Firefox    options=${options}
    ...    ELSE IF    '${browser}' == 'edge'    Create Webdriver    Edge    options=${options}

*** Keywords ***
  

Questions Answered

  • How Robot Framework is going to be used for MBT, Load, Stress Test in aiTest?
×

Subscribe

The latest tutorials sent straight to your inbox.