Run your Karate tests in IntelliJ IDEA without paying: a free and efficient solution


Karate is an open source testing tool renowned for its lightness, efficiency and user-friendliness. If you're already familiar with Karate, you'll know how powerful it can be for automating your API and UI tests.

However, running these tests can sometimes be tedious, especially when you need to run them regularly in your development environment.

In this article, I'm going to share with you a simple and free solution for automating Karate test execution in IntelliJ IDEA at 0 Euro.

Existing options

When it comes to running Karate tests, you generally have three options:

Java file with dedicated runner

You can create a Java file for each Karate test, containing a specific runner. This can be handy for running individual tests, but it quickly becomes tedious when you have a large number of tests.

link karate-template


This may be convenient for running individual tests, but it quickly becomes tedious when you have a large number of tests.

package examples.users;


class UsersRunner {
    Karate testUsers() {


Simultaneous execution of all tests

Another option is to group all tests in a single Java file and run them simultaneously. This may be convenient for running all tests at once, but it can become cumbersome when you're trying to work on individual tests or debug specific problems.

package examples;

import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;

class ExamplesTest {

    void testParallel() {
        Results results = Runner.path("classpath:examples")
        assertEquals(0, results.getFailCount(), results.getErrorMessages());


Use of paid plugins

Finally, you can use paid plugins that offer a user-friendly interface for running Karate tests. While these plugins can be handy, they do add an extra cost.
12 USD / Month for Karate PLUS
64 USD / Month for Karate PRO

More information on the karate page Price link

With the plugin you can run tests with a run button and run them by Scenario or Feature.

The V 0.0 solution

After trying various approaches, I finally found a simple solution and to automate the execution of Karate tests in IntelliJ IDEA. 🎡


To implement this solution, you'll need two things: a generic Java class to run Karate tests and a custom runtime configuration in IntelliJ IDEA.

Creating the KarateRunner file

Create a file in your tree at the same level as your file "karate-config.js" file.

File contents


public class KarateRunner {
    Karate runTest() {
        String filePath = System.getProperty("karate.test");
        if (filePath == null || filePath.isEmpty()) {
            throw new IllegalArgumentException("Nom du fichier de test non spécifié. Veuillez spécifier le nom du fichier de test en tant que propriété système avec -Dkarate.test=nom_du_fichier.feature");
        String fileName = filePath.replace('\\', '/');

Custom runtime configuration in IntelliJ IDEA

  • Open IntelliJ IDEA and access the menu bar.
  • Select "Run" -> "Edit Configurations".
  • Create a new runtime configuration or modify an existing one.
  • Choose JUnit as template
Setting up our configuration

Set up your configuration as follows:

  1. Give your exp configuration a name: " KarateRunnerExc
  2. Use the "Dynamic Macros" feature to insert the name of the file currently selected in the IDE. Program arguments
    -ea -Dkarate.test=$FilePathRelativeToSourcepath$
  3. Look for our generic KarateRunner file.
  • Save configuration:

    • Once you have set the values in the configuration, click on "OK" to save the configuration.


To use our new configuration, choose the "KarateRunnerExc" configuration, then go to your test file (toto.feature) and run this configuration



With this solution in place, you can now automate the execution of your Karate tests in IntelliJ IDEA without having to spend money on paid plugins. This saves you

Fancy Tuxedo GIF - Fancy Tuxedo Winnie The Pooh - Discover & Share GIFs

save time and money while taking advantage of Karate's simplicity and user-friendliness in your software development process.

In the future, if I'm not too lazy, I'll work on a real plugin.

To find out more about Karate and start automating your tests, visit the official Karate website.

maudmcok Written by

Be the first to comment

Leave a comment

Your e-mail address will not be published. Required fields are marked with *.