Do you have questions ? We got the answers!

Ask a question:

0
Can't invoke void gherkin.- Caused by: org.apache.maven.plugin.MojoFailureException

Solved 1 Answers 152 Views
I am trying to invoke recently imported cucumber project. I am using maven as a testing tool. Why doesn't that works?

Below is errors from my consol.

Results :

Tests in error:
  Scenario: Checkout as Guest User  : Can't invoke com.****.step_definations.CheckoutStepDefinitions.prepare() in file:/C:/Users/Administrator/IdeaProjects/cucumber-selenium-webdriver-demo/target/test-classes/
  Feature: Checkout : Can't invoke void gherkin.formatter.Reporter.result(Result) in file:/C:/Users/Administrator/.m2/repository/info/cukes/gherkin/2.10.0/gherkin-2.10.0.jar
  Scenario: Basic Search                         : Can't invoke com.****.step_definations.CheckoutStepDefinitions.prepare() in file:/C:/Users/Administrator/IdeaProjects/cucumber-selenium-webdriver-demo/target/test-classes/
  Feature: Search                        : Can't invoke void gherkin.formatter.Reporter.result(Result) in file:/C:/Users/Administrator/.m2/repository/info/cukes/gherkin/2.10.0/gherkin-2.10.0.jar

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.11:test (default-test) on project bdt: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Users\Administrator\IdeaProjects\cucumber-selenium-webdriver-demo\target\surefire-reports for the individual test results.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.11:test (default-test) on project bdt: There are test failures.

Please refer to C:\Users\Administrator\IdeaProjects\cucumber-selenium-webdriver-demo\target\surefire-reports for the individual test results.
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.

Please refer to C:\Users\Administrator\IdeaProjects\cucumber-selenium-webdriver-demo\target\surefire-reports for the individual test results.
        at org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:87)
        at org.apache.maven.plugin.surefire.SurefirePlugin.writeSummary(SurefirePlugin.java:651)
        at org.apache.maven.plugin.surefire.SurefirePlugin.handleSummary(SurefirePlugin.java:625)
        at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:136)
        at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:97)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 20 more

1 Answer

1
Best answer
Update your cucumber to the latest version. I recommend using 1.2.5.
answered May 13 by anonymous
selected May 14 by stbadmin

Top Contributors

  • 4970 pointsstbadmin

    34 questions 454 answers218 comments

  • 433 pointsSunilBhaskar

    41 questions 15 answers32 comments

  • 425 pointsMehedi

    36 questions 3 answers14 comments

  • 363 pointssumitkumarwatts

    0 questions 13 answers0 comments

  • 354 pointsSoft Tester

    43 questions 0 answers4 comments

  • 327 pointsKeeshaGolden

    0 questions 17 answers2 comments

  • 322 pointsVipul Sharma

    44 questions 0 answers24 comments

  • 310 pointsvysh.sharma

    25 questions 0 answers0 comments

  • 267 pointsOnkar_Nimje

    33 questions 15 answers15 comments

  • 258 pointsVanitha

    26 questions 0 answers6 comments

...