Key Elements of Robot Framework



1. Test Data Syntax:
Robot Framework uses simple and easy-to-understand tabular syntax for test data representation. Test cases, test suites, and keywords are organized in tables, making them highly readable for any test designer.

*** Test Cases ***
Verify Login Functionality
    [Documentation]   Test to verify the login functionality
    [Tags]   Smoke
    Open Browser   ${URL}   ${Browser}
    Input Text   ${UsernameField}   ${Username}
    Input Text   ${PasswordField}   ${Password}
    Click Button   ${LoginButton}
    Page Should Contain Element   ${WelcomeMessage}
    Close Browser



2. Built-in Keywords & Libraries:
Robot Framework provides a rich set of built-in keywords that covers various aspects of test automation, including browser interaction, file operations, database connections, and more. These keywords can be readily used to build test cases.
Also, Robot Framework supports a wide range of test libraries, enabling users to perform various types of testing such as web testing, API testing, database testing, and more. These libraries provide additional keywords and functionality specific to different testing domains.
Example of Keywords:
*** Test Cases ***
Verify Search Functionality
    [Documentation]   Test to verify the search functionality
    [Tags]   Regression
    Open Browser   ${URL}   ${Browser}
    Input Text   ${SearchField}   ${SearchKeyword}
    Press Key   ${SearchField}   ENTER
    Wait Until Page Contains   ${SearchResult}
    Close Browser

Example of  Test Libraries With Selenium and for REST API:

*** Settings ***
Library   SeleniumLibrary
Library   RESTInstance   ${APIEndpoint}

*** Test Cases ***
Verify API Functionality
    [Documentation]   Test to verify the API functionality
    Create Session   MySession   ${APIEndpoint}   headers=${APIHeaders}
    ${response}   Post Request   MySession   /users   data=${Payload}
    Should Be Equal   ${response.status_code}   201
    Close All Sessions


3. Extensibility:
Robot Framework is highly extensible, allowing users to define their own keywords and libraries using Python or other programming languages. This makes it flexible and adaptable to different testing needs and environments.
*** Settings ***
Library   SeleniumLibrary
Library   DatabaseLibrary

*** Test Cases ***
Verify Database Connection
    [Documentation]   Test to verify the database connection
    Connect To Database   ${DBUrl}   ${DBUsername}   ${DBPassword}
    ${queryResult}   Query   SELECT * FROM Users
    Log Many   ${queryResult}
    Disconnect From Database


4. Test Data-driven Approach:
 Robot Framework promotes a data-driven approach to testing, where test data is separated from test logic. This allows for efficient test maintenance and reusability, as test data can be easily modified or extended without changing the underlying test cases.
*** Settings ***
Resource   TestData.robot

*** Test Cases ***
Verify Login Credentials
    [Documentation]   Test to verify different login credentials
    [Template]   Verify Login
    ${username}   ${password}   ${expectedMessage}


5. Test Execution and Reporting:
Robot Framework offers comprehensive test execution capabilities, allowing tests to be run in various modes, including sequential, parallel, and distributed execution. It generates detailed test reports and logs, making it easy to analyze test results and identify issues.

$ robot --outputdir results tests


6. Cross-platform Support & Easy Integration:
Robot Framework is platform-independent and can be used for testing applications across different operating systems, including Windows, macOS, and Linux. It can be easily integrated with other tools and frameworks, such as Jenkins for continuous integration, Selenium for web testing, and RESTAssured for API testing. It also has a large and active community that contributes libraries, plugins, and resources to enhance its functionality.


Finally, Robot is a powerful tool and test automation framework with nice features that make it stand out. 
  1. Its simple and readable syntax allows for easy test case creation and maintenance.
  2. The modular and extensible architecture enables integration with various libraries and tools, expanding its capabilities.
  3. The built-in test reporting and logging features provide detailed insights into test execution.
  4. The support for data-driven and keyword-driven testing promotes reusability and maintainability.
