Robot Test Automation Framework in Python for Socket Programming

Robot Framework is a generic open source automation framework. It can be used for test automation and robotic process automation (RPA). Robot Framework has easy syntax, utilizing human-readable keywords. Its capabilities can be extended by libraries implemented with Python or Java. Robot Framework is operating system and application independent. The core framework is implemented using Python and also runs on Jython (JVM) and IronPython (.NET).

Robot Framework is a generic keyword-driven test automation framework for acceptance level testing and acceptance test-driven development (ATDD). Robot Framework is extremely easy to set up, use and modify.

Basic Setup

To get started with Robot Framework you first need to install Python and pip. If you have the environment properly configured you can just execute the below commands at command lines:

pip install robotframework
pip install robotframework-seleniuimlibrary

Creating Robot Framework Compatible Test Cases

Lets see with an example to use this framework. In this article i will be using Python Socket Programming code to connect to a server, send message and verify the responses. Following files were created to integrate the Message Decoder code into Robot Framework.

• MessageDecoder.resource –Contains all the Keywords.
• MessageDecoder.robot- Our Test Case is available in this file.
• MessageDecoder.py- Python file having all the necessary functions to interact with DB Server.
• Message_Decoder_Params.xlsx- Test data sheet.

Implementation of Python Socket Programming

By using Socket library from Python, we were going to perform client server communication, we could:
• Successfully connect to server.
• Able to send message to the server and
• Able to capture response back for verification.

Test Case File:

Test Resources File

Python Custom Library file

Test Execution Reports

https://robotframework.org/

https://github.com/raghwendra-sonu/Robot_Framework_Python

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store