Robot framework
- Generic test automation framework for acceptance testing
- Keyword Driven (standard, user defined)
- Can be extended with programming language libraries
Advantages
- Free
- Easy Syntax
- Mininum coding efforts
- Reporting, Logging
- Many standard, external libs, extensions with python programming
- Distributed structure
Install Robot Framework
Framework
pip install robotframework
Collecting robotframework
Downloading robotframework-4.0.3-py2.py3-none-any.whl (655 kB)
|████████████████████████████████| 655 kB 2.1 MB/s
Installing collected packages: robotframework
Successfully installed robotframework-4.0.3
pip install robotframework-seleniumlibrary
Collecting robotframework-seleniumlibrary
Downloading robotframework_seleniumlibrary-5.1.3-py2.py3-none-any.whl (94 kB)
|████████████████████████████████| 94 kB 1.7 MB/s
Requirement already satisfied: robotframework>=3.1.2 in /usr/local/lib/python3.9/site-packages (from robotframework-seleniumlibrary) (4.0.3)
Collecting robotframework-pythonlibcore>=2.1.0
Downloading robotframework_pythonlibcore-3.0.0-py2.py3-none-any.whl (9.9 kB)
Collecting selenium>=3.141.0
Downloading selenium-3.141.0-py2.py3-none-any.whl (904 kB)
|████████████████████████████████| 904 kB 3.2 MB/s
Collecting urllib3
Downloading urllib3-1.26.5-py2.py3-none-any.whl (138 kB)
|████████████████████████████████| 138 kB 3.2 MB/s
Installing collected packages: urllib3, selenium, robotframework-pythonlibcore, robotframework-seleniumlibrary
Successfully installed robotframework-pythonlibcore-3.0.0 robotframework-seleniumlibrary-5.1.3 selenium-3.141.0 urllib3-1.26.5
Browser driver
brew install chromedriver
Create test case
*** Settings ***
Library SeleniumLibrary
*** Variables ***
${BROWSER} Chrome
${URL} https://ranking.rakuten.co.jp
*** Test Cases ***
Browser Start and Close
Open Browser ${URL} ${BROWSER}
Close Browser
Input Search Keyword
Open Browser ${URL} ${BROWSER}
Maximize Browser Window
Enter Search Keyword 本
# This kind of keyword is basically calling API connected with Selenium
*** Keywords ***
Enter Search Keyword
[Arguments] ${searchkeyword}
Input Text name: stx ${searchkeyword}
Run the tests
robot start_close_browser.robot
==============================================================================
Start Close Browser
==============================================================================
Browser Start and Close | PASS |
------------------------------------------------------------------------------
Input Search Keyword | PASS |
------------------------------------------------------------------------------
Start Close Browser | PASS |
2 tests, 2 passed, 0 failed
==============================================================================
Output: /Users/woohyeok.kim/Desktop/study/robotframework-basic/testcases/output.xml
Log: /Users/woohyeok.kim/Desktop/study/robotframework-basic/testcases/log.html
Report: /Users/woohyeok.kim/Desktop/study/robotframework-basic/testcases/report.html
github.com