/getting-started-with-robot-framework

This repo helps you get started with Robot framework in Python

Primary LanguageRobotFramework

Getting Started With Robot Framework In Python

RobotFramework_Logo

Image Credit

Perform the following steps for running Robot tests on local machine or LambdaTest Cloud 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 latest Selenium version for the execution. Install the project dependencies by running poetry install or poetry install --no-root on the terminal

1

The global dependencies (i.e. Robot Framework and latest Selenium) are installed by running pip install -r requirements.txt or pip3 install -r requirements.txton the terminal

2

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 page.

For macOS:

export LT_USERNAME=LT_USERNAME
export LT_ACCESS_KEY=LT_ACCESS_KEY

For Linux:

export LT_USERNAME=LT_USERNAME
export LT_ACCESS_KEY=LT_ACCESS_KEY

For Windows:

set LT_USERNAME=LT_USERNAME
set LT_ACCESS_KEY=LT_ACCESS_KEY

Since the same tests can be executed with Robot on local machine and Robot on LambdaTest cloud grid, the environment variable EXEC_PLATFORM also needs to be set before execution.

For execution with Robot on local machine:

export EXEC_PLATFORM=local

For execution with Robot on LambdaTest cloud grid:

export EXEC_PLATFORM=cloud

Execution of Robot Tests

The Robot tests are located in the Common folder. Hence, there is a flexibility to run all the four tests with Robot on local as well cloud. Once the environment variables are set, run the command robot Tests/Common/<file-name.robot> on the terminal to trigger the test execution.

Shown below is the execution snapshot of Robot tests running on local machine:

robot-local-execution

Shown below is the execution snapshot of Robot tests running on LambdaTest cloud grid:

As seen on the LambdaTest Automation Dashboard, the test execution is successful:

robot-cloud-execution-1

Here is the successful execution status as seen in the LambdaTest Automation Dashboard

robot-cloud-execution-2

Need Assistance?

Feel free to fork the repo and contribute to make it better! Email to himanshu[dot]sheth[at]gmail[dot]com for any queries or ping me on the following social media sites:

Twitter: @hjsblogger
LinkedIn: @hjsblogger