Using this framework test automation developers or testers can efficiently design and execute automated tests, accelerating the software testing process and improving the quality of software products.
You can embrace Robot Framework and unlock the potential of automated testing in your projects!
Read More »

Using Docker in Jenkins Pipeline Job | Jenkins Docker Plugin

Using Docker with Jenkins offers several advantages within our continuous integration and deployment(CI/CD) pipelines. Well, docker allows for containerization, so our applications and their dependencies can be bundled together in a lightweight, and isolated environment.




Here are a few points on why we should use Dockers with Jenkins Pipeline Jobs:

Easy Environment Setup: Docker provides a consistent and stable environment for doing our build, test, and deployment processes. With Docker, we can package our application and its dependencies into a container, ensuring that it runs consistently across different environments wheater QA or Dev, or Production.

Scalability: Docker will enable easy scaling of our Jenkins infrastructure. We can create and manage multiple Jenkins docker containers as agents to distribute the workloads and handle increased job demands efficiently.

Isolation and Resource Efficiency: Each Jenkins job can be executed in its own Docker container, providing isolation from other jobs in our Jenkins server. This isolation ensures that any changes or dependencies required by a specific job won't impact others. Additionally, Docker allows you to make optimal use of system resources by allocating them precisely to each container.

Faster Build and Test Cycles: Docker's are lightweight in nature and as such will have fast startup time, this contributes to faster build and test cycles. With Docker, you can easily spin up multiple containers, run tests, and tear them down quickly, leading to improved overall development speed and productivity.

Reproducible Builds: Docker enables reproducible builds by encapsulating the application code, dependencies, and environment configuration within a container. This ensures that the build process remains consistent, regardless of the underlying infrastructure.

Simplified Deployment: Docker containers can be easily deployed to various environments, including QA or development, staging, and production. This simplifies the deployment process and helps ensure that the application runs consistently across different environments, regardless of the underlying infrastructure.

In this following video let's see how to use docker with Jenkins Pipeline Jobs. Note that you will need to install docker in the host where you will be running the job.


Thank you! Cheers!


Read More »

How to Install Git on Windows


GIT is a file version control system which is very popular now. It is really fast and simple, fully distributed, highly parallel, and scalable enough to handle the smallest to the largest software projects in the world.

Download the installation package from below link: https://gitforwindows.org/ 

The default options are pretty ok for most users and of-course you can customize it after installing also. 

Follow the video to learn about the installation process.



Thank You and Happy Learning Git!

Take the complete Git course at Udemy using the link here
Read More »

Python Unittest Tutorial Using the Unittest framework

Unit testing or whitebox testing, is a good way to enforce quality checks early on during product development phase. Unit test will test a small component of the application, for e.g. a method, or a smallest testable part of any software. Its different from integration tests where the integrated product is tested.
In this video session let us learn about Unit testing in Python3.

We will be using "unittest" framework, which comes as default Python standard library installation and dont need extra install. 

We will be using python 3.6 version and Pycharm as the IDE for our tutorials. We will be getting started with the following topics:
  • Test pkgs organize
  • Unittest rules:
    •  Import unittest, subclassing unittest.TestCase.
    •  Naming the tests.
    •  Using assert from TestCase class
    •  Run the Testcases using unittest runner
    • Write tests for a "simple calculator" app
  • How to Run test from Pycharm IDE - Reports in Pycharm "run" console
  • Show passed, Show ignored, and Export to html.


Ref Links: https://docs.python.org/3/library/unittest.html

The full Python Unit Testing videos here in Youtube.

Python Testing course in Udemy link here.
Read More »

How To Install Groovy in Eclipse & How to run a Groovy Script

Groovy has been gaining lot of popularity since some time coz of its static and dynamic nature of execution. It is based on Java or JVM, and so its a statically typed language.

Also it is a dynamic language with features similar to those of Python, Ruby.

