GET STARTED
Install & Get Started
Choose the path that fits your workflow. Karate v2 requires Java 21+ for virtual threads support.
Not sure which to choose? Non-technical users and beginners should start with the VS Code extension. Java developers should use Maven or Gradle. Everyone else (scripting, CI/CD, quick tests) should use the Karate CLI.
Path 1: VS Code Extension (Recommended for Beginners)
The easiest way to get started — no Java or build tool installation needed. The VS Code extension installs the Karate CLI and Java for you.
Follow the Windows Quick Start: from nothing but VS Code to a run, a debug session and the HTML report, on the karate-demo project. Or watch the video (2:16).
- In the Extensions view, search
karateand install Karate whose publisher is Karate Labs (idkaratelabs.karate; several extensions have similar names). Also on the VS Code Marketplace and Open VSX. - The Karate Setup panel opens by itself (or Command Palette → Karate: Setup). Click Install CLI, then Run Setup, then Refresh: the CLI brings its own Java runtime and Karate.
- On the License card, click Sign In, sign in in your browser and paste the session id back into VS Code. The status bar shows your plan.
- Open a
.featurefile and click ▶ in the gutter, or press Cmd+F5 (macOS) or Ctrl+F5 (Windows/Linux)
Running tests from the editor needs IDE Plus; debugging and auto-complete need IDE Pro. See pricing.
See the VS Code page for debugging, launch configurations, and license tiers.
Path 2: Karate CLI (Recommended for Quick Setup)
The Karate CLI installs everything you need — including a JRE if you don't have Java. No Maven or Gradle required.
- macOS / Linux
- Windows
curl -fsSL https://karate.sh/install.sh | sh
irm https://karate.sh/install.ps1 | iex
Set up everything (JRE + Karate JAR):
karate setup --all
Or if you already have Java 21+:
karate setup --item jar
Run a test:
karate test.feature
Useful commands:
karate doctor # Check your setup
karate update --all # Update to latest version
karate -T 4 tests/ # Run folder in parallel with 4 threads
karate -t @smoke . # Run only @smoke tagged tests
karate -e qa . # Run with 'qa' environment
See the Karate CLI documentation for the full command reference.
Path 3: Maven
For Java teams already using Maven. Add Karate as a test dependency.
Follow the IntelliJ Quick Start: from a Maven project to a run, a JUnit debug session that stops at Java and Karate breakpoints, and the HTML report, on the karate-todo project. Or watch the video (3:01). The plugin is on the JetBrains Marketplace; see the IntelliJ page.
Step 1: Ensure Java 21+ and Maven are installed
java -version # Must be 21+
mvn -v
Need to install Java or Maven?
macOS:
brew install openjdk@21 maven
Windows:
winget install EclipseAdoptium.Temurin.21.JDK
winget install Apache.Maven
Linux (SDKMAN!):
sdk install java 21-tem
sdk install maven
Step 2: Add dependency to pom.xml
<dependency>
<groupId>io.karatelabs</groupId>
<artifactId>karate-core</artifactId>
<version>2.1.4</version>
<scope>test</scope>
</dependency>
2.1.4 is the latest released version — see Maven Central for all versions.
Step 3: Create a test runner
package examples;
import io.karatelabs.core.Runner;
import io.karatelabs.core.SuiteResult;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
class ExamplesTest {
@Test
void testAll() {
SuiteResult result = Runner.path("classpath:examples")
.outputHtmlReport(true)
.parallel(5);
assertTrue(result.isPassed());
}
}
Step 4: Create a feature file
Feature: User API
Scenario: Get user by ID
Given url 'https://jsonplaceholder.typicode.com'
And path 'users/1'
When method get
Then status 200
And match response.name == '#string'
Step 5: Run
mvn test
Path 4: Gradle
For Java teams using Gradle. Similar to Maven but with Gradle conventions.
Step 1: Add dependency to build.gradle
dependencies {
testImplementation 'io.karatelabs:karate-core:2.0.0'
}
test {
useJUnitPlatform()
// Karate uses virtual threads, ensure Java 21+
jvmArgs '--enable-preview'
}
Step 2: Create test runner and feature files
Same as the Maven path above — create a JUnit test runner and .feature files under src/test/java/.
Step 3: Run
./gradlew test
Path 5: Standalone JAR
Download the fatjar and run directly — no build tool needed, just Java.
Step 1: Ensure Java 21+
java -version
Step 2: Download
Download karate-2.0.0.jar from GitHub Releases.
Step 3: Run
java -jar karate-2.0.0.jar test.feature
java -jar karate-2.0.0.jar -T 4 tests/ # parallel
java -jar karate-2.0.0.jar -t @smoke -e qa . # tags + env
See Standalone Execution for CI/CD examples and full CLI options.
Verify Your Setup
Whichever path you chose, create this file and run it to verify everything works:
Feature: Hello Karate
Scenario: Health check
Given url 'https://jsonplaceholder.typicode.com'
And path 'users'
When method get
Then status 200
And match response == '#[10]'
And match each response contains { id: '#number', name: '#string' }
You should see all assertions pass and an HTML report generated in your output directory.
Next Steps
- Core Syntax — learn the Karate DSL
- HTTP Requests — make API calls
- Assertions — validate responses
- Running Tests — parallel execution and CI/CD