Convert Figma logo to code with AI

robotframework logorobotframework

Generic automation framework for acceptance testing and RPA

10,922
2,459
10,922
277

Top Related Projects

32,846

A browser automation framework and ecosystem.

48,796

Fast, easy and reliable testing for anything that runs in a browser.

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

91,008

JavaScript API for Chrome and Firefox

20,214

Cross-platform automation framework for all kinds of apps, built on top of the W3C WebDriver protocol

Quick Overview

Robot Framework is a generic test automation framework for acceptance testing and acceptance test-driven development (ATDD). It can be used for testing various applications, including web applications, mobile applications, and APIs. The framework provides a keyword-driven testing approach, making it easy for both technical and non-technical users to write and execute tests.

Pros

  • Keyword-Driven Approach: Robot Framework's keyword-driven approach allows for the creation of reusable and readable test cases, making it easier to maintain and update the test suite over time.
  • Cross-Platform Compatibility: The framework is cross-platform, supporting Windows, macOS, and Linux, making it a versatile choice for teams with diverse operating systems.
  • Extensive Ecosystem: Robot Framework has a large and active community, with a wide range of libraries and tools available for integration with various technologies and platforms.
  • Scalability: The framework can be used for small-scale projects as well as large-scale, enterprise-level applications, making it a suitable choice for teams of all sizes.

Cons

  • Learning Curve: While the keyword-driven approach is straightforward, the framework's syntax and structure can have a steeper learning curve for users new to Robot Framework.
  • Limited Debugging Capabilities: The framework's debugging capabilities are relatively limited compared to traditional programming languages, which can make it challenging to diagnose complex issues.
  • Dependency on External Libraries: Robot Framework relies heavily on external libraries and tools for specific functionality, which can add complexity to the setup and maintenance of the test environment.
  • Lack of Native Mobile Testing Support: While there are third-party libraries available for mobile testing, Robot Framework does not have native support for mobile application testing, which may be a drawback for teams focused on mobile development.

Code Examples

Not applicable, as Robot Framework is a test automation framework and not a code library.

Getting Started

To get started with Robot Framework, follow these steps:

  1. Install Python on your system, as Robot Framework is built on Python.

  2. Install Robot Framework using pip, the Python package installer:

    pip install robotframework
    
  3. Create a new directory for your project and navigate to it in your terminal.

  4. Create a new file called example.robot and add the following content:

    *** Settings ***
    Library    SeleniumLibrary
    
    *** Test Cases ***
    Open Google
        Open Browser    https://www.google.com    chrome
        Title Should Be    Google
        Close Browser
    
  5. Install the SeleniumLibrary using pip:

    pip install robotframework-seleniumlibrary
    
  6. Run the test case using the robot command:

    robot example.robot
    

    This will execute the test case and display the results in the terminal.

  7. Customize the test case by adding more steps or using different libraries, such as RequestsLibrary for API testing or AppiumLibrary for mobile testing.

  8. Explore the Robot Framework documentation to learn more about the framework's features, syntax, and best practices.

Competitor Comparisons

32,846

A browser automation framework and ecosystem.

Pros of Selenium

  • Selenium is a widely-used and well-established web automation framework, with a large and active community.
  • Selenium supports a wide range of browsers and platforms, making it a versatile choice for cross-browser testing.
  • Selenium provides a rich set of APIs and bindings for various programming languages, allowing for flexible and customizable test automation.

Cons of Selenium

  • Selenium can be more complex to set up and configure compared to Robot Framework, especially for beginners.
  • Selenium's learning curve can be steeper, as it requires a deeper understanding of programming concepts and web automation techniques.
  • Selenium's test maintenance can be more challenging, as changes in web application structure or browser updates may require updates to the test scripts.

Code Comparison

Robot Framework:

*** Settings ***
Library    SeleniumLibrary

*** Test Cases ***
Open Google
    Open Browser    https://www.google.com    chrome
    Input Text    name=q    Robot Framework
    Submit Form
    Page Should Contain    Robot Framework
    [Teardown]    Close Browser

Selenium:

public class GoogleSearch {
    public static void main(String[] args) {
        WebDriver driver = new ChromeDriver();
        driver.get("https://www.google.com");
        WebElement searchBox = driver.findElement(By.name("q"));
        searchBox.sendKeys("Selenium");
        searchBox.submit();
        String pageTitle = driver.getTitle();
        System.out.println("Page title is: " + pageTitle);
        driver.quit();
    }
}
48,796

Fast, easy and reliable testing for anything that runs in a browser.

