Karate tests can be run in parallel and dramatically reduce runtime, it doesn’t depend on JUnit , Maven or Gradle .You can easily “choose” features and tags to run and compile a test suite in a very flexible way. Also, one can use the returned result objects to check if any scenario failed and to even summarize the error.

Note:- While running with Junit 4, do not use @RunWith(Karate.class) annotations.

import com.intuit.karate.Results;
import com.intuit.karate.Runner; 
import static org.junit.Assert.*; 
import org.junit.Test; 
public class TestParallel { @Test public void testParallel() { 
Results results = Runner.path("classpath:some/package").tags("~@ignore").parallel(5); 
assertTrue(results.getErrorMessages(), results.getFailCount() == 0);
 }
 }

If you are working with Junit 5, use the below code to run you features files in parallel

import com.intuit.karate.Results;
import com.intuit.karate.Runner; 
import static org.junit.jupiter.api.Assertions.*; 
import org.junit.jupiter.api.Test; 
class TestParallel { 
@Test void testParallel() { 
Results results = Runner.path("classpath:animals").tags("~@ignore").parallel(5); 
assertEquals(0, results.getFailCount(), results.getErrorMessages()); 
} 
}

The parallel runner will always run Feature-s in parallel. Karate will also run Scenario-s in parallel by default. So if you have a Feature with multiple Scenario-s in it – they will execute in parallel and even each Examples row in a Scenario Outline will do so!