LambdaTest HyperExecute: Smart Test Orchestration for Faster CI
HyperExecute is LambdaTest's test orchestration layer that sits above the browser grid. Instead of pointing your test runner at a remote WebDriver URL, you define a YAML file that tells HyperExecute how to split, distribute, and run your tests across nodes. It handles dependency installation, environment setup, test splitting (AutoSplit), matrix execution, and artifact collection — reducing end-to-end test suite time by 40-70% compared to running on a standard Selenium Grid.
HyperExecute vs. Standard Selenium Grid
Before diving into setup, the key distinction: with a standard Selenium Grid, your tests still run sequentially in your CI job — they just control remote browsers. With HyperExecute, LambdaTest's infrastructure runs your tests distributed across multiple machines in parallel, and your CI job just triggers and monitors the run.
| Aspect | Selenium Grid | HyperExecute |
|---|---|---|
| Test runner location | Your CI machine | LambdaTest nodes |
| Parallelism | Depends on your CI machine | Built-in, distributed |
| Dependency install | Done once in CI | Per-node, fast-cached |
| Test splitting | Manual (pytest-xdist, etc.) | AutoSplit (intelligent) |
| Pre/post hooks | Your CI YAML | hyperexecute.yaml |
| Network setup | Tunnel per session | Tunnel per job |
| Artifact collection | Per session | Centralized |
The practical result: a suite that takes 20 minutes on Selenium Grid with 5 parallel workers often runs in 5-7 minutes on HyperExecute with the same resources, because HyperExecute eliminates setup overhead between batches and uses smarter test distribution.
Installation
Download the HyperExecute CLI:
# Linux/macOS
curl -O https://downloads.lambdatest.com/hyperexecute/darwin/hyperexecute
chmod +x hyperexecute
# Windows
curl -O https://downloads.lambdatest.com/hyperexecute/windows/hyperexecute.exeSet credentials:
export LT_USERNAME="your_username"
export LT_ACCESS_KEY="your_access_key"The hyperexecute.yaml File
All configuration lives in a single YAML file. Minimal example for a Python Selenium project:
# hyperexecute.yaml
version: 0.1
runson: win
autosplit: true
concurrency: 5
pre:
- pip install -r requirements.txt
testDiscovery:
type: raw
mode: dynamic
command: grep -r 'def test_' tests/ --include='*.py' -l
testRunnerCommand: pytest $test
retryOnFailure: true
maxRetries: 1Run it:
./hyperexecute --config hyperexecute.yaml --user $LT_USERNAME --key $LT_ACCESS_KEYKey Configuration Fields
runson
The OS for your test nodes:
runson: win # Windows 11
runson: mac # macOS Ventura
runson: linux # Ubuntuconcurrency
Number of parallel nodes HyperExecute provisions:
concurrency: 10More nodes = faster total run time, up to your plan limit. HyperExecute handles queuing if you exceed the limit.
autosplit
AutoSplit is HyperExecute's intelligent test distribution. When enabled, it analyzes your test discovery command output, splits the tests into batches, and assigns each batch to a node:
autosplit: true
concurrency: 5
testDiscovery:
type: raw
mode: dynamic
command: pytest --collect-only -q tests/ | grep "::"
testRunnerCommand: pytest $test --tb=shortAutoSplit uses historical run data (from previous HyperExecute runs) to estimate test duration and balance batches — avoiding the common problem where one node finishes in 2 minutes while another runs for 20.
pre and post
Commands that run before/after tests on each node:
pre:
- pip install -r requirements.txt
- python setup_db.py
post:
- python cleanup.py
- cp -r logs/ $LT_ARTIFACT_DIR$LT_ARTIFACT_DIR is a special directory — files copied there are collected and available in the dashboard.
env
Environment variables available on all nodes:
env:
APP_URL: https://staging.example.com
DB_HOST: db.internal.example.com
API_TIMEOUT: "30"For secrets, reference them from your LambdaTest vault (configured in the dashboard) using ${{ .secrets.MY_SECRET }}.
Matrix Execution
Matrix execution runs the same tests across different configurations (browsers, environments, locales):
version: 0.1
runson: win
matrix:
browser: ["chrome", "firefox", "edge"]
env: ["staging", "production"]
concurrency: 6
pre:
- npm ci
testRunnerCommand: npx playwright test --project=$browser --grep=@smoke
env:
APP_ENV: $env
BROWSER: $browserThis configuration generates 6 combinations (3 browsers × 2 environments) and runs them in parallel. Each matrix cell gets its own node.
Full JavaScript Example (Playwright)
# hyperexecute.yaml
version: 0.1
runson: win
autosplit: true
concurrency: 8
pre:
- node --version
- npm ci
- npx playwright install chromium
testDiscovery:
type: raw
mode: dynamic
command: find tests -name '*.spec.ts' -type f
testRunnerCommand: npx playwright test $test --reporter=line
retryOnFailure: true
maxRetries: 2
env:
BASE_URL: https://app.example.com
artifacts:
upload:
- path:
- playwright-report/**
name: playwright-report
type: reportJava TestNG Example
version: 0.1
runson: win
autosplit: true
concurrency: 5
pre:
- mvn -Dmaven.test.skip=true clean install
testDiscovery:
type: raw
mode: static
command: |
grep -r "@Test" src/test/java/ --include="*.java" -l | \
sed 's|src/test/java/||;s|/|.|g;s|.java||'
testRunnerCommand: mvn test -Dtest=$test -pl .
env:
SELENIUM_GRID: lambdatest
BROWSER: chromeComparing AutoSplit Modes
HyperExecute has two test discovery modes:
| Mode | What It Does | When to Use |
|---|---|---|
static |
Discovers all tests upfront, splits before any node starts | Predictable test suites, fast discovery |
dynamic |
Nodes pull tests on demand as they complete batches | Long tests with variable duration, reduces idle time |
Dynamic mode is better for suites with high variance in test duration. If one node finishes its batch early, it picks up more work rather than sitting idle.
Pre-Steps for Database/Service Setup
HyperExecute supports background services in pre-steps:
pre:
- pip install -r requirements.txt
- docker-compose up -d db redis &
- sleep 5 # wait for services (or use a healthcheck command)
- python manage.py migrateFor services that need to be available before tests but shouldn't block, use & to background them and then poll:
pre:
- pip install -r requirements.txt
- ./start-services.sh &
- python -c "import time,urllib.request; [time.sleep(1) or urllib.request.urlopen('http://localhost:5432') for _ in range(30)]"CI Integration
HyperExecute runs are typically triggered from CI, not as a replacement for CI:
# .github/workflows/hyperexecute.yml
name: HyperExecute Tests
on:
push:
branches: [main]
jobs:
hyperexecute:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download HyperExecute CLI
run: |
curl -O https://downloads.lambdatest.com/hyperexecute/linux/hyperexecute
chmod +x hyperexecute
- name: Run tests on HyperExecute
env:
LT_USERNAME: ${{ secrets.LT_USERNAME }}
LT_ACCESS_KEY: ${{ secrets.LT_ACCESS_KEY }}
run: |
./hyperexecute \
--config hyperexecute.yaml \
--user $LT_USERNAME \
--key $LT_ACCESS_KEY \
--download-artifacts--download-artifacts pulls the collected artifacts (reports, logs) back to your CI workspace after the run completes.
When HyperExecute Is Worth It
HyperExecute adds complexity vs. a simple Selenium Grid connection. It's worth it when:
- Your test suite takes more than 10 minutes to run
- You have more than 50 test files
- You need consistent setup across nodes (pre-steps handle this uniformly)
- You're doing matrix testing across multiple browser/env combinations
- Your tests have variable duration and idle time is a problem
For small suites (under 20 tests), the overhead of YAML configuration and node provisioning outweighs the parallelism benefit. Use the standard Selenium Grid or Playwright endpoint instead.