Pros of Cypress

  • Easier to Set Up: Cypress has a more straightforward setup process compared to Robot Framework, making it more accessible for developers new to testing frameworks.
  • Integrated Debugging: Cypress provides a built-in debugging experience, allowing developers to easily step through and debug their tests within the browser.
  • Real-time Feedback: Cypress offers real-time feedback during test execution, providing a more interactive and responsive testing experience.

Cons of Cypress

  • Limited Language Support: Cypress is primarily focused on JavaScript, whereas Robot Framework supports a wider range of programming languages, including Python, Java, and Ruby.
  • Scope Limitations: Cypress is primarily designed for end-to-end (E2E) testing, while Robot Framework can be used for a broader range of testing scenarios, including unit testing and API testing.
  • Ecosystem Maturity: Robot Framework has a more established ecosystem with a larger community and a wider range of third-party libraries and plugins compared to Cypress.

Code Comparison

Robot Framework:

from robot.api.deco import keyword, library

@library
class MyLibrary:
    @keyword
    def add_numbers(self, a, b):
        return a + b

Cypress:

describe('Addition', () => {
  it('should add two numbers', () => {
    expect(2 + 2).to.equal(4);
  });
});

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

Pros of Playwright

  • Playwright provides a more modern and feature-rich API compared to Robot Framework, with support for multiple browsers, including Chromium, Firefox, and WebKit.
  • Playwright's cross-browser testing capabilities make it easier to ensure consistent behavior across different browsers and platforms.
  • Playwright's asynchronous architecture and support for parallel test execution can lead to faster test execution times.

Cons of Playwright

  • Robot Framework has a larger and more established community, with a wider range of third-party libraries and plugins available.
  • Robot Framework's keyword-driven approach may be more familiar and easier to adopt for teams with a background in Behavior-Driven Development (BDD).
  • Robot Framework's support for a wider range of programming languages, including Python, Java, and Ruby, may make it more accessible to a broader range of teams.

Code Comparison

Robot Framework:

from robot.api.deco import keyword

@keyword
def add_numbers(a, b):
    """Adds two numbers and returns the result."""
    return a + b

Playwright:

from playwright.sync_api import sync_playwright

def add_numbers(a, b):
    return a + b

with sync_playwright() as p:
    browser = p.chromium.launch()
    page = browser.new_page()
    result = add_numbers(2, 3)
    print(result)
    browser.close()
91,008

JavaScript API for Chrome and Firefox

Pros of Puppeteer

  • Puppeteer provides a high-level API for controlling headless Chrome or Chromium, making it easier to automate browser interactions.
  • Puppeteer supports a wide range of features, including taking screenshots, generating PDFs, and interacting with web pages.
  • Puppeteer is written in Node.js, which allows for easy integration with other JavaScript-based tools and libraries.

Cons of Puppeteer

  • Puppeteer is primarily focused on automating the Chrome/Chromium browser, while Robot Framework supports a wider range of browsers and platforms.
  • Puppeteer may have a steeper learning curve compared to Robot Framework, especially for users who are not familiar with JavaScript.

Code Comparison

Robot Framework:

from robot.api.deco import keyword

@keyword
def add_numbers(a, b):
    """Adds two numbers and returns the result."""
    return a + b

Puppeteer:

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://example.com');
  await page.screenshot({ path: 'example.png' });
  await browser.close();
})();
20,214

Cross-platform automation framework for all kinds of apps, built on top of the W3C WebDriver protocol

Pros of Appium

  • Appium is a popular and widely-used framework for automating mobile app testing, supporting both iOS and Android platforms.
  • It provides a rich set of features and capabilities, including support for various programming languages, parallel testing, and integration with popular CI/CD tools.
  • Appium's architecture allows for easy extensibility and customization, making it a flexible choice for mobile app testing.

Cons of Appium

  • Appium can have a steeper learning curve compared to Robot Framework, especially for those new to mobile app testing.
  • Debugging and troubleshooting Appium can be more complex, as it involves managing the interactions between the test runner, the Appium server, and the mobile device/emulator.
  • Appium's performance and stability can be affected by the underlying mobile platform and device compatibility issues.

Code Comparison

Robot Framework:

from robot.api.deco import keyword

@keyword
def add_numbers(a, b):
    """Adds two numbers and returns the result."""
    return a + b

Appium:

from appium import webdriver

desired_caps = {
    'platformName': 'Android',
    'deviceName': 'emulator-5554',
    'appPackage': 'com.example.app',
    'appActivity': 'com.example.app.MainActivity'
}

driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Robot Framework

.. contents:: :local:

Introduction

Robot Framework <http://robotframework.org>_ |r| is a generic open source automation framework for acceptance testing, acceptance test driven development (ATDD), and robotic process automation (RPA). It has simple plain text syntax and it can be extended easily with generic and custom libraries.

Robot Framework is operating system and application independent. It is implemented using Python <http://python.org>_ which is also the primary language to extend it. The framework has a rich ecosystem around it consisting of various generic libraries and tools that are developed as separate projects. For more information about Robot Framework and the ecosystem, see http://robotframework.org.

Robot Framework project is hosted on GitHub_ where you can find source code, an issue tracker, and some further documentation. Downloads are hosted on PyPI_.

Robot Framework development is sponsored by non-profit Robot Framework Foundation <http://robotframework.org/foundation>_. If you are using the framework and benefiting from it, consider joining the foundation to help maintaining the framework and developing it further.

.. _GitHub: https://github.com/robotframework/robotframework .. _PyPI: https://pypi.python.org/pypi/robotframework

.. image:: https://img.shields.io/pypi/v/robotframework.svg?label=version :target: https://pypi.python.org/pypi/robotframework :alt: Latest version

.. image:: https://img.shields.io/pypi/l/robotframework.svg :target: http://www.apache.org/licenses/LICENSE-2.0.html :alt: License

Installation

If you already have Python_ with pip <https://pip.pypa.io>_ installed, you can simply run::

pip install robotframework

For more detailed installation instructions, including installing Python, see <INSTALL.rst>__.

Robot Framework requires Python 3.8 or newer and runs also on PyPy <http://pypy.org>. The latest version that supports Python 3.6 and 3.7 is Robot Framework 6.1.1__. If you need to use Python 2, Jython <http://jython.org> or IronPython <http://ironpython.net>_, you can use Robot Framework 4.1.3__.

__ https://github.com/robotframework/robotframework/tree/v6.1.1#readme __ https://github.com/robotframework/robotframework/tree/v4.1.3#readme

Example

Below is a simple example test case for testing login to some system. You can find more examples with links to related demo projects from http://robotframework.org.

.. code:: robotframework

*** Settings ***
Documentation     A test suite with a single test for valid login.
...
...               This test has a workflow that is created using keywords in
...               the imported resource file.
Resource          login.resource

*** Test Cases ***
Valid Login
    Open Browser To Login Page
    Input Username    demo
    Input Password    mode
    Submit Credentials
    Welcome Page Should Be Open
    [Teardown]    Close Browser

Usage

Tests (or tasks) are executed from the command line using the robot command or by executing the robot module directly like python -m robot .

The basic usage is giving a path to a test (or task) file or directory as an argument with possible command line options before the path::

robot tests.robot
robot --variable BROWSER:Firefox --outputdir results path/to/tests/

Additionally, there is the rebot tool for combining results and otherwise post-processing outputs::

rebot --name Example output1.xml output2.xml

Run robot --help and rebot --help for more information about the command line usage. For a complete reference manual see Robot Framework User Guide_.

Documentation

  • Robot Framework User Guide <http://robotframework.org/robotframework/#user-guide>_
  • Standard libraries <http://robotframework.org/robotframework/#standard-libraries>_
  • API documentation <http://robot-framework.readthedocs.org>_
  • General documentation <http://robotframework.org/>_

Support and Contact

  • Slack <http://slack.robotframework.org/>_
  • Forum <https://forum.robotframework.org/>_
  • robotframework-users <https://groups.google.com/group/robotframework-users/>_ mailing list

Contributing

Interested to contribute to Robot Framework? Great! In that case it is a good start by looking at the <CONTRIBUTING.rst>. If you do not already have an issue you would like to work on, you can check issues with good new issue and help wanted__ labels.

Remember also that there are many other tools and libraries in the wider Robot Framework ecosystem <http://robotframework.org>_ that you can contribute to!

__ https://github.com/robotframework/robotframework/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22 __ https://github.com/robotframework/robotframework/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22

License and Trademark

Robot Framework is open source software provided under the Apache License 2.0. Robot Framework documentation and other similar content use the Creative Commons Attribution 3.0 Unported license. Most libraries and tools in the ecosystem are also open source, but they may use different licenses.

Robot Framework trademark is owned by Robot Framework Foundation_.

__ http://apache.org/licenses/LICENSE-2.0 __ http://creativecommons.org/licenses/by/3.0

.. |r| unicode:: U+00AE