A quick start guide to start working with Robot Framework.
End to End flow form installation to test case automation to verifying result, using both GUI and Command Prompt options.
2. Table of Contents
1. What is Robot Framework?
2. Benefits of Robot Framework?
3. Robot Framework Architecture and Test Flow
4. Robot Framework Libraries
5. PyPI (Python Repository)
6. Tools
7. How to install Robot Framework on Windows?
8. Robot Framework usage with an example
9. Logs and Report
3. What is Robot Framework?
Robot Framework is a generic test automation framework.
It has easy-to-use tabular test data syntax.
It utilizes the keyword-driven testing approach.
Its testing capabilities can be extended by test libraries.
Users can create new higher-level keywords from existing ones using the
same syntax.
It is operating system and application independent. The core framework is
implemented using Python.
Robot Framework itself is open source.
4. Benefits of Robot Framework?
Ease of Use - Robot Framework allows Keyword Driven Testing and even
behavior driven one.
Code Writing - Write only as much as you need for your automation.
(Standard login page code will not be more than 6 lines)
Parallel Execution - Possible using external tools (example - Pabot)
Logging and Failure Analysis - Neat and clean logs and reports. Comes with
screenshot.
Flexibility - There are many thing you can't do. if-else (only if block). No
nested loops. And many things if you need complex coding. For many things
you can write custom keyword in Python
Framework Design - It's a readily available framework so we don’t need to
waste time in designing framework.
5. Robot Framework Architecture and Test Flow
When test execution is started, the
framework first parses the test data.
It then utilizes keywords provided by the test
libraries to interact with the system under
test.
Libraries can communicate with the system
either directly or using other test tools as
drivers.
Test execution is started from the command
line and at the end of execution you get
report and log HTML format as well as XML
output.
6. Robot Framework Libraries
Test libraries provide the actual testing capabilities to Robot Framework by
providing keywords.
8. PyPI
PyPI - the Python Package Index (https://pypi.python.org)
The Python Package Index is a repository of software for the Python
programming language. There are currently 109798 packages here.
The more you explore it the more you get
12. How to install Robot Framework on Windows?
We will install Robot Framework with pip.
Pip is the standard Python package manager and is already installed if
you’re using Python 2 >=2.7.9 or Python 3 >=3.4
We can find it under Scripts folder wherever our python is installed.
13. How to install Robot Framework on Windows?
Step-1: Install Phyton
Go to https://www.python.org/ , download and install Python 2.7.x version
14. How to install Robot Framework on Windows?
Step-2: Install Robot Framework using PIP (Automatically Installs the latest version)
Open command prompt and run below command.
pip install robotframework
If installing first time
If already installed
15. How to install Robot Framework on Windows?
Common usages using PIP
16. How to install Robot Framework on Windows?
Step-4: Verifying Installation
After a successful installation, you should be able to execute below
commands and get both Robot Framework and interpreter versions.
robot --version
rebot --version
17. How to install Robot Framework on Windows?
Note: If you have any problem please check Path configuration and restart
your PC.
Path configuration must be as same as below figure.
18. How to install Robot Framework on Windows?
Step-5: Installing RIDE (RIDE is a test data editor for Robot Framework test
data)
Python 2.6 is the minimum version.
RIDE's GUI is implemented using wxPython toolkit. Only wxPython
2.8.12.1 with Unicode support is officially supported.
Notice that similarly as Robot Framework, RIDE does not yet support
Python 3.
19. How to install Robot Framework on Windows?
Step-5: Installing RIDE (Robot Framework Test Data Editor)
Step-5.1: Python must be installed. (Mandatory)
20. How to install Robot Framework on Windows?
Step-5: Installing RIDE (Robot Framework Test Data Editor)
Step-5.2: wxPyhton must be installed.
We need to install “wxPyhton2.8-win32-unicode-2.8.12.1-py27.exe” 32-bit
version.
WARNING!
If you install latest version, you will get below error!
21. How to install Robot Framework on Windows?
Step-5: Installing RIDE (Robot Framework Test Data Editor)
Step-5.3: Install RIDE with below pip command
pip install robotframework-ride
For new install
If already installed
22. How to install Robot Framework on Windows?
Step-5: Installing RIDE (Robot IDE)
Step-5.4: After a successful installation, RIDE can be started from the
command line or Run window using command ride.py
Command Prompt
Run Window
23. Installing Specific Library
To install library either user can get the details from Robot Framework official website or user can visit the respective
GitHub repository for the specific needs.
Let’s start with RequestsLibrary. (Library that uses the Requests HTTP client.)
Installation Command:
pip install robotframework-requests
24. How to install Robot Framework on Windows?
Upgrade Library Command:
pip install --upgrade robotframework-requests
25. Robot Framework Usage with an Example
Test Scenario: Rest_Test
1. Create Session against the host
2. Get Request for the specific URI
3. Verify Response
26. Robot Framework Usage with an Example
Directory Structure:
▪ Resource.robot file holds Settings, Variables, Keywords information.
▪ Projects.robot file contains Test Suites and Test Cases which are using our High Level Keywords.
▪ However, creation of directory is on need basis and different project requirements. User can
even create Keywords in Projects.robot and vice versa.
27. Robot Framework Usage with an Example
Projects.robot:
▪ Here, CreateExternalSystem.robot is a test suite file which holds different test cases.
▪ On Suite Level we can define any specific settings explicitly apart from Resource file.
▪ Test Suite Arch:
31. Robot Framework usage with an example
Running the test case :
There are two ways to run the test case:
Run From the RIDE tool itself
32. Logs and Report
To view log and report access it directly by clicking below icons.
33. Robot Framework usage with an example
The other way is we can Run it from Command Prompt : To do so user need to navigate to that
project directory from command prompt and then run the below command :
34. Logs and Report
On successful execution of
test case you will get the below
Results:
1. Log.html
2. Output.xml
3. Report.html
report.html