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.
- Install the Karate extension from the VS Code Marketplace
- Open Command Palette (
Cmd+Shift+P/Ctrl+Shift+P) and run Karate: Setup - The Setup Dashboard installs the Karate CLI and Java automatically:

- Create a
.featurefile, and press Cmd+F5 (macOS) or Ctrl+F5 (Windows/Linux) to run
That's it. Play buttons appear in the gutter next to each scenario. You get syntax highlighting, auto-complete, debugging, and HTML reports out of the box.
See the full VS Code Extension documentation for details on 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.
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.0.0</version>
<scope>test</scope>
</dependency>
Replace 2.0.0 with the latest version from Maven Central.
Step 3: Create a test runner
package examples;
import io.karatelabs.karate.Runner;
import io.karatelabs.karate.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 5 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