Java SDK

Efficiently write load tests as code in Java.

Take full advantage of one of the most common and powerful programming languages to script your load tests. Bring in your Java libraries and make your load tests actually mimic real user behaviors in your application.
 
 

Create realistic load tests

Test-as-code allows you to build virtual user journeys that exactly match what your users do.

Improve your time to market

Take advantage of modern development practices to share and repurpose code. Save time on testing and deliver value to your users faster.

Integrate with your existing stack

Use your existing libraries and CI/CD integrations to make load testing seamless in your development lifecycle.

Run a Java SDK test with our interactive demo

Script complex user scenarios with ease

  • Abstract common tasks like user authentication to speed up test creation.

  • Import your datasets and libraries. Use your Java libraries and project-specific data. Data formats include CSV, JSON, JDBC, Redis, and more.

  • Store, transform, and reuse response data to precisely mimic real user behavior.
JavaSDK1

Use common development practices to collaborate and maintain your tests

  • Track changes in your tests using Git and Git-based remote repositories. Use modern development practices, such as pull requests, conflict resolution, and branching, for your tests.

  • Pull shared testing resources and components to harmonize your testing efforts across multiple teams. Share datasets, code, and test configurations to ensure quality and speed up your testing efforts.

  • Involve your tech team in testing early in the dev process with familiar syntax and structure that makes test writing feel like part of the development process.
JavaSDK2

Flexibility to handle your testing needs

Optimized for testing HTTP servers: Gatling provides excellent support for the HTTP protocol, making it a tool of choice for load testing any HTTP server. 

Gatling also supports a growing number of protocols. With the Java SDK, you can additionally test:

  • WebSocket
  • JMS
  • SSE
  • gRPC
  • MQTT
The core engine is protocol agnostic, so support for other protocols can be developed. For example, the Gatling community maintains a popular Kafka plugin.
JavaSDK3

Record user scenarios from your web application

The Java SDK has a built-in web recorder for capturing user scenarios and converting them into load test scripts. Some key features include:

  • Capturing browser-based actions like clicks, inputs, and natural pauses between actions.
  • Handling SSL certificates for HTTPS requests
  • Create clean, minimalist scripts with filters for unnecessary requests like .css files.
  • Convert tests from other tools into Gatling scripts by importing HAR files
JavaSDK4

Start testing now!

Test Gatling Enterprise for free! No credit card is required.

Dive into our other features

Frequently asked questions about the Java SDK

Can I use the Java SDK with Gatling Enterprise?

The Java SDK and Gatling Enterprise are perfectly integrated. After writing load tests in your local development environment, you can package and deploy the tests to the Gatling Enterprise platform through

  • the UI
  • CLI commands
  • your CI/CD pipeline
Which build tools does the Java SDK support?

Gatling builds and maintains plugins for the Maven and Gradle build tools and the Java SDK. 

The Maven and Gradle build tools are great for deeper integration into development projects, including:

  • Dependency management
  • Source control management
  • IDE integration
  • Customization, extensibility, and scalability.
I thought Gatling was only available in Scala?

Gatling provides expressive SDKs in Java, JavaScript, TypeScript, Kotlin, and Scala. The scenarios are designed to be easy to read, even if you are not a seasoned developer in one of these languages. The Java and JavaScript SDKs are a great place to start if you are new to Gatling or load testing in general.