Automate Everything: An Introduction to Robot Framework with Python


Robot Framework is an open-source, keyword-driven test automation framework that is widely used for acceptance testing and robotic process automation (RPA). Robot Framework offers all the features provided by tools like Cucumber and TestNG, while including built-in libraries that simplify the creation of automated tests, reducing the need for repetitive code. It is widely used for both functional and non-functional testing.
Robot Framework with Python comes with a wide range of features that make it an ideal choice for test automation and more. Here are some of its standout features:
- Keyword-Driven Approach: Robot Framework uses human-readable keywords for creating, understanding, and maintaining test cases.
- Extensibility: It offers built-in and external library integrations for flexible and enhanced capabilities.
- Cross-Platform Compatibility: Runs seamlessly on Windows, macOS, and Linux, ensuring flexibility across environments.
- Data-Driven Testing: Allows executing test cases with variable input values for thorough scenario testing.
- Clear and Simple Syntax: Tests are written in tabular, human-readable formats like .robot or .txt.
- Built-in Reporting: Generates detailed, easy-to-read reports in formats like HTML and XML.
- Integrations: Supports tools like Jenkins, Selenium, and Git for CI/CD workflows and agile pipelines.
- Support for Tags: Enables grouping and filtering tests using tags for efficient test management.
- Parallel Test Execution: Accelerates testing by running tests in parallel with tools like Pabot.
- Rich Documentation: Comprehensive documentation and tutorials simplify adoption for all user levels.
- Open Source and Community Support: Backed by an active open-source community providing extensive support.
- Support for Multiple Test Formats: Test cases can be written in .robot, .txt, or .tsv formats for user preference.
The following table highlights key differences between Robot Framework and Selenium to help users choose the right tool for their needs.


The Robot Framework serves as a versatile tool designed to process input data, execute test cases, and produce comprehensive reports and logs. Its core framework remains agnostic of the specifics of the system under test (SUT), ensuring a clean separation of concerns. This design allows the framework to focus on orchestrating the testing process while delegating direct interactions with the SUT to specialized libraries. These libraries act as intermediaries, leveraging application interfaces, APIs, or low-level testing tools to facilitate communication with the SUT.
Python's simplicity and readability complement Robot Framework's keyword-driven approach, making it accessible for users of varying technical backgrounds.
- Extending Functionality: Python allows users to create custom libraries and keywords tailored to specific needs.
- Ease of Integration: Robot Framework relies on Python libraries such as SeleniumLibrary and AppiumLibrary for web and mobile automation, ensuring smooth workflows.
- Community Support: Python's vast community provides extensive resources, making troubleshooting and enhancements easier.
- Flexibility: The combination allows the automation of not just tests but entire workflows, including API testing, RPA, and more.
Setting up Robot Framework with Selenium involves the following steps:
Step 1: Install Python and Pip (ensure Python is installed on your system and Pip is available).
Step 2: Install Robot Framework
Step 3: Install SeleniumLibrary for Robot Framework
Step 4: Install robotframework-browser from the command line, command is pip install robotframework-browser
Step 5: Install the node dependencies, run command rfbrowser init
Step 6: Install the Salesforce Library ( simple-salesforce)
Step 7: Setup your test environment in your IDE (e.g., PyCharm, VS Code).
Once you are done with the successful installation above -
Step 1:
Create one project in Visual studio code

Step 2:
Create a folder in your project at the root with the name PageObjects. Inside this folder create a file, pageLocators.yaml (here we are going to define all the web elements/locators)

Step 3:
Create a folder in your project at the root with the name Resources. Inside this folder create resources.robot file, there we are maintaining callable functions.

Step 4:
Create a folder in your project at the root with the name TestCases. Inside this folder create a file test.robot. Where we can write test steps using keywords.

In the test cases, you see there are four sections
- First Section is *** Settings ***; here we have imported all the libraries and resources I have added.
- The second Section is *** Variables ***; here we have added all the Variables simply as we declare any other frameworks, also we can import Variables from other files too.
- The third Section is *** Test Cases ***; here, we have added all the Test Cases and Validated them. In these Test Cases, I mostly called the Keywords (Predefine or Customized Keywords).
- The fourth Section is *** Keywords ***; here I have created a few keywords which were used above in test cases.
To run the above test cases type the following command, and press enter.
robot TestCases\Test.robot

Robot framework supports good reporting where we can check many things as follows:
Once you run your test scripts, the report.html file will be created in your directory. The generated report.html includes key metrics like test duration, pass/fail rates, and detailed error logs for failed tests that need to be opened on a browser.


Salesforce automation faces challenges like dynamic UI elements, complex interactions, authentication hurdles, frequent updates, and performance issues. The Robot Framework, combined with Selenium offers practical solutions:
- Dynamic Element Identification: Use stable locators like XPath/CSS selectors, dynamic variables, and custom attributes for element identification.
- Complex UI Interactions: Handle modals, popups, and dropdowns using wait keywords, Action Chains, or JavaScript execution.
- Authentication: Use API authentication or session cookie injection to bypass multi-factor authentication (MFA).
- Responsive Layouts: Test different user roles and device viewports by parameterizing roles and setting window sizes.
- Frequent Updates: Centralize locators, adopt the Page Object Model (POM), and maintain scripts after Salesforce updates.
- Performance: Optimize execution with parallel tests (Pabot), headless browsers, and selective test coverage.
- Test Data: Leverage Salesforce APIs for setup and cleanup, and use reusable templates for test data management.
- Debugging & Reporting: Enable detailed logs, screenshots on failures, and custom reports for efficient debugging.
Robot Framework with Python opens new doors in automation, but unlocking them takes the right expertise. While it offers the flexibility, power and simplicity required to accelerate testing, streamline workflows and even scale enterprise solutions, mastering these tools requires more than just technical know-how. It demands strategic thinking, deep domain expertise and the ability to adapt to evolving platforms like Salesforce.
That’s where Cloud Peritus makes the difference. Our engineers deliver more than just automation, they deliver future-proof solutions that drive real business impact. Partner with Cloud Peritus and let’s automate success, together.
Reach out to us at info@cloudperitus.com
Cloud Peritus has been at the forefront of innovation since its inception and has since played an integral role in delivering game changing solutions to its clients time and again, resulting in 5 star reviews from across the board.
Feel free to check us out at Salesforce AppExchange.