Robot Framework
Robot Framework
Library SeleniumLibrary
Login Test
Close Browser
robot test_suite.robot
Library SeleniumLibrary
END
Close Browser
Library SeleniumLibrary
END
Close Browser
Library RequestsLibrary
API Test
Log ${response.json()}
Setup: The Setup is used to define tasks that need to be performed before a test
case, test suite, or keyword is executed.
Teardown The Teardown is used to define tasks that need to be performed after
a test case, test suite, or keyword is executed, regardless of whether the test
passes or fails.
Library SeleniumLibrary
${URL} https://example.com
Search Functionality
Open Browser
Close Browser
Tags are labels assigned to test cases to organize and filter them during execution.
Login Test
[Tags] smoke
Perform Login
My Test Case
Skipped Test
You can pass multiple test suite paths in the robot command
The --dryrun option validates the test suite syntax without executing the test
cases. It ensures the test cases are written correctly.
Example (resources.robot):
${URL} https://example.com
Login To Application
Resource resources.robot
Add Numbers
Test Addition
Add Numbers 5 10
Import SeleniumLibrary and directly call its keywords in test cases. For
example:
Close Browser
Handle Error
Run Keyword If not ${status} Log Button not found, continuing execution
Library DatabaseLibrary
Log ${result}
${DYNAMIC_BUTTON} //button[text()='${BUTTON_TEXT}']
Use the --listener option to hook into execution and generate reports.
Use external tools like Robot Framework ReportPortal for advanced
reporting.
How do you integrate Robot Framework with version control systems like Git?