How to use Rest Assured Framework in aiTest
How to use Rest Assured Automation Framework in aiTest.
Knowledge Base for 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.
robot ./TestCaseSuite/test_my_application.robot
.Report/Test_Report.xml
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.
Refer the code snippet below:
*** 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 ***