EXTENSIONS
Examples and Demos
Karate provides extensive example projects and integrations to accelerate your testing. This page indexes all official examples, demo repositories, and integration patterns.
On this page:
- Starter Projects - Quick-start templates for new projects
- API Testing - REST, GraphQL, SOAP examples
- Performance Testing - Gatling integration
- API Mocking - Test doubles and contract testing
- Web Browser Automation - E2E tests, cloud platforms
- Integrations - 30+ framework and tool integrations
- Community Resources - Videos, books, courses
- Karate 1.4.1 requires Java 21 or lower
- Karate 1.5.1 requires Java 23 or lower
- Karate 1.5.2+ supports Java 24 and above
Starter Projects
karate-template
The fastest way to start a new Karate project. Use this GitHub template to create a skeleton project for API testing.
| Repository | karatelabs/karate-template |
| Use case | New API testing projects |
| Includes | Maven setup, example tests, parallel runner |
karate-todo
A complete demo application showcasing all Karate capabilities. Includes a working front-end UI and back-end API with examples of every testing type, plus a full CI/CD pipeline that publishes reports to GitHub Pages.
| Repository | karatelabs/karate-todo |
| Use case | Training, demos, learning all Karate features |
| Includes | API tests, performance tests, mocks, UI tests (Testcontainers), hybrid tests, GitHub Actions CI |
| Live reports | Karate summary • UI with screenshots • Gatling |
The karate-todo project is ideal for training sessions or demonstrating Karate's full capabilities to your team. See CI/CD for a walkthrough of its GitHub Actions pipeline.
API Testing
Example Projects
| Project | Description |
|---|---|
| karate-demo | Comprehensive regression test-suite for Karate itself with extensive examples |
| karate-todo | Working API with complete test examples |
| spring-boot | Spring Boot application testing patterns |
| folio-integration-tests | Complex real-world open-source implementation |
Feature Examples
The karate-demo project contains working examples for common testing scenarios:
| Feature | Example | Description |
|---|---|---|
| OAuth 2.0 | oauth2.feature | Authentication flow with token handling |
| GraphQL | graphql.feature | Queries with variables and nested responses |
| SOAP | soap.feature | XML SOAP web service testing |
| File Upload | upload.feature | Multipart file uploads |
| Multiple Files | upload-multiple-files.feature | Uploading multiple files |
| Dynamic Params | dynamic-params.feature | Data-driven parameter testing |
| Schema Validation | schema.feature | JSON schema-like validation |
| Headers | headers.feature | Request header management |
| Polling | polling.feature | Retry and polling patterns |
| Hooks | hooks.feature | Before/after scenario hooks |
| WebSocket | websocket.feature | WebSocket message handling |
| Calling Features | call-feature.feature | Reusable feature files |
| Dynamic CSV | dynamic-csv.feature | CSV-driven scenario outlines |
| Java Interop | cats-java.feature | Calling Java from Karate |
| Database | dogs.feature | JDBC database calls |
| Redirects | redirect.feature | HTTP redirect handling |
| Encoding | encoding.feature | Character encoding |
Performance Testing
Karate integrates with Gatling to re-use API functional tests as performance tests.
| Project | Description |
|---|---|
| examples/gatling | Standalone Gatling + Karate project |
| karate-todo | Includes working performance test example |
| karate-gatling docs | Main documentation with examples |
See the Performance Testing documentation for detailed setup and configuration.
API Mocking
Create API mocks and test doubles that can maintain state across calls.
| Project | Description |
|---|---|
| examples/gatling | Includes mock server example alongside performance tests |
| karate-todo | Mock server examples including pure JS option |
| consumer-driven-contracts | Contract testing with payment mock example |
| karate-netty | Mock server documentation and examples |
See the Test Doubles documentation for mock server setup.
Web Browser Automation
| Project | Description |
|---|---|
| karate-e2e-tests | Multi-browser configuration, parallel testing with karate-chrome Docker |
| karate-todo | UI tests and hybrid API+UI tests |
| Visual Testing | Image comparison (the karate-image extension) for visual regression |
Cloud Platform Support
Karate UI tests run on any WebDriver/Selenium-compatible infrastructure:
| Platform | Example |
|---|---|
| Sauce Labs | Configuration and setup |
| BrowserStack | Configuration and setup |
| Lambdatest | Configuration and setup |
See the UI Testing documentation for browser automation details.
Integrations
The karate-examples repository contains integration examples for 30+ tools and frameworks.
Cloud and Infrastructure
| Integration | Description | Link |
|---|---|---|
| AWS | AWS SDK integration via Java interop | aws |
| AWS DynamoDB | DynamoDB-specific examples | aws-dynamodb |
| Docker | CI/CD pipeline integration | docker |
| GitHub Codespaces | Browser-based development | Documentation |
Messaging and Async
| Integration | Description | Link |
|---|---|---|
| Kafka | Seamless Kafka message testing | kafka |
| Kafka mTLS | Kafka with mutual TLS | kafka-mtls |
| Kafka Custom | Advanced Kafka patterns | kafka-custom |
| RabbitMQ | Message queue testing | rabbitmq |
| ActiveMQ | JMS queue integration | Demo example |
| WebSocket | Built-in + advanced Java interop | websocket |
Application Frameworks
| Integration | Description | Link |
|---|---|---|
| Spring Boot | Testing Spring Boot applications | spring-boot |
| Micronaut | Micronaut framework integration | micronaut |
| Quarkus | Quarkus integration testing | quarkus |
Build Tools and Runtime
| Integration | Description | Link |
|---|---|---|
| Maven | Primary build tool (most examples use Maven) | karate-template |
| Gradle | Full Gradle support | Documentation |
| Karate CLI | Run Karate without a build tool or Java install | Standalone Execution |
| JUnit | Java test framework integration | Documentation |
Reporting
| Integration | Description | Link |
|---|---|---|
| Allure | Official Allure Report support | Documentation |
| ReportPortal | Official integration agent | Agent |
| Xray | Official Xray documentation | Documentation |
| Jacoco | Code coverage for Java backends | Demo |
| Cucumber Reports | Compatible HTML reports | Demo |
Protocols
| Integration | Description | Link |
|---|---|---|
| gRPC | Seamless gRPC service testing | grpc |
| gRPC Custom | Advanced gRPC patterns | grpc-custom |
| SSL/mTLS | X509 certificate configuration | ssl |
| SSH | Server command invocation | ssh |
Testing Tools
| Integration | Description | Link |
|---|---|---|
| Accessibility/Axe | DOM accessibility checks in UI tests | axe |
| CLI/Bash | Command-line and shell script testing | cli |
| Database | SQL and JDBC integration | database |
Enterprise Integrations
| Integration | Description | Link |
|---|---|---|
| Broadcom/CA | Continuous Delivery Director plugin | Documentation |
| Slack | Community examples and blog posts | slack |
Community Resources
Videos
| Video | Description |
|---|---|
| API Testing with Karate | Official introduction by Peter Thomas |
| Karate Tutorial Series | Comprehensive guide by James Willett |
Books
| Book | Author |
|---|---|
| Writing API Tests with Karate | Benjamin Bischoff (Packt Publishing) |
Community
| Resource | Description |
|---|---|
| Stack Overflow | Active Q&A community |
| GitHub Discussions | Feature requests and questions |
Comparison
For teams evaluating Karate against other tools, see this detailed comparison with REST-assured.
Next Steps
- Get started with testing: Quick Start
- Learn basic examples: Examples
- Set up performance testing: Performance Testing
- Create API mocks: Test Doubles
- Automate UI tests: UI Testing