Skip to content
المشاريع

adrianyorke/robotframework-cookbook

عرض على GitHub

حول

A curated list of Robot Framework recipes to help beginner and intermediate engineers create test automation scripts faster.

العلوم والهندسة

كيف تُقاس هذه الأرقام

250 نجمة63 التفرعات +1 خلال 24 ساعة

النمو المقاس للنجوم

خلال 24 ساعة
+١
خلال 7 أيام
+١
خلال 15 يومًا
+١
خلال شهر
جارٍ جمع السجل

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

Robot Framework Cookbook

Robot Framework Cookbook

All Contributors

Actions Status License: MIT code style: black Maintenance GitHub last commit GitHub stars

A curated list of delicious Robot Framework recipes that will help accelerate the development of test automation scripts, especially for beginner or intermediate level engineers.

If you need help writing Robot Framework scripts or wish to update older scripts to use newer syntax then you have come to the right place. Here we will compile and maintain recipes of working Robot Framework scripts that can be used in your domain.

In the first part of the cookbook there are many simple recipes showing how to use builtin keywords and additional keywords from both internal and external Robot Framework libraries. Towards the back of the cookbook there are complete case studies demonstrating whole projects and test automation solutions.

Other useful resources

Star History

Star History

Notes for contributors

Contributions from the wider community are most welcome! Contributions can be either single recipes or whole case studies.

We welcome pull requests from both human and AI contributors. AI generated pull requests are welcome, but AI slop is not, so please make sure you follow the instructions and test all changes locally before submitting.

We recommend using Robocop (Robotidy is integrated into Robocop as of 6.0) to standardise Robot Framework code and check that scripts are clean before submission.

Robocop can be installed using pip:

python -m pip install -U robotframework-robocop

Issues are welcome and you can use them to post ideas for new recipes or report bugs and other observations for existing recipes. All contributions, human and AI, must be linked to a relevant Issue.

For larger submissions simply clone this repository, create a feature branch (or work directly on master) and submit a pull request to merge your branch. If you are not comfortable with Git workflow then simply contact the maintainer of this project via email at [email protected] and I will help you publish your recipe or case study.

Installation and Usage

Python and Robot Framework must be installed prior to using Robot Framework Cookbook. Download Python and add to PATH during installation, then use a command-line interpreter of your choice and run the following to install Robot Framework:

python -m pip install -U robotframework

You can check if the installation was successful by running the following command:

robot --version

After confirming Robot Framework installation was a success, clone the Robot Framework Cookbook repository by running the following command:

git clone https://github.com/adrianyorke/robotframework-cookbook

Once the repository has been cloned, you can install relevant libraries by navigating to the tests folder and running:

python -m pip install -U -r ./tests/requirements-[version].txt

Understanding the Format of a Robot Framework Test Suite (*.robot)

The recipes in this Cookbook currently dive straight into the use of keywords from various Robot Framework libraries. Before making use of any of the recipes it is helpful to understand the basic format of a Robot Framework test suite.

A Robot Framework test suite is made up of one or more files that contain the following sections:

  • *** Settings *** - configuration for the test suite, such as library imports, documentation and metadata.
  • *** Variables *** - variables used by the test suite.
  • *** Test Cases *** - the test cases that contain the keywords to execute.
  • *** Keywords *** - reusable user keywords (optional).

The following example demonstrates the basic format using the content from Recipe 1.1 - Hello World Logging:

*** Settings ***
Documentation    CONTEXT:
...              You want to output a text message or variable to the log generated by Robot Framework.
...              DISCUSSION:
...              Congratulations!  You have created your first Robot Framework script which outputs
...              a text message and a variable to the log and also the console.
...              This recipe only using keywords from BuiltIn standard library so there is no Library import.
Test Tags        py3.11    py3.12

*** Variables ***
${recipe}         Recipe 1.1 Hello World Logging
${level}          Beginner
${category}       Internal Library: BuiltIn
${name}           Alan Turing

*** Test Cases ***
Sending Ouput To Log and Console
    [Documentation]    Output variables & text messages to the log, console or both.
    Log Variables
    Log    Hello World!
    Log    Hello ${name}!    console=yes
    Log To Console    Hello World again, this time only output to the console.

Metadata

The *** Settings *** section of a test suite can also be used to attach metadata and tags to the suite. Metadata is specified using the syntax name:value:

*** Settings ***
Metadata    cookbook:robotframework-cookbook
...        recipe:Hello World Logging

For more information see the Robot Framework User Guide.

Table of contents

  1. Standard Library - BuiltIn
  2. Standard Library - Collections
  3. Standard Library - DateTime
  4. Standard Library - OperatingSystem
  5. Standard Library - Process
  6. Standard Library - Remote Library
  7. Standard Library - String
  8. Working With Semi-Structured and Structured Data Files
  9. External Library - REST API
  10. External Library - Database Library
  11. External Library - SSH
  12. External Library - Parallel executor for Robot Framework test cases (pabot)
  13. External Library - SeleniumLibrary and SeleniumTestability
  14. External Library - AWSLibrary - for interacting with Amazon Web Services (AWS) Cloud Computing Services
  15. External Library - Robot Framework Browser library powered by Playwright.
  16. Robot Framework - Exploring New Syntax Introduced by Significant Releases
  17. External Library - Faker
  18. Working With Resource Files
  19. Case Studies

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Adrian Yorke
Adrian Yorke

💻 📖 🚧 👀
Tom Purl
Tom Purl

💻 📖
Szabolcs Tóth
Szabolcs Tóth

💻 📖
Jani Mikkonen
Jani Mikkonen

💻 📖
Bartłomiej Hirsz
Bartłomiej Hirsz

💻 📖 🚧 👀
Christoph
Christoph

💻 📖
Mikko Korpela
Mikko Korpela

💻 📖
ericbjones
ericbjones

🎨 💻 📖
Emna Ayadi
Emna Ayadi

📓 💻
Joonas Venäläinen
Joonas Venäläinen

💻
Aleksandra Kowalczyk
Aleksandra Kowalczyk

💻
Martin Škopek
Martin Škopek

💻
sarafurd
sarafurd

📖 🚧
Jeff Choi
Jeff Choi

📖 🚧
ChinoUkaegbu
ChinoUkaegbu

💻
Wu Shuwen
Wu Shuwen

🚧
ShahadatTest
ShahadatTest

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…