Python Robot framework setup on Mac:
Know about Robot framework:
Robot framework is a test automation framework which is used for acceptance testing and ATDD (Acceptance test driven development). It is a keyword driven testing approach. There are many predefined keywords which are implemented using Python and Java. We can write our own new keywords using the existing predefined keywords.A good documentation is on Github ,
https://github.com/robotframework/robotframework
Robot framework has many keywords which will be useful when writing test automation either for desktop web application or a mobile application. You just need to import the respective library before using it.
Here is the guide for seleniumLibrary keywords :
GitHub Selenium Library
SeleniumLibrary
Here is the guide for appiumLibrary keywords which can be used for mobile app automation:
Appium Library
The above 2 guides are super useful when writing the test automation, those urls are very clear on using different keywords with good examples.
So, How write test automation using Robot Framework and Python:
You can use Robot framework either using Python or Java. Im familiar with using Python, So I put the things in Python based environment.
Tip : Always try to be updated so that you can get access to most updated features, So always try to use latest release versions.
Tools used:
Pycharm Community Edition (Which you can download for free) , download it here based on your computer OS : https://www.jetbrains.com/pycharm/download
First step is to have the environment setup:
- Install Python on your machine, If not done please do the installation.
- Then proceed to Robot framework related installation using pip command
- Check installation using
- Install selenium library using
- install appium library using (If you want to write mobile automation)
pip install robotframework
robot --version
pip install robotframework-seleniumlibrary
pip install robotframework-appiumlibrary
........Boom..!! there you go its done. You are ready to rock.
Second step is How to create a new Robot framework project in pycharm:
Ok, In pycharm Create a new project using following steps

So, A new Project will be created like this, with selected python environment 
Okay, We have the new project created. Whats next?
So, Now you know how to create a new project with necessary installations.
Okay, let me explain more about .robot file. What robot file contains?
Robot file contains:
Test cases:
- Test cases are written under the representation of *** Test Cases ***
- A robot file contains many test cases, All should be written under *** Test Cases ***
- Each test case contains a title called Test title (Test title is a sentence or a word which tells about the test scenario/user journey or a behaviour)
- Each test case have test steps (Keywords) written under test title
- A robot file may or may not have keywords section. If we use the predefined keywords. Then no need to implement user defined keywords, In such case there will not be use of keywords section.
- Keywords can be written under *** Keywords ***
- Keyword has a keyword name. which we will use in test cases or in another keyword definition
- user defined Keyword can use a predefined keywords or a user defined keyword
- Settings section is used to import the libraries.
- A library can be a python predefined library, user defined robot file or a python file.
- Variables is a section, where we can define some variables which can be used across the robot file.
- Variables should be written under *** variables ***
- examples:
*** Variables ***
${Var1} value
${Var2} 2
${Var3} https://www.google.com
If you observe the snippet,
Settings section:
- I have imported the `SeleniumLibrary` using `Library` command
- You can use `Resource` to import another robot file which has user defined keywords
- You can use `Variables` to import other python files of your project which contains variables
- There is only one test case in this file.
- Test cases are written in Gherkin format, Robot framework can understand those words so it ignores those Gherkin wordings
- All the yellow coloured sentences are keywords. 3 keywords from SeleniumLibrary and 1 is user defined keyword
- I have used a variable which is defined in variables section
- Some keywords take arguments. example : `Input Text` keyword takes locator (name:q —> this is the identifier of google search box) and value (hello —> to input)
- [Tags] are used when you want to run the test cases based on some grouping, so please give proper tag names
- [Documentation] is like doc
- I have implemented one user defined keyword, which I have used in the test case
- My user defined keyword uses predefined keyword. It can also use another user defined keyword.
- Keywords can accept arguments
**The test cases, keywords and its parameters/arguments can be separated using pipe symbol (|) or minimum 2 spaces. In this blog I used tab.
Okay, How to run a robot framework test case,
pybot tests/test_first.robot
Robot framework generates beautiful html reports. The reports are very detailed reports.
This is just from my learning. There is a lot to explore. Hope this helps you start your learning. Thanks for reading, Happy learning.

You have written an excellent blog.keep sharing your knowledge.
ReplyDeleteRobot Framework Test Automation Training in Chennai
Robot Framework Test Automation Course in Chennai
Robot Framework Test Automation Online Training
Robot Framework Test Automation Online Course
Really an informative blog...Thanks for sharing an informative article with us.
ReplyDeleteWhat is blockchain?
Why blockchain is important
Great Content. Thanks for sharing this valuable information. It will be useful for knowledge seekers.
ReplyDeleteScrum Master Certification In Chennai
CSM Training In Bangalore
Scrum Master Certification Online
This post is so interactive and informative.keep update more information...
ReplyDeletedot net training in T Nagar
Dot net training in Chennai
This post is so interactive and informative.keep update more information...
ReplyDeleteJava Training in Tambaram
Java training in chennai
Great blog with useful information.
ReplyDeleteFeatures of Robot Framework
Scope of Robot Framework
Useful blog, keep sharing with us.
ReplyDeleteBenefits of Robot Framework Test Automation
Advantages of Robot Framework Test Automation
Great blog with good information.
ReplyDeleteRobot Framework Test Automation Course in Chennai
Robot Framework Test Automation Online Course
Robot Framework Test Automation Course in Bangalore