1

Before upgrading Karate version to 1.0.0, this was the runner.

RunnerOptions options = RunnerOptions.fromAnnotationAndSystemProperties(null, null, getClass());
Results results = Runner.parallel(tags, paths, options.getName(),
Collections.singletonList(scenarioReporter), 1, null);

After upgrading Karate version to 1.0.0, then I refactored Karate Runner as following:

Results results = Runner.builder().hook(scenarioReporter).path(paths).tags(tags).parallel(threadCounts);

facing following error ->

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.969 s <<< FAILURE! - in com.poc.TestRunner
[ERROR] testAll  Time elapsed: 0.031 s  <<< ERROR!
java.lang.NoClassDefFoundError: com/intuit/karate/RuntimeHook
at com.poc.TestRunner.<init>(TestRunner.java:8)
Caused by: java.lang.ClassNotFoundException: com.intuit.karate.RuntimeHook
at com.poc.TestRunner.<init>(TestRunner.java:8)

it would be very helpful if you provide your thoughts/opinion on this issue.

1 Answers1

0

If the RuntimeHook class is not found, you most likely have an old version of Karate still in your maven / dependencies. Fix that please. Note that karate-apache is gone, this is a common mistake.

And the way you are using the Runner is not recommended, look at the examples, and read the release notes again please: https://github.com/intuit/karate/wiki/1.0-upgrade-guide

If still stuck, follow this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248