GET STARTED
Windows Quick Start (VS Code)
Take the karate-demo project from a ZIP to a green run, a bug found in the debugger and the HTML report, on a Windows machine where VS Code is the only thing installed. No Java, no Maven, no admin rights.
You need: Windows x64, VS Code, an internet connection, and a karatelabs.io account with IDE Plus (to run tests in the editor) or IDE Pro (to debug as well).
The Demo Project
karate-demo is a small Karate project with no pom.xml, no build.gradle and no Java code:
| File | What it shows |
|---|---|
features/cart/cart.feature | A cart invoice computed in JavaScript, both inline and in invoice.js, plus a Scenario Outline with an Examples table. No server, no network. |
features/cart/invoice.js | The invoice function the feature reads; the place to set a breakpoint. |
features/api/todos.feature | An API test against its own mock (todos-mock.feature), which it starts itself. |
karate-pom.json | Tells the Karate CLI and the extension which folder holds the tests. |
.vscode/extensions.json | Recommends the Karate extension. |
1. Download and Extract
- Download the ZIP: karate-demo-main.zip (or Code → Download ZIP on GitHub).
- In File Explorer, right-click
karate-demo-main.zip→ Extract All.
Extract All nests the project one level down: karate-demo-main\karate-demo-main. The folder to open is the one that holds karate-pom.json. Opening the outer folder leaves the Testing view empty.
2. Open the Folder
In VS Code: File → Open Folder…, pick the folder that holds karate-pom.json, and click Yes, I trust the authors. The Karate extension stays disabled in Restricted Mode, so the folder must be trusted.
3. Install the Extension
- Open the Extensions view (
Ctrl+Shift+X) and search forkarate. - Several extensions have similar names. Install Karate whose publisher is Karate Labs (id
karatelabs.karate). - If VS Code asks whether you trust the publisher Karate Labs, choose Trust Publisher & Install.
VS Code may also offer to install the project's recommended extension; that is the same one.
4. Karate Setup
The Karate Setup panel opens by itself, with the badge Not Installed.
- Click Install CLI. It downloads
karate.exeto%LOCALAPPDATA%\Programs\Karateand adds that folder to your userPATH. No admin rights needed. - Click Run Setup. A terminal runs
karate setup --all, which downloads a Java runtime and Karate into%USERPROFILE%\.karate. You do not install Java yourself. - When the terminal is done, click Refresh. The three cards (CLI Launcher, Java Runtime, Karate JAR) turn green and the badge reads Ready.
Reopen the panel at any time from the Command Palette: Karate: Setup.
5. Sign In
- On the panel's License card (Not signed in), click Sign In. Your browser opens the karatelabs.io sign-in page.
- Sign in, copy the session id the page shows, and paste it into the input box in VS Code.
- The status bar changes from Karate: Sign In to your plan, for example Karate PRO.
The license is saved to %USERPROFILE%\.karate\karate.lic, so you sign in once. See License Activation for renewing and offline licenses.
6. Write and Run
- Open the Testing view (the flask icon). It lists every feature in the project. Open
features\cart\cart.feature. - Click ▶ in the gutter next to a
Scenario, or put the cursor in it and pressCtrl+F5. Results appear in the Test Explorer as each scenario finishes. - Hover a row of the
Examplestable and click Run >> to run that row alone.
With IDE Pro, keywords complete as you type and mistakes such as = instead of == in a match are underlined before you run. Format Document (Shift+Alt+F) lines up Examples tables.
todos.feature starts a local mock server, so the first run of it may raise a Windows Defender Firewall prompt. cart.feature starts no server.
7. Debug a Failing Test
The video debugs a failing test. To see the same failure:
- In
features\cart\invoice.js, line 3, changeitem.price * item.qtytoitem.priceand save. - Run the
Scenarioincart.feature. It fails:match failed: EQUALS, a subtotal of7where11is expected. - In
invoice.js, click the gutter at line 4 to set a breakpoint. - In
cart.feature, right-click the gutter ▶ → Debug Test. Execution pauses insideinvoice.js; the Variables view showsitems,taxRateandsubtotal. - In the Debug Console, evaluate
items[0].price * items[0].qty:6, while the changed line added only the price,2. - Stop debugging, restore
item.price * item.qty, save and run again: green.
Debugging needs IDE Pro. See Debug for Java breakpoints and more.
8. Open the Report
After a run, VS Code shows Karate test complete with an Open Report button. It opens target\karate-reports\karate-summary.html in your browser. Click a feature to see each step, with the failing step's error.
Leave the feature's report page open while you work. After each fix and re-run, reload the page (F5) and watch red turn green, without navigating from the summary again.
If Windows asks which app should open the .html file, choose your browser and Always.
Prefer the Command Line?
One line in PowerShell installs the Karate CLI. Like the extension, it needs no admin rights and adds karate to your user PATH:
irm https://karate.sh/install.ps1 | iex
Then, in a new terminal in the project folder:
karate setup --all
karate run
karate run runs everything under the paths in karate-pom.json and writes the report to target\karate-reports\karate-summary.html. It needs no sign-in. On macOS and Linux the install line is curl -fsSL https://karate.sh/install.sh | sh; that script does not run in Git Bash on Windows, so use the PowerShell line there. See karate.sh and Command Line.
Plans
- IDE Plus runs your tests in the editor: gutter ▶, Test Explorer, single
Examplesrows. - IDE Pro adds the debugger, keyword completion, live diagnostics, folding, JSON code actions and Xplorer Premium.
- Enterprise adds async API testing, concurrent licenses and the license management portal.
Next Steps
- Visual Studio Code — every extension feature and setting
- Quick Start — write your first API test
- Test Reports — what the HTML report shows