Eclipse is one of the most popular opensource IDE used for Java/J2EE project development. It can be used for development of other languages as well, like PHP, Python, etc.

In the following video let us see how to install Groovy in Eclipse(v4.7), and how to run groovy scripts and groovy classes in eclipse.


Read More »

How To Run Python 2 and Python 3 in same Windows and Also from git-bash


Most times we want to work on different version of Python in our Windows system. In the following video learn how to run both Python 2.7.x and Python 3.x in the same Windows 10 system.

Also learn how to easily run python from git-bash prompt.


For running python easily in git bash:
Add the following in file .bashrc(create if not available). alias python3='winpty /c/(Python 3.x folder path)/python.exe' alias python='winpty /c/(Python 2.x folder path)/python.exe' The .bashrc file will be in home folder in git bash.
Note: Type cd ~ , to go to your home folder. e.g. $ cd ~

Happy Learning!!


Python Testing course in Udemy link here.
Read More »

Free Public Rest API's for API Testing & Learning API Automation

Here are a Couple of Free sample Rest API URL that anyone can use for Testing, learning API Automation and Prototyping.
No Registration or Authentication is required for these API's. Go Ahead and try out the API's using any API client like SoapUI or Postman.
In the video below, I have used soapUI to explore the API's and how to do different types of API requests.
Happy Learning!!


Read More »

How To Set RestAPI Headers in SoapUI - Manually and Dynamically


Headers are an important part of RestAPI Request and Response. In this video let us learn how to set the headers in 3 different ways.
 - Set Custom Headers manually.
 - Set Headers from custom Properties in Project or Testsuite or Testcase level.
 - Set Headers dynamically from API response using Property Transfer Step.

In the following video, you will see How to Add Headers in SoapUI Opensource, both static and dynamically reading from Response.



The API used is freely available at https://gorest.co.in/, you need to register to get the API token.
Read More »

How To Do Contains Assertion in SoapUI


SoapUI Assertions are used to validate the API response received by a TestStep API during Testcase execution. "Contains Assertion" searches for a string in the API response and based on the availability of the string marks pass/fail for the Testcase. We have options of "Ignore Case" and "Regular Expression" on the search string.
In the following video, you will see about "Contains Assertion" in SoapUI Opensource. Also "Not Contains Assertion" is similar and can be used within a Testcase.


Read More »

Free Sample Rest API Server for Testing and Prototyping

Python-Flask-JWT based Rest API server, can be used to API Automation learning, prototyping.

Recently I was looking to try out an API automation tool for demo, and as I wanted to show test-case validation as well which required connecting to the backend DB, I wasn't able to find a proper public one with all my criteria's.
Finally wrote a small Rest API server and pushed it to github, so anyone can use it and learn. It is very easy to setup and use with little skills in python and virtual env.

You can clone or download it from github:
https://github.com/saratkr/Py-Flask-API-Server

Please refer the readme.md for setting up the server in your windows machine. It has not been tested in Linux server, but can be made working with minimal changes.

Start the server from cmd line in windows:











Login: Once its running in your PC, you can get a JWT token with the login API endpoint:
http://127.0.0.1:5000/api/v1/users/login.
The default username/password is admin/admin.
See screenshot from Postman:



The Login response will give a Authorization token which will be used in the header of all other API requests.
Sample Request: Please see a sample getusers request:




Following API endpoints are supported:
  • Create new User: POST /api/v1/users/create
  • Get all users: GET /api/v1/users/getusers
  • Get one user with ID: GET /api/v1/users/1
  • Delete one user with ID: DELETE /api/v1/users/delete/2
  • Delete one user with email: DELETE /api/v1/users/delete
  • Update one user: UPDATE /api/v1/users/update
So please go ahead prototype your application, or try/learn Rest API Testing or even learn how to write API automation scripts using soapUI or Postman.

Learn complete SoapUI Testing with No Coding at Udemy using the link here.
Read More »