Introduction to Robot Framework

Framework : A framework or software framework provides a platform to develop applications on a particular subject. Through this framework, a software developer can build a program on a specific platform.

A Framework may include predefined classes and functions, these classes and functions may be used to process input and manage hardware devices and to interact with the system software.

Robot Framework : Robot framework is one of the worthiest and widely used test automation frameworks available in the market. The robot framework contains a set of tools, techniques, and abstracts rules.

The robot framework simplifies the test automation tools and has the capability to interact with third-party libraries and functions.

Generic test automation framework for acceptance testing

  • It is a Keyword-driven approach
  • Contains both internal and external test libraries
  • The core framework is implemented using Python
  • Users can create a new higher-level keyword from the existing ones
  • The robot framework is an open-source framework, and anyone can download it freely.
  • There is no particular requirement for writing codes, and we will use all the functions that are provided by internal and external libraries.
  • The robot framework supports all kinds of web-based API and Desktop application testing.
  • The robot framework provides detailed logs and clear reports.
  • Supports in creating data-driven test cases.
  • Enables easy integration with source control.



The Features of Ride Editor

Installation of Robot Framework

The robot framework is implemented with Python, Jython, and Iron Python, PyPy, and before installing the framework, we have to install at least one interpreter.

Different ways of installing framework are listed below:

  • Installing with pip
  • Installing from Source
  • Standalone JAR Distribution
  • Manual Installation

Variables in Robot Framework

Installing and Configuring Python into the System

By typing python in your command prompt, we can verify whether the python is installed in your system or not.

If the python is not installed in your system, then the windows will not recognize the python command and throws an error as python is not recognized as an internal and external program or batch file.

python-not-recongnised-as-internal-or-external

You can install the python in your system, refer the installation procedure: install the python

Configuring Python into the Windows

Open This PC/MY Computer and right-click on it and then select the Properties under that.

go-to-propertiese

Next, Under the Control Panel select the Advanced system settings and under the system properties, Select the Environmental Variables

environmental-variablesa

Select the system variables under the environmental variables and then click on the path and select edit (Environmental variables-->system variables-->path-->edit)

select-path-under-system-variables-edit-and-click-ok

Next, click on New under the edit environmental variable and add the python37 path to it as shown: C:Python3.7 and then click on the ok button.

select-new-and-add-ppython-file-path

Now, go to command prompt and enter python, You should see the version of the python in the command prompt.

python-recognzed-successfully

Web Elements of Robot Framework

Python Package Installer(PIP)

We can use the Python Package installer to install the packages from the python package index and other indexes.

Using the pip is the recommended way to install the robot framework, as the standard python package installer, it is included in the latest python, Jython and Iron Python versions.

If pip is already installed and if you are using python 2>=2.7.9 or python 3>=3.4, and directly executed by using the following code

pip install robotframework
If PIP is not installed:

Open the Command prompt and type as pip, if it is not configured in the system, then Windows will throw an error as pip is not recognized as an internal or external program.

pip-is-not-recognised-as-internal-or-external-ommand

Steps to Configure PIP:

The PIP has been configured in a different path, and hence, the system is not able to recognize the pip command.

To configure pip, go to MyComputer and select the system variables under the environmental variables and then click on the path and select edit (Environmental variables-->system variables-->path-->edit), Now enter. C:Python27Scripts a new variable path in the environmental variable.

configuring-pip

Go to command prompt and type pip, the windows will now show useful commands.

useful-commands-in-command-prompt

By typing pip --version, the windows give complete details on the pip version

new-pip-version

You can upgrade the pip version by using the command pip install --upgrade pip

upgrading-the-pip-versions

So the system will uninstall the old version of the pip and install the latest version of the pip.

upgraded-version-of-pips

The Features of Ride Editor

Installation of Robot Framework

The robot framework is an open-source framework, and hence the developers of the robot framework have pushed the source code into the Github.

You can download the robot framework by using the official link of the GitHub https://github.com/robotframework/robotframework

You can find the setup.py file in the Github page and download the robot framework.

setup-file-on-github

