This LambdaTest setup guide walks you through everything you need to run your first test—from account creation to Appium mobile testing and Selenium browser automation.

Note: LambdaTest has rebranded to TestMu AI. The information in this article still applies to the platform under its new name.

LambdaTest setup involves several steps: getting credentials, configuring capabilities, uploading apps (for mobile), and setting up LambdaTest Tunnel for internal applications. This tutorial covers each step with working code examples.


Prerequisites

Before starting:

  • A LambdaTest account (free tier available)
  • Your test framework installed locally (Selenium, Appium client)
  • For mobile: Your app binary (.apk for Android, .ipa for iOS)
  • For internal apps: LambdaTest Tunnel downloaded

Step 1: Get Your Credentials

  1. Log in to lambdatest.com
  2. Go to SettingsAccount Settings
  3. Find your Username and Access Key

Store these securely—never commit them to version control:

bash
# Set environment variables
export LT_USERNAME="your-username"
export LT_ACCESS_KEY="your-access-key"

Step 2: Choose Your Data Center

LambdaTest has multiple data centers. Choose the closest to your team:

Region Hub URL Best For
US hub.lambdatest.com Americas
EU hub.eu.lambdatest.com Europe
AP hub.ap.lambdatest.com Asia-Pacific

Important: Use the same region for your tunnel and tests.


LambdaTest Selenium Setup

Basic Selenium Configuration

python
from selenium import webdriver
import os

# Capabilities using LT:Options format
capabilities = {
    "browserName": "Chrome",
    "browserVersion": "latest",
    "platformName": "Windows 11",
    "LT:Options": {
        "username": os.environ["LT_USERNAME"],
        "accessKey": os.environ["LT_ACCESS_KEY"],
        "project": "My Project",
        "build": "Build 1.0",
        "name": "My First Test",
        "resolution": "1920x1080",
        "network": True,
        "console": True,
        "video": True
    }
}

# Connect to LambdaTest
driver = webdriver.Remote(
    command_executor="https://hub.lambdatest.com/wd/hub",
    desired_capabilities=capabilities
)

# Run your test
driver.get("https://example.com")
assert "Example" in driver.title

# Always quit to end the session
driver.quit()

Available Browsers

Browser Versions Platforms
Chrome 66+ Windows, macOS, Linux
Firefox 60+ Windows, macOS, Linux
Safari 11+ macOS only
Edge 80+ Windows, macOS
Opera 58+ Windows, macOS

Check the Capabilities Generator for valid combinations.

Setting Screen Resolution

python
"LT:Options": {
    "resolution": "1920x1080"
}

Available resolutions: 1024x768, 1280x800, 1280x1024, 1366x768, 1440x900, 1680x1050, 1920x1080, 2560x1440


LambdaTest Appium Setup

Mobile testing requires additional steps: uploading your app and configuring device capabilities. This section covers LambdaTest Appium setup for both Android and iOS.

LambdaTest App Upload

Apps must be uploaded to LambdaTest storage before testing. Here’s how to upload your app using cURL:

bash
# Android
curl -u "$LT_USERNAME:$LT_ACCESS_KEY" \
  --location --request POST \
  "https://manual-api.lambdatest.com/app/upload/realDevice" \
  --form "appFile=@/path/to/app.apk" \
  --form "name=my-app"

# iOS
curl -u "$LT_USERNAME:$LT_ACCESS_KEY" \
  --location --request POST \
  "https://manual-api.lambdatest.com/app/upload/realDevice" \
  --form "appFile=@/path/to/app.ipa" \
  --form "name=my-app"

Response:

json
{
  "app_id": "APP123456789",
  "app_url": "lt://APP123456789",
  "name": "my-app.apk",
  "status": "success"
}

App URL formats:

  • By ID: lt://APP123456789
  • By name: lt://proverbial-android (uses most recent upload with that name)

Important: Apps are stored for 60 days. Re-upload if expired.

LambdaTest Android Configuration

python
from appium import webdriver
import os

capabilities = {
    "platformName": "Android",
    "deviceName": "Galaxy S23",
    "platformVersion": "13",
    "app": "lt://APP123456789",  # Your uploaded app
    "isRealMobile": True,
    "LT:Options": {
        "username": os.environ["LT_USERNAME"],
        "accessKey": os.environ["LT_ACCESS_KEY"],
        "project": "Android Project",
        "build": "Build 1.0",
        "name": "Android Test",
        "w3c": True,
        "devicelog": True,
        "video": True,
        "network": True
    }
}

driver = webdriver.Remote(
    command_executor="https://mobile-hub.lambdatest.com/wd/hub",
    desired_capabilities=capabilities
)

LambdaTest iOS Configuration

python
capabilities = {
    "platformName": "iOS",
    "deviceName": "iPhone 14 Pro",
    "platformVersion": "16",
    "app": "lt://APP987654321",  # Your uploaded app
    "isRealMobile": True,
    "LT:Options": {
        "username": os.environ["LT_USERNAME"],
        "accessKey": os.environ["LT_ACCESS_KEY"],
        "project": "iOS Project",
        "build": "Build 1.0",
        "name": "iOS Test",
        "w3c": True,
        "devicelog": True,
        "video": True,
        "network": True
    }
}

