Parallel Test Automation using Robot Framework
![](https://2025.vervesquare.com/dir/wp-content/uploads/2024/09/Untitled-design-31.png)
The Robot Framework performs test execution sequentially, handling tests within a single test suite or across multiple test suites. Conversely, Pabot, a tool designed for the Robot Framework, enables parallel test execution. It achieves parallelization at both the individual test and entire test suite levels. By default, Pabot conducts parallelization at the test suite level, employing separate processes to handle each test suite independently.
Within a test suite, tests are executed in sequence, while multiple test suites (such as test1.robot, test2.robot, etc.) run concurrently.
Insights into how to implement parallel test automation effectively using Robot framework,
- Parallel Execution with Pabot at Suite level
- Parallel Execution with Pabot at Test Level
- Customize the processes
Pre-requisite:
- Python
- PIP
- Robot Framework
- Robot Framework selenium library.
- PyCharm IDE
Framework structure and Interpreter settings:
Create new project in PyCharm IDE with following structure,
Set Project Interpreter:
In PyCharm system interpreter or virtual environment for project interpreter can be used
Install libraries from terminal:
- robotframework
- robotframework-selenium2library
- robotframework-datadriver
Install Plugins in PyCharm:
- Robot Framework Language Server
- IntelliBot @SeleniumLibrary Patched
Note – Pabot, like other Python packages, provides the option for installation either globally or within a virtual environment. Its current version is 2.16.0.
For those already equipped with Python version 3.6 or higher and have pip installed, Pabot can be installed by executing the following command in the terminal
pip install robotframework-pabot
Resource file:
A resource file typically comprises reusable components such as customized wrapper keywords invoked within test case modules, necessary variables for dependent test cases, essential libraries facilitating test execution and interaction, and frequently used settings across various tests and test suites.
As we have tired data driven test automation using Robot framework in our last article Data Driven Test Automation using Robot Framework
Let’s use the same robot files to perform parallel test automation.
Pabot, by default, divides the test execution at the suite level, with each process handling a single suite. User have the flexibility to adjust the number of parallel processes using the ‘–processes‘ option.
1. Parallel Execution with Pabot at Suite level
Below command is used to perform parallel test execution of all test cases within the testcases directory at the suite level.
Command : Pabot [path to Test]
Here we have three robot files to be executed parallelly at suite level. The command initiates three processes, each handling its suite.
Process Id’s are generated automatically for 3 different test suites as below;
2. Parallel Execution with Pabot at Test Level
Below command is used to perform parallel test execution of all test cases within the testcases directory at the test level.
Command : pabot --testlevelsplit [path to test]
Here we are trying to execute test cases from one test suite parallel. Below command initiates simultaneous execution of all processes, each with its own unique process ID.
There are 4 test cases in test execution1 script. Pabot automatically identify 4 test cases inside test execution1 script and execute them simultaneously with their process ID’s shown below.
3. Customize the number of processes
As mentioned earlier, parallel execution can be achieved using the ‘–processes’ option, where the user specifies the desired number of processes for simultaneous execution.
For instance, below command restricts the execution to 2 processes.
command : pabot --processes 2 [test to path]
The execution below demonstrates the Robot Framework running 2 processes concurrently, each identified by its process ID
- In this example we have executed commands at suite level and restricted the number of processes with two.
- Here we have 3 test script(test execution 1, test execution 2 and test execution3) with process limitation of two in this case pabot will execute two processes simultaneously with their process ID’s generated in runtime and further processes will initiate after completion of any one process.
- After execution of command pabot simultaneously run two processes with their process ID as shown below,
4. After completion of [PID:6976] pabot initiated next process as below,
- Test execution log report of TestExecution1.robot file
- Test execution log report of TestExecution2.robot file
- Test execution log report of TestExecution3.robot file
By referring the log reports, we can say test execution of suites TestExecution1 and TestExecution2 started at the same time
Test Automation Streamlining REST API Processes with Postman Automation Summary:In today's world, industries are increasingly focusing on the development of...
Uncategorized Enhancing Test Efficiency with Playwright, TestNG and Allure Summary:Playwright is an open-source library developed by Microsoft for automated browser...
Test Automation Continuous Integration and Delivery with Jenkins and GitHub Summary: Testing and deployment-related operations can be automated with Jenkins,...
Mobile App Test Automation with TDD Telecommunications (Cable) Location Performance Testing CONTEXT Elyments is an India-based mobile application similar to...