Karate scenario cannot be executed from intellij

别等时光非礼了梦想. 提交于 2019-12-11 04:38:01

问题


Unable to execute karate scenario from intellij OS: Mac Intellij version: Karate scenario cannot be executed from intellij Karate version:

compile group: 'io.cucumber', name: 'cucumber-core', version: '4.7.0'

testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'com.intuit.karate', name: 'karate-apache', version: '0.9.3'
testCompile group: 'com.intuit.karate', name: 'karate-junit4', version: '0.9.3'

Error message

Error: Could not find or load main class cucumber.api.cli.Main
Caused by: java.lang.ClassNotFoundException: cucumber.api.cli.Main

回答1:


You are trying to mix Cucumber and Karate which is not supported. Refer to this issue for the gory details.

So try without the Cucumber dependency. For instructions on how to get started on IntelliJ - please refer this video: https://youtu.be/W-af7Cd8cMc




回答2:


The issue got resolved by setting the Switch IDE Boot JDK to default and deleting the cache and restart. The cause this was due to multiple jdk I have installed in my machine (JDK8 and JDK 12). Deleted the old one and set the boot JDK to 12.

The issue is not with Karate library, its with the IntelliJ configuration.



来源:https://stackoverflow.com/questions/57194777/karate-scenario-cannot-be-executed-from-intellij

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!