driver = webdriver.Remote(
    command_executor="https://mobile-hub.lambdatest.com/wd/hub",
    desired_capabilities=capabilities
)

Finding Device Names

Valid device names change as LambdaTest updates their pool. Use:

  1. Capabilities Generator: lambdatest.com/capabilities-generator/

  2. API:

bash
curl -u "$LT_USERNAME:$LT_ACCESS_KEY" \
  "https://mobile-api.lambdatest.com/mobile-automation/api/v1/list"

LambdaTest Tunnel Setup

If your application isn’t publicly accessible (localhost, staging, behind firewall), you need LambdaTest Tunnel.

Download LambdaTest Tunnel

bash
# macOS
brew install lambdatest/tap/lambdatest-tunnel

# Linux
wget https://downloads.lambdatest.com/tunnel/v3/linux/64bit/LT_Linux.zip
unzip LT_Linux.zip

# Windows
# Download from https://www.lambdatest.com/support/docs/testing-locally-hosted-pages/

Start the Tunnel

bash
# Basic usage
./LT --user $LT_USERNAME --key $LT_ACCESS_KEY --tunnelName my-tunnel

# With specific configuration
./LT --user $LT_USERNAME --key $LT_ACCESS_KEY \
  --tunnelName my-tunnel \
  --infoAPIPort 8000 \
  --logFile tunnel.log

Wait for: Tunnel successfully connected

Reference the Tunnel in Tests

python
"LT:Options": {
    "tunnel": True,
    "tunnelName": "my-tunnel"
}

Testing Localhost Applications

When testing localhost, use localhost.lambdatest.com instead of localhost:

python
# Instead of
driver.get("http://localhost:3000")

# Use
driver.get("http://localhost.lambdatest.com:3000")

Tunnel Best Practices

1. Use named tunnels for multiple projects:

bash
./LT --user $LT_USERNAME --key $LT_ACCESS_KEY --tunnelName project-a
./LT --user $LT_USERNAME --key $LT_ACCESS_KEY --tunnelName project-b

2. Route only necessary traffic:

bash
./LT --user $LT_USERNAME --key $LT_ACCESS_KEY \
  --tunnelName my-tunnel \
  --allowHosts "*.staging.example.com,localhost"

3. Run as a background service:

bash
./LT --user $LT_USERNAME --key $LT_ACCESS_KEY \
  --tunnelName my-tunnel \
  --mode daemon

Configuration Reference

LT:Options Capabilities

Capability Description Default
project Project name (appears in dashboard)
build Build identifier
name Test name
video Record video true
console Capture console logs false
network Capture network logs false
visual Enable visual testing false
tunnel Use LambdaTest Tunnel false
tunnelName Specific tunnel to use
idleTimeout Seconds between commands before timeout 120
commandTimeout Seconds for single command 600
resolution Screen resolution (web)
devicelog Capture device logs (mobile) false

Timeout Configuration

python
"LT:Options": {
    "idleTimeout": 300,      # 5 minutes between commands
    "commandTimeout": 900    # 15 minutes per command
}

Default timeouts:

  • Idle: 120 seconds
  • Command: 600 seconds (10 minutes)

For more on performance issues and queue limits, see LambdaTest Slow? HyperExecute Limits.


LambdaTest Common Errors and Fixes

Error: “localhost refused to connect”

Cause: LambdaTest can’t access your local application.

Fix:

  1. Ensure LambdaTest Tunnel is running:
bash
./LT --user $LT_USERNAME --key $LT_ACCESS_KEY --tunnelName my-tunnel
  1. Use localhost.lambdatest.com in your tests:
python
driver.get("http://localhost.lambdatest.com:3000")
  1. For Angular/React apps with webpack-dev-server:
bash
ng serve --disable-host-check
# or
webpack serve --disable-host-check

Error: “Session Limit reached”

Cause: Your organization has hit the concurrent session limit.

Fix:

  1. Check active sessions in Dashboard → Realtime → Sessions
  2. Close unused sessions
  3. Upgrade plan for more parallel sessions
  4. Queue tests instead of running all simultaneously

Note: Session limits are organization-wide, not per-user.

Error: Timeout Errors

Cause: Test exceeded idle or command timeout.

Fix:

  1. Increase timeouts:
python
"LT:Options": {
    "idleTimeout": 300,
    "commandTimeout": 900
}
  1. Check for network latency (especially with VPN)

  2. Ensure driver.quit() is called:

python
try:
    # Your test
    pass
finally:
    driver.quit()

Error: “App not found”

Cause: The app URL is invalid or expired.

Fix:

  1. Re-upload the app:
bash
curl -u "$LT_USERNAME:$LT_ACCESS_KEY" \
  --location --request POST \
  "https://manual-api.lambdatest.com/app/upload/realDevice" \
  --form "appFile=@/path/to/app.apk"
  1. Use the new app_url from the response

  2. Apps expire after 60 days—set up CI/CD to re-upload regularly

