
References:
Python - https://www.python.org/downloads/
wxPython - https://sourceforge.net/projects/wxpython/files/wxPython/2.8.12.1/
note: RIDE might not work smoothly with python 3
Today we will learn:
1. How to setup Robot Framework from scratch
2. How to uninstall Robot Framework
3. Helpful Tips
How to setup Robot Framework
-------------------------------------------
Step 1 : Pre-check
Check if python is already installed
python --version
pip --version
Check if robot framework is already installed
robot --version
Step 2 : Install Python
check on cmd : python --version
pip --version
Step 3 : Set Python in environment variables
C:\Python27;C:\Python27\Scripts;
Check:
python --version
pip --version
Step 4 : Install robot framework
pip install robotframework
to uninstall : pip uninstall robotframework
Step 5 : Check on cmd :
robot --version
pybot --version
Step 6 : Download and install wxPython
https://sourceforge.net/projects/wxpython/files/wxPython/2.8.12.1/
check with : pip freeze
wxpython should be available
Step 7 : Install RIDE
pip install robotframework-ride
https://github.com/robotframework/RIDE/wiki/Installation-Instructions
Step 8 : On cmd goto folder where ride.py is (C:\Python27\Scripts)
run on cmd : ride.py
This should open RIDE
======================================================
How to uninstall Robot Framework
-------------------------------------------------------
pip uninstall robotframework-ride
pip uninstall robotframework
======================================================
Helpful TIPS:
1. Always install wxPython before installing RIDE.
wxPython is a wrapper for getting the GUI of RIDE.
So it is important to install wxPython before you install RIDE
2. Always check your python version and install wxPython for the same version
***32 bit - check your python ver by running command python and install same bit wxpython
3. pip cache folder is located at - C:\Users\Raghav Pal\AppData\Local\pip\cache
If you uninstall a lib and install it again, it will use the zip from cache.
to install fresh
- you can empty contents of cache folder
- pip install --no-cache-dir robotframework-ride
4. Versions prior to Robot Framework 3.0 did not have the robot script. Instead they had pybot, jybot and ipybot scripts that executed tests using Python, Jython and IronPython, respectively. These scripts are still installed, but the plan is to deprecate and remove them in the future.
5. Robot Framework UserGuide -
http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html
https://github.com/robotframework/QuickStartGuide/blob/master/QuickStart.rst
Keyboard Shortcuts -
https://github.com/robotframework/RIDE/wiki/Keyboard-Shortcuts
RF GitHub page -
https://github.com/robotframework
__________________________________________________________________
References
http://robotframework.org/
https://github.com/robotframework/RIDE/wiki/How-To
https://github.com/robotframework/SeleniumLibrary/
http://robotframework.org/SeleniumLibrary/SeleniumLibrary.html
http://www.seleniumhq.org/download/
Robot Framework Beginner Tutorial 1 - Getting started with Robot Framework Step by Step
What is Gecko Driver - https://www.youtube.com/watch?v=3-Jq9GrNVVc
Today we will learn:
1. How to add browser exe files
2. How to run test on different browsers
----------------------------------------------------------------------------------
Step 1 : Open RIDE
Step 2 : Create a step to open browser in Firefox
This will fail if you do not have firefox driver exe (gecko driver exe) in Python folder
Step 3 : Get browser Driver exe file. Goto SeleniumHQ.org and Download browseR driver exe file
Step 4 : Keep the driver exe file in \Python27\Scripts folder
Note : This folder should be addded in environment path variable
(You can use any other location inside python folder as well)
Step 5 : Open RIDE - Goto Test Case - In the test step open browser give the browser name
BROWSER NAME TO USE
Firefox firefox, ff
Google Chrome googlechrome, chrome, gc
Internet Explorer internetexplorer, ie
Edge edge
Step 6 : Run and Validate
------------------------------------------------------------------------------------
Today we will learn:
1. What are variables in RobotFramework
2. Types of Variables
3. How to create variables
4. How to Refer variables
Useful TIPS
__________________________________________________________________
What are Variables
Variables are elements used to store values that can be referenced by other elements
RobotFramework has 3 types of variables
SCALAR
LIST
DICTIONARY
we can also use
ENVIRONMENT variables
Step 1 : Open RIDE
Step 2 : Create a Test Case for login
http://opensource.demo.orangehrmlive.com/login
Step 3 : Create a SCALAR variable for url and refer in TestCase
syntax : ${VariableName}
Step 4 : Create a LIST variable for username and password and refer in TestCase
syntax : @{VariableName}
Step 5 : Create a DICTIONARY variable for username and password and refer inTestCase
syntax : &{VariableName}
Environment
%{variable name}
Useful TIPS
=========
1. If a non-existent variable is used in test-data, the keyword using it will fail
2. We can set variables from command line
3. Variables are case-insensitive
4. As best practice use uppercase variable names for global variables
And lowercase variable names for local variables
5. Built in variables - http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#built-in-variables
____________________________________________________________
Today we will learn:
1. What are Keywords
2. Types of Keywords
3. How to create User Keywords
4. How to reference User Keywords
USEFUL TIPS
2 Types:
LIBRARY KEYWORDS : low level keywords
USER KEYWORDS : high level keywords
custom keywords
combination of library keywords/actions
Step 1 : Open RIDE
Step 2 : Right click on Project / Test Suite - New User Keyword
Step 3 : Create a keyword for Login
Step 4 : Refer the keyword in a TestCase
Useful Tips
User Keyword syntax is similar to TestCase syntax
Search Keyword - F5
Find Usage
Today we will learn:
1. What is Setup and TearDown
2. How to use
SETUP - keyword executed before running any lower level component/keyword
TEARDOWN - keyword executed after running any lower level component/keyword
Step 1 : Open RIDE
Step 2 : Create TestSuite Setup and Teardown and run it
====================================================
Today we will learn:
1. How to create TAGS
2. How to use tags during Test Execution
3. How to use tags in Reports
4. How to create Dynamic Tags
5. How to set TAGS from command line
Sanity, Smoke, Regression, Critical
Tags are used to classify/categorize test cases
Useful TIP
command line option : --settag
Step 1 : Goto cmd and cd to your robot framework project
Step 2 : syntax
robot -t TestName --settag=TagName TestSuite.txt
Today we will learn:
1. How to run one specific Test from cmd
2. How to run few selected Tests from cmd
3. How to run tests with TAGS from cmd
4. How to run all Tests in a Suite from cmd
5. How to send RESULTS to a specific folder
Useful TIPS
______________________________________________________________
Step 1 : Open cmd and goto the location of project
Step 2 : Run single test
robot -t TestName SuiteFile
Step 3 : Run multiple tests
robot -t Test1 -t Test2 SuiteFile
Step 4 : Run Tests with TAGS
Include TAGS
robot --include tagName SuiteFile
robot -i tagName SuiteFile
robot -i tagName -i tagName SuiteFile
robot -i S* SuiteFile
Exclude TAGS
robot --exclude tagName SuiteFile
robot -e tagName SuiteFile
robot -e tagName -e tagName SuiteFile
robot -e S* SuiteFile
Step 5 : Run all tests in a test suite
robot suiteFile
Step 6 : Send results to a folder
robot -t Test5 -d Results TestSuite1.txt
Useful TIPS
Using regular expressions
how to make tags critical / non-critical
e.g.
robot -i S* --critical Smoke TestSuite1.txt
robot -i S* -c Smoke TestSuite1.txt
robot -i S* --noncritical Smoke TestSuite1.txt
robot -i S* -n Smoke TestSuite1.txt
Command line options guide
https://github.com/robotframework/robotframework/blob/master/doc/userguide/src/Appendices/CommandLineOptions.rst
______________________________________________________________
Today we will learn:
1. How to create job in jenkins
2. How to add robot framework plugin in jenkins
3. How to configure robot framework tests in Jenkins
4. Show html reports on jenkins
5. Run and Validate
Useful TIPS
_______________________________________________
Step 1 : Download Jenkins
Step 2 : Start Jenkins
Step 3 : Add robot framework plugin in jenkins
Step 4 : Create job to run robot framework tests
Step 5 : Run and validate
In case not able to see the html reports in jenkins
Goto Manage Jenkins - Script Console
Add this script and run
System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "")
If you see Result, it means success
Now from next runs html reports will be accessible from jenkins
_____________________________________________________________
Useful Tips
Goto Dashboard - You will find a new column Robot Results
You can use wild cards in name of output files of robot framework in Jenkins
Jenkins content security policy - to enable viewing html reports
_____________________________________________________________
Today we will learn:
1. Different ways to install Robot Framework
2. How to verify Installation
3. How to upgrade to latest version
4. How to download and install
5. How to uninstall
USEFUL TIPS
______________________________________________________
INSTALL
1. Install latest version
pip install robotframework
2. Install a specific version
pip install robotframework==2.9.0
3. Do a fresh install ignoring cached files
pip install --no-cache-dir robotframework
VERIFY INSTALLION
robot --version
UPGRADE
pip install --upgrade robotframework
DOWNLOAD AND INSTALL
pip download robotframework
pip install robotframework-3.0.tar.gz
UNINSTALL
pip uninstall robotframework
USEFUL TIPS
rebot --version
rebot --help
______________________________________________________
Useful Commands
robot --version
robot --help
pip freeze
pip list
pip show
pip check
In this course we will learn Robot Framework from scratch.
Here we will use Robot Framework to test Web Browser applications using Selenium library and RIDE (Robot Framework IDE)
This course is designed for complete beginners and we will go very basic, Step by Step.
After this course you can work with Robot Framework for web browser automation testing using Selenium.
LET'S GET STARTED...