ENTERPRISE
Visual Studio Code
The Karate Labs VS Code extension provides a complete development environment for Karate tests — syntax highlighting, run-from-editor, debugging (including embedded JavaScript), and real-time match-syntax diagnostics. Built natively for VS Code's test runner.
Quick Links
- 📺 Video Tutorial — Complete walkthrough of extension features
- 💲 Pricing — License tiers and pricing
- ⚡ Marketplace — Install from the VS Code Marketplace
- 💡 Open VSX — Alternative marketplace for open-source editors (VSCodium, Cursor, etc.)
- 🐙 Issues — Report bugs and feature requests
Extension Features by License
PLUS
core features
- ✓Syntax coloring
- ✓Run Feature from editor
- ✓Run single Scenario / Example
- ✓Launch Configurations
- ✓Outline view
- ✓Code formatting
- ✓Test Results in IDE
PRO
By using this extension, you agree to the Karate Labs EULA. The extension and the Karate open-source library both ship with zero telemetry — no usage data, analytics, or device information is collected or transmitted. See our Privacy Policy for details.
Key Improvements
The current extension supports Karate v2 — the next generation of the framework. Highlights:
- Simple installation — the Karate CLI is a single binary, no Maven or Gradle project needed. Install it from within VS Code with one click via the Setup Dashboard, or from a terminal via karate.sh
- Setup Dashboard — single pane for CLI / JRE / JAR / license status; opens automatically on first install
- Real-time test results — scenarios update in the Test Explorer as the run progresses (
karate-climode) - JavaScript debugging — set breakpoints and step through embedded JavaScript within
.featurefiles for the first time - ANSI colors in console — rich colored output in the terminal, even outside the IDE
- HTML reports with tag filtering — interactive reports that filter results by tags
- Soft assertions — JSON validation works in soft-assertion mode by default, so tests continue and report all failures instead of stopping at the first one
- Large JSON support — operations such as
containsuse disk when needed to avoid out-of-memory issues on large payloads - One-click license renew — refresh your session instantly without going through the full sign-in flow again
- VS Code native test runner — tests in a dedicated test tree view, smaller gutter icons, right-click to debug
- Better formatter — Karate syntax coloring and inline JS / Examples-table parsing rewritten from scratch
- Match syntax diagnostics — syntax errors in feature files highlighted inline and surfaced in the "Problems" tab
Installation
Quick Start (karate-cli)
The fastest path — no Maven or Gradle project required.
- Install the extension from the VS Code Marketplace
- The Setup Dashboard opens automatically on first activation. Click Install CLI, then Run Setup to install the JRE and Karate JAR
- Open any
.featurefile — play buttons appear in the gutter - Press Cmd+F5 (macOS) or Ctrl+F5 (Windows / Linux) to run
You can reopen the dashboard at any time via the Command Palette — Karate: Setup.
Terminal Install (fallback)
If the in-IDE installer doesn't fit your environment — corporate proxies, headless setups, automation, or you just prefer the terminal — install the CLI directly from karate.sh:
curl -fsSL https://karate.sh/install.sh | sh
irm https://karate.sh/install.ps1 | iex
Then complete setup:
karate setup --all # installs JRE + Karate JAR
karate doctor # verify the install
Once the CLI is on PATH, click Refresh in the Setup Dashboard — the extension picks it up automatically.
Maven / Gradle (vscode-java)
If your project already has a pom.xml or build.gradle:
- Install Language Support for Java
- Run mode
auto(the default) detects your project automatically — or set it explicitly tovscode-javain settings - Open a
.featurefile and run from the gutter or the Test Explorer
The Setup Dashboard's CLI / JRE / JAR cards are not required in this mode — the extension drives tests through the Java extension's classpath. The dashboard shows a banner explaining this when a Maven / Gradle project is detected.
Requirements
- Java 17+ (for Karate 1.5.0+) or Java 11+ (for Karate 1.4.x) — only for
vscode-javamode karate-climode has no Java requirement when using the standalone CLI binary (a bundled JRE is installed by Run Setup)- Works on VS Code, VSCodium, Cursor, and any editor that supports the Open VSX registry
Run Modes
| Mode | Best for | How it works |
|---|---|---|
| auto (default) | Any project | Detects project type — uses vscode-java if pom.xml / build.gradle is present, else karate-cli |
| karate-cli | Karate v2 with karate-pom.json | Spawns the standalone CLI directly |
| vscode-java | Maven / Gradle | Uses Red Hat's Java extension |
Set the mode via karatelabs.karate.run.mode in your settings.
Setup Dashboard
The Setup Dashboard is the single place to install, update, troubleshoot, and check license status. Open it via the Command Palette → Karate: Setup, or let it open automatically the first time the extension activates.
The dashboard shows four tiles:
- CLI Launcher — the karate.sh binary that runs tests
- Java Runtime — bundled JRE installed under
~/.karate/jre/ - Karate JAR — the Karate engine; click Select Version on the tile to pick a specific release or channel
- License — current subscription state; click the button to sign in, renew, or sign out (delegates to the same dialogs reachable from the status bar)
Header actions adapt to state — Install CLI, Run Setup, or Update — plus utility buttons for Doctor (karate doctor), Settings, Docs, and Refresh.
In Maven / Gradle projects (vscode-java run mode), the dashboard shows a banner clarifying that the CLI / JRE / JAR cards are informational only — tests run through the Java extension's classpath, not the standalone CLI.
License Activation
License activation is available three ways, all reaching the same dialog:
- Status bar — click the Karate item on the right side of the status bar
- Setup Dashboard — use the License tile's Sign In / Manage License button
- Command Palette — type Karate and choose Sign In / Manage License
To sign in:
- Click Sign In to be taken through the sign-in flow linked to your existing subscription
- Copy the session ID from the browser and paste it into the input box in VS Code
Once signed-in you can work offline. Open the dialog at any time to see how many days remain in your session.
One-click renew — if your subscription is still valid, click Renew from the license info dialog to refresh your session instantly. No need to go through the full sign-in flow again.
Quick jump to Setup — the license info dialog also carries a Setup button, so you can reach the Setup Dashboard from the status bar in two clicks.
Offline License
Offline licensing is a paid feature for enterprises. Make sure you know who your designated admin is before performing this step.
If you need an offline license because of strict security or similar restrictions, please contact us.
When you run the Sign In / Manage License command, click the Offline License button. A unique code for your system will be shown — copy it and send it to your designated admin. You will be issued a license tied to this unique code. To apply the license, paste the full license text (starting with -----BEGIN LICENSE FILE-----) into the text field.
Core Features
Test Execution
Run tests from:
- Gutter play buttons — click the green triangle next to any Scenario
- Keyboard shortcut —
Cmd+F5/Ctrl+F5runs the test at the cursor - Test Explorer — tree view in the sidebar with run / debug buttons
- Explorer context menu — right-click a
.featurefile to run - Example row hover — hover over an
Examplesdata row to see[Run >>]
In karate-cli mode the Test Explorer updates scenario-by-scenario as the run progresses, not just at the end — pass / fail status flips in real time as Karate emits each event.
Launch Configurations
VS Code launch configurations let you re-run tests with specific parameters. All typical Karate options are supported, including JVM parameters and working directory.
{
"version": "0.2.0",
"configurations": [
{
"type": "karate",
"name": "env-test",
"request": "launch",
"karateArgs": [
"-e", "test",
"-t", "@smoke",
"${file}"
]
},
{
"type": "karate",
"name": "parallel-run",
"request": "launch",
"noDebug": true,
"karateArgs": [
"-T", "5",
"src/test/java"
]
}
]
}
Supported options
- Environment selection (
-e) - Tag filtering (
-t,~@ignore) - Parallel execution (
-T) - Custom JVM parameters
- Working directory control
"noDebug": trueto force "Run without Debugging"
You can have multiple configurations and switch between them from the Run and Debug view.
Syntax Highlighting
Rich syntax coloring for Karate / Gherkin with embedded JavaScript support.
Outline
Feature / Scenario / Scenario Outline tree in the Outline view sidebar. Navigate large files with ease.
Formatting
Format document aligns Examples table columns and normalizes indentation. Use the VS Code code formatting keyboard shortcut to format the current file.
Advanced Features (PRO)
Code Completion
Auto-complete Karate keywords after step prefixes (Given, When, Then, And, *).
Diagnostics
Real-time syntax error highlighting for Gherkin structure, match expressions, and embedded JavaScript. Errors surface inline and in the Problems tab.
Code Folding
Collapse sections to make it easier to work with long feature files. Multi-line regions — Scenario blocks, Background, and doc-strings — can all be folded.
JSON Re-formatting
Place the cursor inside JSON embedded in a feature file to see code-action options (light-bulb icon):
- Simplify — Karate's lenient format: single quotes and unquoted property keys
- Strict — Strict JSON using double quotes
- Make single line — Convert multi-line JSON to a single line
- Make multi-line — Convert a single line of JSON to multi-line, including triple-quotes
Debug
Set breakpoints in .feature files and debug with the Test Explorer's debug profile. Works in both karate-cli and vscode-java modes. With Karate v2 you can also debug embedded JavaScript — step through JS expressions, inspect variables, and set breakpoints in inline scripts.
Debug Java from Karate
A Karate debug session will stop at Java breakpoints, allowing you to debug both Karate and Java code in the same session.
Debug Karate from Java
You can start a normal Java debug session that uses the Karate Runner Java API and still stop at Karate breakpoints. This requires the Language Support for Java extension and vscode-java run mode.
Extension Settings
| Setting | Default | Description |
|---|---|---|
karatelabs.karate.run.mode | auto | How to run tests: auto, karate-cli, or vscode-java |
karatelabs.karate.karateCommand | karate | Path to the Karate CLI executable (karate-cli mode only) |
karatelabs.karate.cliOptions | [] | Additional CLI options passed to the Karate CLI |
VS Code supports workspace settings in .vscode/settings.json that can be checked into version control so the whole team uses the same configuration.
Commands
| Command | Description |
|---|---|
| Karate: Setup | Open the Setup Dashboard |
| Karate: Sign In / Manage License | Sign in or manage your license |
| Karate: Kill All Running Tests | Stop all running Karate processes |
| Karate: Clean Reports | Clean Karate report files |
| Karate: New Feature File | Create a new .feature file from a template |
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Cmd+F5 / Ctrl+F5 | Run test at cursor |
Migrating from a Previous Version
If you are upgrading from version 2.x of this extension, here is what changed. If you are also upgrading from Karate v1 to Karate v2, see the What's New in v2 and Migration Guide for framework-level changes.
What's Changed
- Run mode default — now
autoinstead ofvscode-java. Auto detects your project type — ifpom.xmlorbuild.gradleis present, it usesvscode-java; otherwisekarate-cli. You can still set it explicitly. - CodeLens replaced by gutter icons — the
Run/Debugtext that appeared above scenarios is now VS Code's native test gutter icons (play buttons in the left margin). Less intrusive, and supports run profiles. - Streamlined output — the dedicated "Karate" output channel has been replaced by the VS Code Test Results panel. Karate v2 provides native ANSI color output, so rich colored results work without any extra processing by the extension.
- Setup Dashboard on first install — the introductory walkthrough has been replaced by the Setup Dashboard, which opens automatically the first time the extension activates and consolidates CLI / JRE / JAR / license status in one place.
- Standalone mode removed — use
karate-climode instead. Install the CLI via Karate: Setup or karate.sh — it is a single binary with no dependencies. - Custom mode removed — use VS Code launch configurations for custom command setups.
Settings Migration
All settings remain under the karatelabs.karate.* namespace.
| Old setting | Status |
|---|---|
karatelabs.karate.run.mode | Still supported — now also accepts auto |
karatelabs.karate.run.modeJars | Removed (standalone mode deprecated) |
karatelabs.karate.run.classpathPrefix | Removed (standalone mode deprecated) |
karatelabs.karate.karateCommand | Still supported |
karatelabs.karate.cliOptions | Still supported |
License Compatibility
Your existing license file (~/.karate/karate.lic) is fully compatible. Offline licenses continue to work without changes. If you were previously signed in, you may need to sign in again via Karate: Sign In / Manage License.
Troubleshooting
- CLI not found — run Karate: Setup to install the CLI, install it from a terminal via karate.sh, or set
karatelabs.karate.karateCommandto the full path - In-IDE installer fails — corporate proxies, restricted networks, or unusual environments sometimes prevent the embedded installer from working. Install the CLI from a terminal via
curl -fsSL https://karate.sh/install.sh | sh, then click Refresh in the Setup Dashboard karate doctor— from a terminal, this command checks JRE, JAR, and config and reports any issues; the Doctor button in the Setup Dashboard runs the same check- vscode-java not working — ensure the Language Support for Java extension is installed and the project has imported successfully (look for the Java Ready indicator in the status bar)
- Debug not starting — check the Karate Debug output channel for errors
- Feature file not recognized — if another extension is handling
.featurefiles, make sure the Karate Labs extension is set as the default. Check that the language mode in the status bar shows Karate and not "Cucumber" or similar. - Check logs — open the Output panel and select "Karate" for extension logs. Use the VS Code command Developer: Set Log Level to change the log level to
Debugfor more detail.
Resources
- Marketplace: VS Code Marketplace
- Open VSX: open-vsx.org/extension/karatelabs/karate
- Video Tutorial: Complete VS Code extension demo
- Pricing: Karate Labs Pricing
- Issues: vscode-extension on GitHub
- Support: Contact Karate Labs for enterprise support
Next Steps
- Install the extension from the VS Code Marketplace
- Run Karate: Setup to install the CLI in one click
- Set up your launch configurations for common scenarios
- Explore debugging features with a PRO license
- Learn about IntelliJ IDEA integration