-1

I am able to see this issue when I write my java class using Karate language. Exception when I write the java class using Karate

Solution :

Add these dependencies to the pom.xml

<dependency>
    <groupId>com.intuit.karate</groupId>
    <artifactId>karate-apache</artifactId>
    <version>0.9.4</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>com.intuit.karate</groupId>
    <artifactId>karate-junit4</artifactId>
    <version>0.9.4</version>
    <scope>test</scope>
</dependency>
S.Daineko
  • 1,790
  • 1
  • 20
  • 29
  • a note to everyone landing here. the answers here contain bad advice. if you have mixed up junit4 and junit5 this is not a karate issue. "downgrading" is most likely NOT the right solution – Peter Thomas Mar 29 '21 at 12:25

2 Answers2

-1

Add these dependencies to the pom.xml for resolving the issue

<dependency>
    <groupId>com.intuit.karate</groupId>
    <artifactId>karate-apache</artifactId>
    <version>0.9.4</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>com.intuit.karate</groupId>
    <artifactId>karate-junit4</artifactId>
    <version>0.9.4</version>
    <scope>test</scope>
</dependency>

Also add this import statement to the java class

import com.intuit.karate.junit4.Karate;
Ardent Coder
  • 3,777
  • 9
  • 27
  • 53
-1

I was getting this error while using 'com.intuit.karate.junit5.Karate;' and it was solved by downgrading version from junit5 to junit4 as below

'import com.intuit.karate.junit4.Karate;'