Error: “Invalid Host Header”

Cause: Webpack dev server rejecting the request.

Fix:

Add to your webpack config:

javascript
devServer: {
    allowedHosts: 'all',
    // or
    disableHostCheck: true
}

Or run with flag:

bash
ng serve --disable-host-check

Error: Device Not Available

Cause: Requested device is busy or doesn’t exist.

Fix:

  1. Check device availability in Device List

  2. Use broader device selection:

python
# Instead of specific model
"deviceName": "Galaxy S23"

# Use regex pattern
"deviceName": "Galaxy.*"
  1. Add queue capability:
python
"LT:Options": {
    "queueTimeout": 300  # Wait up to 5 minutes for device
}

LambdaTest CI/CD Integration

LambdaTest GitHub Actions

yaml
name: LambdaTest Tests

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Setup Node
        uses: actions/setup-node@v3
        with:
          node-version: '18'

      - name: Install dependencies
        run: npm install

      - name: Start LambdaTest Tunnel
        run: |
          wget https://downloads.lambdatest.com/tunnel/v3/linux/64bit/LT_Linux.zip
          unzip LT_Linux.zip
          ./LT --user ${{ secrets.LT_USERNAME }} --key ${{ secrets.LT_ACCESS_KEY }} --tunnelName github-${{ github.run_id }} &
          sleep 10

      - name: Run Tests
        env:
          LT_USERNAME: ${{ secrets.LT_USERNAME }}
          LT_ACCESS_KEY: ${{ secrets.LT_ACCESS_KEY }}
          LT_TUNNEL_NAME: github-${{ github.run_id }}
        run: npm test

LambdaTest Jenkins Integration

groovy
pipeline {
    agent any

    environment {
        LT_USERNAME = credentials('lt-username')
        LT_ACCESS_KEY = credentials('lt-access-key')
    }

    stages {
        stage('Setup Tunnel') {
            steps {
                sh '''
                    wget https://downloads.lambdatest.com/tunnel/v3/linux/64bit/LT_Linux.zip
                    unzip LT_Linux.zip
                    ./LT --user $LT_USERNAME --key $LT_ACCESS_KEY --tunnelName jenkins-${BUILD_ID} &
                    sleep 10
                '''
            }
        }

        stage('Run Tests') {
            steps {
                sh 'npm test'
            }
        }
    }

    post {
        always {
            sh 'pkill LT || true'
        }
    }
}

LambdaTest Best Practices

1. Always Use Named Tunnels

bash
# Good
./LT --tunnelName project-a-staging

# Avoid
./LT  # Uses default, causes conflicts

2. Set Meaningful Build/Project Names

python
"LT:Options": {
    "project": "MyApp - Android",
    "build": f"v1.2.3-{os.environ.get('CI_COMMIT_SHA', 'local')[:8]}",
    "name": f"Login Flow - {device_name}"
}

3. Always Quit Driver Sessions

python
try:
    # Test code
    driver.find_element(By.ID, "login").click()
except Exception as e:
    print(f"Test failed: {e}")
finally:
    driver.quit()  # Always clean up

4. Upload Apps in CI/CD

bash
# Upload and capture app_url
APP_RESPONSE=$(curl -u "$LT_USERNAME:$LT_ACCESS_KEY" \
  --location --request POST \
  "https://manual-api.lambdatest.com/app/upload/realDevice" \
  --form "[email protected]")

APP_URL=$(echo $APP_RESPONSE | jq -r '.app_url')
export LT_APP_URL=$APP_URL

5. Handle Flaky Tests

python
import tenacity

@tenacity.retry(stop=tenacity.stop_after_attempt(3),
                wait=tenacity.wait_fixed(2))
def test_with_retry():
    driver = create_driver()
    try:
        # Your test
        pass
    finally:
        driver.quit()

LambdaTest Debugging Tips

Enable All Logs

python
"LT:Options": {
    "console": True,
    "network": True,
    "devicelog": True,
    "video": True
}

Access Session Logs

After test completion, get detailed logs:

bash
curl -u "$LT_USERNAME:$LT_ACCESS_KEY" \
  "https://api.lambdatest.com/automation/api/v1/sessions/{session_id}"

Screenshot on Failure

python
try:
    # Test code
    pass
except Exception as e:
    driver.save_screenshot(f"failure-{test_name}.png")
    raise
finally:
    driver.quit()

Comparing platforms? See LambdaTest vs BrowserStack 2025 for a detailed comparison.


LambdaTest Troubleshooting Checklist

When LambdaTest tests fail, check these items:

  1. Credentials correct? Check environment variables
  2. Tunnel running? Check ./LT process
  3. Using correct hub URL? Match region to tunnel
  4. App uploaded? Check expiration (60 days)
  5. Device available? Check device list
  6. Session limit? Check dashboard for active sessions
  7. Timeouts set? Increase if tests are slow
  8. driver.quit() called? Prevents session leaks

Next Steps


Need simpler setup? DeviceLab connects your own devices with one command—no complex configuration, no session limits. First device free.