LambdaTestAutomation Testing ● Behave with Selenium: Run Behave Automation Testing Scripts on Selenium Grid

Behave with Selenium: Run Behave Automation Testing Scripts on Selenium Grid

LambdaTest Selenium Automation Grid is a cloud based scalable Selenium testing platform which enables you to run your automation scripts on 2000+ different browsers and operating systems. You can now run your Python Selenium automated test cases on a scalable Selenium infrastructure that is running real browsers and real operating systems. This post will help you in getting started with configuring and running your Python based automation test scripts on LambdaTest Selenium cloud platform. In this post we would be exploring:

  1. How to run a sample using Behave with Selenium using LambdaTest Automation
  2. How to set up an environment for testing locally hosted websites or web pages.
  3. How to configure Behave desired capabilities to perform Behave automation testing
  4. How to run your test cases in parallel to reduce build times
  5. Advanced features of LambdaTest.

Prerequisites For Running Behave With Selenium

  • Have Selenium WebDriver client driver installed inside your local Python environment.
  • Make sure that you have the latest Python build installed. You can download the latest Python build from
  • You would need Python package manager, pip, as well. Usually latest python installers come prepacked with pip. However if you don’t have pip You can install it using command:

  • Download the driver from the link, or you can use pip to install it

  • Make sure you have installed Behave automation testing framework in your system. In case you don’t! Enter the below command:

  • If you wish to test locally hosted or privately hosted projects, you would also need Lambda Tunnel binary file.

Follow our documentation on Lambda Tunnel to know it all. OS specific instructions to download and setup tunnel binary can be found at the following links.

Getting Started With Behave automation framework and LambdaTest

The first step in using LambdaTest platform is to understand LambdaTest’s Selenium Grid capabilities. Our Selenium Grid uses remote webdriver instead of normal Selenium client browser drivers so if you are migrating from locally run Selenium, you would have to invoke LambdaTest Selenium remote webdriver. Next you need to specify in your code, which browser, browser versions, operating systems, and resolution you wish to run your test on, along with defining LambdaTest specific capabilities. You can checkout LambdaTest Capabilities Generator tool to understand more about how you can define running browser environments and leverage advanced LambdaTest capabilities.

Let’ start with a simple Selenium Remote Webdriver test first. The Python script below tests a simple to-do application with basic functionalities like mark items as done, add items in list, calculate total pending items etc. You can also find this at our GitHub repository

Now, we have to create step definition file.

Here is config.cfg file.

Now Perform Tests using Behave with Selenium

You would need to execute the below command in your terminal/cmd.