But we already have installed the pip, and hence we can install directly by using the command pip install robotframework

Open the command prompt and type the command as pip install robotframework

successful-installation-of-robot-framework

If you are behind a proxy, you need to use the proxy like

Locators in Selenium

Installation of Ride Editor Dependency Packages

Ride Editor dependencies contain the installation of Wxpython and Pywin32.

Installation of WxPython

Wxpython is a python package that can be imported at runtime, includes a collection of python modules and an extension module.

Wxpython provides a series of classes that mirror many of the wxWindows GUI classes. This extension module attempts to mirror the class hierarchy of wxWindows as closely as possible. This means that there is a wxFrame class in wxPython that looks, smells, tastes, and acts almost the same as the wxFrame class in the C++ version.

wxPython is very versatile. It can be used to create standalone GUI applications, or in situations where Python is embedded in a C++ application as an internal scripting or macro language.

Currently, wxPython is available for Win32 platforms and the GTK toolkit(wxGTK) on most Unix/X-windows platforms. The effort to enable wxPython for wxMotif will begin Shortly.

Let us see how to install Wxpython:

Log on to the given link https://github.com/robotframework/RIDE/wiki/Installation-Instructions

You will see the installation instructions for the robot framework, which contain some preconditions, as shown below:

installation-instructions

We have already installed python and Robot Framework, now install wxPython, click on the wxPython download page as shown below

click-on-the-link-to-install-wxpython

Once you click on the wxpython download page, it will take you to the wxPython version page and then select the wxPython version as shown below:

download-the-given-version

Once you click on the wxpython2.8-win64-unicode-2.8.12.1-py27.exe version, windows will start downloading the wxPython

installing-wxpython

Once it completes the download, right-click on the folder and install software

downloaded-wxpython

Click on the Next to install the wxPython on your computer

click-on-next-to-install-wxpython

Select I accept the agreement and click on Next.

click-on-accept-agreement-and-click-next

And then, select the destination and click on Next.

select-the-destination-and-click-next

Once it completes the installation, click on Finish.

click-on-finish

So, we have installed wxPython successfully on the system.

Basics of CSS Selector

Installation of PyWin32

The pywin32 package has been around for a very long time. The book that covers this topic was published in 2000 by Mark Hammond and Andy Robinson. Despite being 18 years old, the underlying technology and concepts still work today.

Pywin32 is a very thin wrapper of python that allows us to interact with COM (Component Object Module) objects and automate windows applications with python. The power of this approach is that you can pretty much do anything that a Microsoft Application can do through python.

The downside is that you have to run this on a windows system Microsoft Office installed. Before we go through some examples, make sure you have pywin32 installed on your system using pip or conda

Let us install the pywin32 on the system by using the pip.

First, go to the given link: https://pypi.org/project/pywin32/, you will see the below page

log-on-to-the-website-pywin32

Now, you can see the command to install the pywin32 on your computer, click on the copy symbol and then open the command prompt and paste it, so the system will start installing the pywin32.

new-installed-pywin-32

The pywin32 has been installed successfully on your system.

Excel Library in Robot Framework

Installation of Robot Framework IDE(RIDE)

The robot framework IDE is an integrated development environment to implement automated tests for Robot Automation.

Go to https://pypi.org/project/robotframework-ride/

copy-the-ride-command

And copy the command (pip install robotframework-ride) given in this page and open the command prompt and paste it and press enter. The RIDE will be installed successfully on the system.

robot-framework-ride

It has satisfied all the requirements and successfully installed the robot framework. To check whether the robot framework has succesfully installed or not, we have to run the command ride.py

If it is successfully installed, the ride editor page will open.

I am getting an error while opening the ride editor as shown below

C:UsersUser>ride.py
Traceback (most recent call last):
  File "C:UsersUserAppDataLocalProgramsPythonPython37Scripts
ide.py", line 21, in <module>
    from robotide import main
ImportError: No module named robotide

error-for-python-3

To overcome this error, I used the command python.exe -c "from robotide import main; main()" and press enter. The editor page will open, as shown below.

ride-editor-page





















Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions