Selenium Robot Framework
| Introduction | |
| Install | |
| Test with Selenium WedDriver | |
| Related Articles |
Introduction
For a long time SeleniumLibrary was de facto default library for UI testing of web applications.
Documentation
Installation
python -m pip install robotframework-seleniumlibrary
Collecting robotframework-seleniumlibrary Downloading robotframework_seleniumlibrary-5.1.3-py2.py3-none-any.whl (94 kB) |████████████████████████████████| 94 kB 1.6 MB/s Collecting selenium>=3.141.0 Downloading selenium-3.141.0-py2.py3-none-any.whl (904 kB) |████████████████████████████████| 904 kB 51.5 MB/s Collecting robotframework-pythonlibcore>=2.1.0 Downloading robotframework_pythonlibcore-2.2.1-py2.py3-none-any.whl (10 kB) Requirement already satisfied: robotframework>=3.1.2 in /home/andrei/robotframework/myvenv/lib/python3.9/site-packages (from robotframework-seleniumlibrary) (4.0.1) Collecting urllib3 Using cached urllib3-1.26.4-py2.py3-none-any.whl (153 kB) Installing collected packages: urllib3, selenium, robotframework-pythonlibcore, robotframework-seleniumlibrary Successfully installed robotframework-pythonlibcore-2.2.1 robotframework-seleniumlibrary-5.1.3 selenium-3.141.0 urllib3-1.26.4
Example of test with Selenium WebDriver
The peculiarity of Robot Framework syntax is that between the keyword
and the value you need to put two spaces.
For example, between Library and SeleniumLibrary you need to put two spaces.
Created a simple test in the file
GoogleSearch.robot
*** Settings ***
Documentation Simple example using SeleniumLibrary.
Library SeleniumLibrary
*** Variables ***
*** Test Cases ***
This is sample test case
[documentation] Google test
[tags] regression
Open Browser http://www.google.com chrome
Close Browser
*** Keywords ***
robot -d results Tests/Google/FunctionalTestSuite/GoogleSearch.robot
============================================================================== GoogleSearch :: Simple example using SeleniumLibrary. ============================================================================== This is sample test case :: Google test DevTools listening on ws://127.0.0.1:64096/devtools/browser/b2618042-f0b5-4e41-976f-106fdd21d9v0 This is sample test case :: Google test | PASS | ------------------------------------------------------------------------------ GoogleSearch :: Simple example using SeleniumLibrary. | PASS | 1 test, 1 passed, 0 failed ============================================================================== Output: /home/andrei/robotframework/RobotFWTutorial/results/output.xml Log: /home/andrei/robotframework/RobotFWTutorial/results/log.html Report: /home/andrei/robotframework/RobotFWTutorial/results/report.html
firefox Results/report.html
Robot Framework
A more detailed report is available at log.html
| Robot Framework | |
| Основы | |
| Архитектура | |
| RFBrowser | |
| Selenium |