CAPABILITY GENERATOR

LambdaTestTesting Locally Hosted Pages ● Maven Tunnel For Locally Hosted Web Applications

Maven Tunnel For Locally Hosted Web Applications


Maven is a renowned build automation tool for orchestrating project builds by automatically handling Selenium dependencies, compiling source code to binary & then packaging of the binary. LambdaTest offers an SSH(Secure Shell) tunnel which allows you to test your locally hosted websites over 2000+ browsers for both mobile and desktop through LambdaTest Selenium Grid.

This document will help you configure a secure Lambda Tunnel to execute your Selenium test automation scripts through your Maven project on our online Selenium Grid.

Prerequisites


  • LambdaTest Authentication Credentials
  • Be aware of 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:
      $ export LT_USERNAME= {your lambdatest username}
      $ export LT_ACCESS_KEY= {your lambdatest access_key}
    • For Windows:
      $ set LT_USERNAME= {your lambdatest username}
      $ set LT_ACCESS_KEY= {your lambdatest access_key}
  • Make sure you have Maven installed.
  • Install Java 8.

Set Up Maven Sample Project & Dependencies


Note: Make sure you clone our GitHub repository for Maven tunnel.

Navigate to the cloned directory & compile maven dependencies using the command:

Ensure that you have the Maven Tunnel dependency configured in your pom.xml.

Running Maven Tunnel


Here is the code that is present in the cloned GitHub repository for Maven Tunnel.

Parallel Testing With Maven Tunnel


In order to trigger parallel test execution you will need to specify the parameters inside an XML file, in our GitHub repository you will find the XML file named as MavenParallel.xml file.

Here is the final code to execute parallel testing with Maven tunnel.

Optional Arguments For Lambda Tunnel

Argument
Syntax
Description

tunnelName

To change the name of the Lambda Tunnel.

pidFile

To change the PID path.

dir

To change the directory path.

logFile

To change the path for Tunnel logs.

For more arguments, refer to our document of Lambda Tunnel Modifiers.