CAPABILITY GENERATOR

LambdaTestAutomation Testing ● Running Geb Automation Tests On LambdaTest Selenium Grid

Running Geb Automation Tests On LambdaTest Selenium Grid


Based on Groovy, Geb is a web testing automation framework. It is build as a wrapper over Selenium WebDriver which makes it ideal for automated browser testing. Geb automation testing framework can help you automate cross browser testing over every browser that is supported by Selenium WebDriver. Geb automation testing framework offers excellent features for web testing, screen scraping, and more. What makes Geb unique is the way it queries your HTML pages, it does so by offering the jQuery-like syntax. Also, it provides built-in support for the Page Object pattern.

LambdaTest integration with Geb will help you execute your Geb test automation scripts on our online Selenium Grid of 2000+ real browsers to ensure your web application renders well on as many browsers as you are targeting to test. This topic will talk about the:

  • Prerequisites for running Geb test automation script on LambdaTest.
  • Executing first Geb automation script on LambdaTest.
  • Executing parallel testing using Geb automation framework on LambdaTest.
  • Executing automated browser testing on locally hosted web application using Geb test automation framework.

Prerequisites To Run Geb automation Scripts On Our Selenium Grid


  • Install Maven.
  • Make sure you have Java installed in your system. We recommend installing Java 8 or above version for more stable execution.
  • LambdaTest Authentication Credentials
  • You will need your LambdaTest authentication credentials i.e. your LambdaTest username, access key and HubURL. You need to set them up as your environment variables. You can retrieve them from your LambdaTest automation dashboard by clicking on the key icon near the help button.

    • For Linux/Mac:
    • For Windows:
  • Clone LambdaTest GitHub repository for Geb framework.

Executing Your First Geb Test Automation Script On LambdaTest


Step 1: Navigate to the LambdaTest Geb cloned directory.

Step 2: Compile Maven dependencies. Using the below command.

Note: You may also want to run the command below to check for outdated dependencies. Please be sure to verify and review updates before editing your pom.xml file. The updated packages may or may not be compatible with your code.

Step 3: Edit the capabilities.json file with the Desired Capabilities of your preference as shown below.

Note: If you wish to change the desired capabilities for your Selenium automation testing scripts then you can leverage our Desired Capabilitites Generator. The Capability Generator will help you with the syntactically correct Desired Capabilities class based upon your selections from the drop-down menus.

Step 4:Use the command below from the root of the project to run your tests.

Executing Parallel Testing With Geb Automation Framework


You need to clone the LambdaTest Geb repository. To run your Geb test automation scripts in parallel over different browser testing configuration, you would need to add extra capabilities in your capabilities.json file. For example:

After specifying the extra capabilities, you need to run the same command as you did for running your first script from the root of your project.

It will run the tests in your project with each of the configurations listed concurrently by configuration. i.e. all configurations will run at the same time. Individual test outputs will be routed to a log file named after the configuration in the project root folder.

Note: It may be useful to use a Java IDE such as IntelliJ or Eclipse to help troubleshoot potential issues.

Testing With Geb Test Automation Framework On Locally Hosted Web Applications


LambdaTest offers a SSH(Secure Shell) tunnel to help you test your locally hosted web application on cloud servers hosted by us. We call it the Lambda Tunnel. Using Lambda Tunnel, you can establish a unique, private and reliable connections on our cloud machines and run your automation testing scripts.

To run your test cases on Lambda Tunnel, you would need to set the tunnel flag to true in our desired capabilities generator or you could simply add the below in your capabilities.json file.

Kudos! That is all you need to know to learn Geb automation testing scripts on LambdaTest online Selenium Grid. In case you have an questions feel to let us know. You can drop a message to our 24/7 customer chat support, or you could mail them to us over support@lambdatest.com. Happy testing! 🙂