IDE SUPPORT
Visual Studio Code
The Karate Labs VS Code extension provides a complete development environment for Karate tests with advanced features like debugging, auto-completion, and integrated test execution.
Quick Links
- 📺 Video Tutorial - Complete walkthrough of VS Code extension features
- 💲 Pricing - License tiers and pricing information
- ⚡ Marketplace - Install from VS Code Marketplace
- 💡 Open VSX - Alternative marketplace for open-source editors
- 🐙 Issues - Report bugs and feature requests
Installation
Install the extension from the VS Code Marketplace or search for "Karate" in the Extensions view.
Requirements:
- Java 17+ (for Karate 1.5.0+) or Java 11+ (for Karate 1.4.x)
- Language Support for Java extension (recommended for Maven/Gradle projects)
Extension Features by License
PLUS
PRO
By using this extension, you agree to the Karate Labs EULA. Data on a few user actions is collected and subject to our Privacy Policy. HTML reports generated by the Karate open-source library has additional analytics.
License Activation
Online License
- Open Command Palette (
Ctrl+Shift+P
/Cmd+Shift+P
) - Type "Karate" and select Sign In / Manage License
- Click Sign In to authenticate with your Karate Labs account
- Copy the session ID from your browser
- Paste the session ID into VS Code and press Enter
Once authenticated, you can work offline. Use the same command to check remaining session days.
Offline License (Enterprise Only)
For enterprise customers requiring offline licenses:
- Run Sign In / Manage License command
- Click Offline License
- Copy the unique system code (e.g.,
DhHOFKHvd7XYTi+rQnNTJQ==
) - Send the code to your designated admin
- Paste the received license file content (starting with
-----BEGIN LICENSE FILE-----
) - Press Enter to activate
Configuration
Settings
Access extension settings via Extensions → Karate → Settings (gear icon).
Run Mode
vscode-java (Recommended)
- default mode for Maven/Gradle projects
- Requires Language Support for Java extension
- Automatically detects project dependencies
standalone
- Uses Karate standalone JAR
- Set
karatelabs.karate.run.modeJars
to folder containing JARs - All JARs in the folder are included in classpath
custom
- Run commands like
java
ormvn
directly - Commands must be in system PATH
- Use
${karateArgs}
placeholder for generated arguments
Classpath Settings
karatelabs.karate.run.classpathPrefix
: Default.
(project root)- Add comma-delimited entries:
.,src/test/java
- Include JAR files if needed
Workspace Settings
Create .vscode/settings.json
for team-wide settings:
{
"karatelabs.karate.run.mode": "vscode-java",
"karatelabs.karate.run.classpathPrefix": ".,src/test/java"
}
Launch Configurations
Create .vscode/launch.json
for reusable test configurations:
{
"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
Code Intelligence (PRO+)
Auto-completion
- Karate keywords and syntax
- Built-in functions and variables
- Context-aware suggestions
Code Folding
- Collapse scenarios and features
- Focus on specific test sections
Outline View
- Navigate large feature files
- Jump to scenarios and examples
JSON Formatting
- Lenient format (single quotes, unquoted keys)
- Strict JSON format
- Single/multi-line conversion
- Triple-quote formatting
Debugging (PRO+)
Karate Debugging
- Set breakpoints in feature files
- Step through test execution
- Inspect variables and responses
- Hot-reload simple edits
- Step backwards through execution
Java Integration
- Debug Java and Karate in same session
- Java breakpoints stop during Karate execution
- Start from Java debug session and stop at Karate breakpoints (requires Karate 1.5.0.RC3+)
Mock Server (PRO+)
Run feature files as mock servers:
- Right-click
.feature
files → Run as mock - Support for JavaScript mocks (
.js
files) - Perfect for service virtualization
Test Results
HTML Reports
- One-click access to detailed reports
- Request/response logs included
- Timeline view for parallel execution
IDE Integration
- Test status in editor
- Error highlighting
- Quick navigation to failures
Troubleshooting
Common Issues
Extension Conflicts
- Disable other
.feature
file extensions - Ensure Karate Labs extension is active
Java Setup
- Verify Java 17+ is installed and in PATH
- Set JAVA_HOME environment variable
- Install Language Support for Java extension
Indicators to Check
- "Java Ready" indicator for Maven/Gradle projects
- Karate syntax highlighting active
- CodeLens buttons visible in feature files
Debugging Problems
Karate Log
- Open Output panel (View → Output)
- Select "Karate Log" from dropdown
- Check for error messages
Increase Log Level
- Command Palette → "Developer: Set Log Level"
- Select "Karate Log"
- Set to "Debug" for detailed information
Workspace Configuration
Ensure your workspace has proper structure:
- Maven/Gradle project files in root
- Feature files in standard locations
karate-config.js
accessible from classpath
Resources
- Extension Marketplace: VS Code Marketplace
- Video Tutorial: Available on Karate Labs website
- Pricing Information: Karate Labs Pricing
- Support: Contact Karate Labs for enterprise support
Next Steps
- Install the Language Support for Java extension
- Set up your launch configurations for common test scenarios
- Explore debugging features with a PRO license
- Learn about IntelliJ IDEA integration