Skip to main content

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.

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

includes all in PLUS

  • Auto complete
  • Code folding
  • JSON re-formatting
  • Run all tests in folder
  • Run Karate Labs add-ons (e.g. Kafka)
  • Debug Karate test
  • Debug embedded JavaScript
  • Debug Java & Karate in same session
  • Match syntax diagnostics

ENTERPRISE

includes all in PRO

  • Priority support & SLA
  • SSO / SAML support
  • Offline license
  • Contact us
Legal Notice

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-cli mode)
  • JavaScript debugging — set breakpoints and step through embedded JavaScript within .feature files 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 contains use 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.

  1. Install the extension from the VS Code Marketplace
  2. The Setup Dashboard opens automatically on first activation. Click Install CLI, then Run Setup to install the JRE and Karate JAR
Karate Setup Dashboard in VS Code
  1. Open any .feature file — play buttons appear in the gutter
  2. 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:

macOS / Linux
curl -fsSL https://karate.sh/install.sh | sh
Windows (PowerShell)
irm https://karate.sh/install.ps1 | iex

Then complete setup:

Terminal
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:

  1. Install Language Support for Java
  2. Run mode auto (the default) detects your project automatically — or set it explicitly to vscode-java in settings
  3. Open a .feature file 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-java mode
  • karate-cli mode 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

ModeBest forHow it works
auto (default)Any projectDetects project type — uses vscode-java if pom.xml / build.gradle is present, else karate-cli
karate-cliKarate v2 with karate-pom.jsonSpawns the standalone CLI directly
vscode-javaMaven / GradleUses 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:

  1. Click Sign In to be taken through the sign-in flow linked to your existing subscription
  2. 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

Enterprise only

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

Gutter play buttons for running Karate scenarios

Run tests from:

  • Gutter play buttons — click the green triangle next to any Scenario
  • Keyboard shortcutCmd+F5 / Ctrl+F5 runs the test at the cursor
  • Test Explorer — tree view in the sidebar with run / debug buttons
  • Explorer context menu — right-click a .feature file to run
  • Example row hover — hover over an Examples data 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.

Karate test results panel in VS Code Hover-to-run on a single Examples row

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": true to force "Run without Debugging"

You can have multiple configurations and switch between them from the Run and Debug view.

Syntax Highlighting

Karate syntax highlighting in a feature file

Rich syntax coloring for Karate / Gherkin with embedded JavaScript support.

Outline

Outline view showing the Karate feature structure

Feature / Scenario / Scenario Outline tree in the Outline view sidebar. Navigate large files with ease.

Formatting

Karate feature formatted in VS Code

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

Karate keyword auto-complete in VS Code

Auto-complete Karate keywords after step prefixes (Given, When, Then, And, *).

Diagnostics

Real-time syntax diagnostics in a Karate feature file

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

Debugging a Karate feature file in VS Code

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

SettingDefaultDescription
karatelabs.karate.run.modeautoHow to run tests: auto, karate-cli, or vscode-java
karatelabs.karate.karateCommandkaratePath to the Karate CLI executable (karate-cli mode only)
karatelabs.karate.cliOptions[]Additional CLI options passed to the Karate CLI
Workspace settings

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

CommandDescription
Karate: SetupOpen the Setup Dashboard
Karate: Sign In / Manage LicenseSign in or manage your license
Karate: Kill All Running TestsStop all running Karate processes
Karate: Clean ReportsClean Karate report files
Karate: New Feature FileCreate a new .feature file from a template

Keyboard Shortcuts

ShortcutAction
Cmd+F5 / Ctrl+F5Run 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 auto instead of vscode-java. Auto detects your project type — if pom.xml or build.gradle is present, it uses vscode-java; otherwise karate-cli. You can still set it explicitly.
  • CodeLens replaced by gutter icons — the Run / Debug text 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-cli mode 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 settingStatus
karatelabs.karate.run.modeStill supported — now also accepts auto
karatelabs.karate.run.modeJarsRemoved (standalone mode deprecated)
karatelabs.karate.run.classpathPrefixRemoved (standalone mode deprecated)
karatelabs.karate.karateCommandStill supported
karatelabs.karate.cliOptionsStill 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.karateCommand to 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 .feature files, 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 Debug for more detail.

Resources

Next Steps