Robot Framework - Installation guide , usage , advantages with Python 3.x
About
Robot Framework is a generic open source automation framework. It can be used for test automation and robotic process automation (RPA).
Robot Framework is open and extensible and can be integrated with virtually any other tool to create powerful and flexible automation solutions. Being open source also means that Robot Framework is free to use without licensing costs.
Robot Framework is operating system and application independent. The core framework is implemented using Python and also runs on Jython (JVM) and IronPython (.NET).
Libraries
- Standard --- Built-in , Operating System, String , Process
- External --- Datetime, Dialogs, Remote, Telnet
- Others --- Collections, Screenshot, XML
What does each library has?
1.Standard:
a.Built-in
Provides a set of often needed generic keywords. Always automatically available without imports.
Sample Keywords in Standard Library: Should Be Equal, Should Contain etc.,
b.Operating System
Enables various operating system related tasks to be performed in the system where Robot Framework is running.
Sample Keywords in Standard Library: Create File, Remove Directory), check whether files or directories exists or contain something (e.g. File Should Exist, Directory Should Be Empty);
c.String
String is Robot Framework's standard library for manipulating strings (e.g. Replace String Using Regular expressions, Split To Lines)
d.Process
Library for running processes in the system. New in Robot Framework 2.8.
The library has following main usages:
• Running processes in system and waiting for their completion using Run Process keyword.
• Starting processes on background using Start Process.
• Waiting started process to complete using Wait For Process or stopping them with Terminate Process or Terminate All Processes.
1.Other Libraries:
a.Collections
Sample Keywords in Collections librabry (e.g. Append To List, Get From Dictionary) and for verifying their contents (e.g. Lists Should Be Equal, Dictionary Should Contain Value).
Sample keywords in Screenshot Library:
- Set Screenshot Directory
- Take Screenshot
- Take Screenshot Without Embedding
Application Functional Keywords
These are keywords designed based on a particular function performed in web application using the existing robot framework keyword.
These keywords can be utilized in our test case scripts.
Eg:
Login to fb.com
Open Browser ${URL} ${Browser}
Input Text ${Xpath_LoginField} ID
Input Text ${Xpath_password} password
Click Element ${Xpath_Submit}
Robot Framework Built-in Keywords:
The pre-defined robot framework keywords that are available in the installed framework version
Libraries:
The Robot framework leverages on the different libraries to perform different actions
Data Base libraries to make Database connections and get data from DB.
Selenium libraries to perform all the web-based actions on the browsers.
System Under Test:
Our Application on which we want to perform automation.
3. Merits of Robot framework:
• Keywords written in plain simple English
• Test cases can be executed with nightly regression and generate report for a large batch of test cases using tag names.
• Framework designed in user friendly manner that any non-technical person can learn and start implementing in 1-2 weeks with basic debugging and coding skills
• Inherently Keyword driven
• Ability to Data driven approach->Excel, flat file, DB, Variables
• Predefined libraries, so higher level of encapsulation
• Compatibility with Java and Python
• Selenium, DB, Python Date Time libraries to use
• Effort saving
• Almost 40% time saving
Sample Report:
4. Installation Guide and steps:
Prerequisites
Installing Python latest version :
Get Python executable file from:
https://www.python.org/ Install the latest version
Check for the Python installation and version using command ‘python -version’

Steps to Install PIP:
- 1. Go to https://bootstrap.pypa.io/get-pip.py
- 2. Copy the entire content in to a text file and name it as get-pip.py (Note: .py is python extn)
- 3. Run the file from the command line using the command ‘python get-pip.py’

Installing Robot framework:
Run the command ‘pip install robotframework’ .

Installing Selenium2 libraries:
Run the command ‘pip install robotframework-selenium2libraries’ .

No comments:
Post a Comment