Robot Framework#Examples
{{Short description|Type of test automation framework}}
{{multiple issues|
{{more footnotes|date=December 2012}}
{{notability|Products|date=December 2012}}
}}
{{Use mdy dates|date=March 2018}}
{{Infobox software
| name = Robot Framework
| logo = File:Robot-framework-logo.png
| screenshot =
| caption =
| developer = Pekka Klärck, Janne Härkönen et al.
| released = 2.0 {{release date|2008|06|24}}
| latest release version = {{wikidata|property|edit|reference|P348}}
| latest release date = {{start date and age|{{wikidata|qualifier|P348|P577}}}}
| latest preview version =
| latest preview date =
| programming language = Python
| operating system = Cross-platform
| genre = Software testing framework / test tool
| license = Apache License 2.0
| website = {{URL|robotframework.org}}
}}
Robot Framework is a generic software test automation framework for acceptance testing and acceptance test-driven development (ATDD). It is a keyword-driven testing framework that uses tabular test data syntax.{{cite web|url=https://robotframework.org|title=Robot Framework Homepage|publisher=Robotframework.org|accessdate=January 20, 2019}}
History
The basic ideas for Robot Framework were shaped in Pekka Klärck's masters thesis{{cite web|url=http://eliga.fi/writings.html |title=Laukkanen, Pekka: "Data-Driven and Keyword-Driven Test Automation Frameworks", 2006 |publisher=Eliga.fi |date= |accessdate=March 23, 2018}} in 2005. The first version was developed at Nokia Networks the same year. Version 2.0 was released as open source software June 24, 2008 and version 3.0.2 was released February 7, 2017.{{cite web|url=https://pypi.python.org/pypi/robotframework |title=Robot Framework Pypi Page |publisher=Robotframework.org |date= |accessdate=March 23, 2018}}
The framework is written using the Python programming language and has an active community of contributors. It is released under Apache License 2.0 and can be downloaded from robotframework.org.
In 2020 survey it scored 8 among 12 test automation frameworks, with 3 % of respondents using it.{{Cite web|title=Testing and QA - The State of Developer Ecosystem in 2020 Infographic|url=https://www.jetbrains.com/lp/devecosystem-2020|access-date=2021-10-15|website=JetBrains: Developer Tools for Professionals and Teams|language=en}} In 2021 it had fallen to 18 among 22 with 2 % usage.{{Cite web|title=Testing - The State of Developer Ecosystem in 2021 Infographic|url=https://www.jetbrains.com/lp/devecosystem-2021|access-date=2021-10-15|website=JetBrains: Developer Tools for Professionals and Teams|language=en}}
Description
Test cases are written using a keyword-testing methodology written in a tabular format. These tables can be written in plain text, tab-separated values (TSV), or reStructuredText (reST) formats files{{cite web|url=https://robotframework.org/robotframework/3.1.2/RobotFrameworkUserGuide.html#supported-file-formats |title=User Guide 3.1.2 |publisher=Robotframework.org |date= |accessdate=February 14, 2020}} in any text editor or using the Robot Integrated Development Environment (RIDE).{{cite web|url=https://github.com/robotframework/RIDE |title=RIDE Homepage |publisher=Github.com |date= |accessdate=February 14, 2020}} RIDE simplifies writing test cases by providing framework-specific code completion, syntax highlighting, etc.
Examples
The following test case implements a Hello, World! example:
- Test Cases ***
Demo
Log Hello world
Log
is a built-in keyword that logs the given parameter to the test report generated by Robot Framework.
With SeleniumLibrary,{{cite web|url=https://github.com/robotframework/SeleniumLibrary |title=Robot Selenium Library |publisher=github.com |date= |accessdate=March 23, 2018}} writing tests for web applications is very easy too:
- Test Cases ***
Demo
Open Browser https://www.google.com ie
Input Text id=lst-ib Hollywood Celebrities
Click Button Google Search
This test opens a new Internet Explorer browser window with Google and performs an Internet search for "Hollywood Celebrities" by pressing the button "Google Search".
With Robot Framework Browser,{{cite web|url=https://github.com/MarketSquare/robotframework-browser |title=Robot Framework Browser |publisher=github.com |date= |accessdate=August 5, 2020}} automation can be done with Chromium, WebKit and Firefox.
- Settings ***
Library Browser
- Test Cases ***
Example Test
New Page https://playwright.dev
Get Text h1 == 🎭 Playwright
Add-ons
See also
References
External links
- {{Official website|http://www.robotframework.org}}
Category:Free software programmed in Python