https://github.com/hjsblogger/parallel-testing-with-robot-framework
The repo contains demo on performing parallel testing with Selenium Robot (on Local Grid as well as on LambdaTest Grid)
https://github.com/hjsblogger/parallel-testing-with-robot-framework
automation-testing cloud-automation pabot selenium-python selenium-webdriver
Last synced: 3 months ago
JSON representation
The repo contains demo on performing parallel testing with Selenium Robot (on Local Grid as well as on LambdaTest Grid)
- Host: GitHub
- URL: https://github.com/hjsblogger/parallel-testing-with-robot-framework
- Owner: hjsblogger
- Created: 2022-08-24T11:10:28.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-13T09:18:13.000Z (10 months ago)
- Last Synced: 2025-02-10T05:23:28.850Z (5 months ago)
- Topics: automation-testing, cloud-automation, pabot, selenium-python, selenium-webdriver
- Language: RobotFramework
- Homepage:
- Size: 705 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Perform the following steps for running the Robot tests in parallel on the Selenium Grid:
## Installation of Python packages
Packages that need to be installed are present in *pyproject.toml* Execution is performed on the LambdaTest Selenium Grid. We are using Selenium 4.9.0 for the execution.
Install the Python packages by running the *poetry install* command on the terminal
```bash
poetry install
```It installs the libraries that are required for testing. Shown below is the execution snapshot:
![]()
![]()
![]()
![]()
Install the project dependencies by running ```poetry install``` or ```poetry install --no-root``` on the terminal
The global dependencies (i.e. Robot Framework 6.0 and Selenium 4.9.0) are installed by running ```pip install -r requirements.txt``` or ```pip3 install -r requirements.txt```on the terminal
## Configure Environment Variables
Before the tests are run, please set the environment variables LT_USERNAME & LT_ACCESS_KEY from the terminal. The account details are available on your [LambdaTest Profile](https://accounts.lambdatest.com/detail/profile) page.
For macOS:
```bash
export LT_USERNAME=LT_USERNAME
export LT_ACCESS_KEY=LT_ACCESS_KEY
```For Linux:
```bash
export LT_USERNAME=LT_USERNAME
export LT_ACCESS_KEY=LT_ACCESS_KEY
```For Windows:
```bash
set LT_USERNAME=LT_USERNAME
set LT_ACCESS_KEY=LT_ACCESS_KEY
```## Splitting test execution at the suite level
As stated in the [official documentation of Robot framework](https://docs.robotframework.org/docs/parallel#usage), Pabot splits execution on suite level (by default). That means that each process will run a single suite. Test Cases from the suite will be executed sequentially.
Run the following command ```pabot --verbose --processes 4 Tests/CloudGrid/``` on the terminal to run tests in parallel at the suite-level. This command will run the tests in the respective .robot files in parallel, whereas individual tests in each robot file will run in a sequential manner.
Shown below is the terminal screenshot of successful execution:
As seen on the [LambdaTest Automation Dashboard](https://automation.lambdatest.com/build), three tests - 2 from *Tests/test_todo_app.robot* and 1 from *Tests/test_sel_playground.robot* are run in parallel
Here is the successful execution status as seen in the [LambdaTest Automation Dashboard](https://automation.lambdatest.com/build)
## Splitting test execution on the test level
Run the following command ```pabot --verbose --processes 4 --testlevelsplit Tests/CloudGrid/``` on the terminal to run tests in parallel at the test-level. This command will run the tests in the respective .robot files in parallel.
Shown below is the terminal screenshot of successful execution:
As seen on the [LambdaTest Automation Dashboard](https://automation.lambdatest.com/build), three tests - 2 from *Tests/test_todo_app.robot* and 1 from *Tests/test_sel_playground.robot* are run in parallel
Here is the successful execution status as seen in the [LambdaTest Automation Dashboard](https://automation.lambdatest.com/build)
## Need Assistance?
Feel free to fork the repo and contribute to make it better! Email to [himanshu[dot]sheth[at]gmail[dot]com](mailto:[email protected]) for any queries or ping me on the following social media sites:Twitter: [@hjsblogger](https://www.twitter.com/hjsblogger)
LinkedIn: [@hjsblogger](https://linkedin.com/in/hjsblogger)