One DSL, three protocols, zero glue code. Express async messages as JSON, assert with fuzzy matching, and mix HTTP with Kafka, gRPC, or WebSocket in the same test — all without writing a single Java helper class.
Kafka • gRPC • WebSocket • Enterprise runtime license required
Feature: End-to-end order flow
Scenario: HTTP request triggers Kafka event
# 1. Submit order via REST
Given url 'https://api.shop.com/orders'
And request { item: 'Laptop', qty: 1 }
When method post
Then status 201
# 2. Listen for Kafka event
Given topic 'orders.created'
When listen 5000
Then match listen.value ==
{ orderId: '#notnull', status: 'PENDING' }
# 3. Verify state via gRPC
Given rpc 'OrderService.GetStatus'
And request { id: listen.value.orderId }
When method grpc
Then match response.status == 'PENDING'
Protocols Supported
Pick the protocol your system uses — or all three. Every capability works the same way, with the same syntax.
Test event-driven architectures with native Kafka support. Avro, multiple listeners, parallel consumers.
Given topic 'orders.created'
And value { id: 1, status: 'NEW' }
When send
# Listen on another topic
Given topic 'orders.processed'
When listen 5000
Then match listen.value.status
== 'COMPLETE'
First-class gRPC testing with all four modes. Load .proto files directly — no codegen.
Given proto 'user.proto'
And rpc 'UserService.Create'
And request
{ name: 'Jane', role: 'admin' }
When method grpc
Then match response ==
{ id: '#number', created: '#notnull' }
.proto loading, no codegen
Test chat-bots, live dashboards, and real-time apps. Multiple concurrent connections with flow control.
Given ws 'wss://chat.example.com/room/1'
And send
{ type: 'msg', text: 'Hello' }
When receive 3000
Then match receive ==
{ type: 'ack', id: '#string' }
Why Karate for Async
Async testing in traditional frameworks means writing custom threading, serializers, and wire-format handlers. With Karate, it's the same syntax you use for REST.
Express Kafka messages, gRPC payloads, and WebSocket frames as JSON. Assert with the same fuzzy matchers as REST.
POST a REST call, wait for a Kafka event, verify via gRPC — all in the same scenario. End-to-end flows across your entire stack.
Built-in parallelism for async tests too. Run thousands of concurrent listeners or streams without threading bugs.
Re-use async tests as load tests via the Gatling integration. No separate performance tooling required.
Production-grade security out of the box. mTLS, SASL, bearer tokens, and SSL cert management across all three protocols.
Wire-format conversion, Avro schemas, Protobuf decoding — all handled automatically. No custom serializers to maintain.
Capability Matrix
Shared core capabilities across all three protocols, plus protocol-specific features where it matters.
| Capability | Kafka | gRPC | WebSocket |
|---|---|---|---|
| JSON data & assertions | |||
| Mix with HTTP in same test | |||
| Parallel execution | |||
| Performance testing (Gatling) | |||
| SSL / TLS | |||
| Multiple concurrent connections/listeners | |||
| Binary payloads (Avro / Protobuf) | Avro | Protobuf | — |
| Bidirectional streaming | — | ||
| Consumer group management | — | — |
Licensing
Requires an Enterprise runtime license for CI/CD deployment and the Pro tier of the IntelliJ or VS Code plugin for local development. Pricing scales with your team size and deployment model.
"We replaced a 2,000-line custom Kafka test harness with Karate in a single sprint. Our event-driven tests now run alongside REST tests in the same pipeline — with the exact same syntax."
James Moreno
Platform Lead, Global Payments Co.
Book a demo and we'll walk you through Karate async testing for your protocols, your infrastructure, and your compliance requirements.