Java.lang.NoClassDefFoundError: корнишон/форматтер/Reporter для Cucumber с отчетами об экстентахJAVA

Программисты JAVA общаются здесь
Ответить Пред. темаСлед. тема
Anonymous
 Java.lang.NoClassDefFoundError: корнишон/форматтер/Reporter для Cucumber с отчетами об экстентах

Сообщение Anonymous »

Я пытаюсь создать отчет об экстенте для моего тестового примера с помощью Cucumber и отчет об экстенте с помощью JUnit. Но я получаю:

Код: Выделить всё

java.lang.NoClassDefFoundError: gherkin/formatter/Reporter
и

Код: Выделить всё

java.lang.NoClassDefFoundError exception while running cucumber test using JUnit
Это зависимости, которые я добавил в свой pom.xml:

Код: Выделить всё

    
io.cucumber
cucumber-java
2.3.1
test



junit
junit
4.12
test



io.cucumber
cucumber-testng
2.3.1



com.beust
jcommander
1.27



io.cucumber
cucumber-junit
2.3.1
test



org.testng
testng
6.13
test



org.seleniumhq.selenium
selenium-java
3.8.1



com.vimalselvam
cucumber-extentsreport
3.0.0



com.aventstack
extentreports
3.1.3



com.relevantcodes
extentreports
2.41.2



info.cukes
cucumber-jvm-deps
1.0.3
provided

И это исключение, которое я получаю.

Код: Выделить всё

java.lang.NoClassDefFoundError: gherkin/formatter/Reporter
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at cucumber.runtime.formatter.PluginFactory.loadClass(PluginFactory.java:174)
at cucumber.runtime.formatter.PluginFactory.pluginClass(PluginFactory.java:166)
at cucumber.runtime.formatter.PluginFactory.getPluginClass(PluginFactory.java:223)
at cucumber.runtime.formatter.PluginFactory.isFormatterName(PluginFactory.java:201)
at cucumber.runtime.RuntimeOptionsFactory.addPlugins(RuntimeOptionsFactory.java:94)
at cucumber.runtime.RuntimeOptionsFactory.buildArgsFromOptions(RuntimeOptionsFactory.java:41)
at cucumber.runtime.RuntimeOptionsFactory.create(RuntimeOptionsFactory.java:26)
at cucumber.api.junit.Cucumber.(Cucumber.java:74)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createUnfilteredTest(JUnit4TestLoader.java:87)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:73)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:46)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:522)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
Caused by: java.lang.ClassNotFoundException: gherkin.formatter.Reporter
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
...  37 more
Мой класс бегуна следующий:

Код: Выделить всё

import java.io.File;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;

import com.cucumber.listener.ExtentProperties;
import com.cucumber.listener.Reporter;

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
@CucumberOptions(features= {"src/test/java/com/cumberpr2/First/feature"},
glue= {"com/cumberpr2/step"}, monochrome=true,tags= {"@bvt,@sanity"},
plugin = {"com.cucumber.listener.ExtentCucumberFormatter:target/cucumber/report1.html"})
public class Runner1 {

@AfterClass
public static void teardown() {
Reporter.loadXMLConfig(new File("/cumberpr2/Extent-Config.xml"));
//Reporter.setSystemInfo("user", System.getProperty("user.name"));
Reporter.setSystemInfo("os", "windows OSX");
Reporter.setTestRunnerOutput("Sample test runner output message");
}

}
Я не могу понять, в чем дело.

Любое предложение по исправлению будет полезно.< /п>

Подробнее здесь: https://stackoverflow.com/questions/492 ... r-with-ext
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение
  • @Runwith (cucumber.class) ошибка. Импорт Cucumber.api.junit.cucumber; не может быть решено
    Anonymous » » в форуме JAVA
    0 Ответы
    37 Просмотры
    Последнее сообщение Anonymous
  • @Runwith (cucumber.class) ошибка. Импорт Cucumber.api.junit.cucumber; не может быть решено
    Anonymous » » в форуме JAVA
    0 Ответы
    13 Просмотры
    Последнее сообщение Anonymous
  • @Runwith (cucumber.class) ошибка. Импорт Cucumber.api.junit.cucumber; не может быть решено
    Anonymous » » в форуме JAVA
    0 Ответы
    10 Просмотры
    Последнее сообщение Anonymous
  • Бросание огурца java.lang.NoClassDefFoundError: io/cucumber/core/gherkin/FeatureParser
    Anonymous » » в форуме JAVA
    0 Ответы
    21 Просмотры
    Последнее сообщение Anonymous
  • Бросание огурца java.lang.NoClassDefFoundError: io/cucumber/core/gherkin/FeatureParser
    Anonymous » » в форуме JAVA
    0 Ответы
    41 Просмотры
    Последнее сообщение Anonymous

Вернуться в «JAVA»