4

I am unable to run the feature file. whenever i tried to run the file
i am getting the below stack trace

    Exception in thread "main" Usage: java cucumber.api.cli.Main [options] [         
    [FILE|DIR][:LINE[:LINE]*] ]+
    Options:

-g, --glue PATH                    Where glue code (step definitions and hooks) is loaded from.
-f, --format FORMAT[:PATH_OR_URL]  How to format results. Goes to STDOUT unless PATH_OR_URL is specified.
                                   Built-in FORMAT types: junit, html, pretty, progress, json.
                                   FORMAT can also be a fully qualified class name.
-t, --tags TAG_EXPRESSION          Only run scenarios tagged with tags matching TAG_EXPRESSION.
-n, --name REGEXP                  Only run scenarios whose names match REGEXP.
-d, --[no-]-dry-run                Skip execution of glue code.
-m, --[no-]-monochrome             Don't colour terminal output.
-s, --[no-]-strict                 Treat undefined and pending steps as errors.
    --snippets                     Snippet name: underscore, camelcase
    --dotcucumber PATH_OR_URL      Where to write out runtime information. PATH_OR_URL can be a file system
                                   path or a URL.
-v, --version                      Print version.
-h, --help                         You're looking at it.

  cucumber.runtime.CucumberException: Unknown option: --plugin
at cucumber.runtime.RuntimeOptions.parse(RuntimeOptions.java:119)
at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:50)
at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:44)
at cucumber.api.cli.Main.run(Main.java:20)
at cucumber.api.cli.Main.main(Main.java:16)

Please help me to resolve the problem

  • Possible duplicate of [Cucumber feature files are not executed using Maven](http://stackoverflow.com/questions/16727986/cucumber-feature-files-are-not-executed-using-maven) – deltree Jun 12 '16 at 04:36
  • 4
    Please show us how you do the call. Something is broken in your command but I don't see it so I can't tell what's wrong. – Thomas Sundberg Jun 13 '16 at 06:26
  • does it work if you don't use `--plugin`? – meatspace Jun 24 '16 at 15:11
  • show more information on how the tests are invoked.. May be the command used will be of more interest. I could sense that there is an extra parameter in the command line with '--plugin' Try executing without this parameter.. – Praveen Jul 12 '16 at 08:57

2 Answers2

1

You normally get this issue if you did not set cucumberOptions correctly on your cukes files.

For example:

@RunWith(Cucumber.class) 
@CucumberOptions( dryRun = false, strict = true, features = "src/test/features/com/sample", glue = "com.sample", 
    tags = { "~@wip", "@executeThis" }, monochrome = true, 
    format = { "pretty", "html:target/cucumber", "json:target_json/cucumber.json", "junit:taget_junit/cucumber.xml" } ) 
    public class RunCukeTest { 
  } 
m00am
  • 5,910
  • 11
  • 53
  • 69
Sudhish K
  • 119
  • 5
1

Hi I also had this issue as well, and I did the following to resolve it, thanks to the comments of Anusha from video https://youtu.be/pD4B839qfos -the main trick is to firstly change the jar files you have as follows cucumber-core-1.2.5.jar cucumber-java-1.2.5.jar cucumber-junit-1.2.5.jar or any of the above, from 1.2.4 upwards - also update the following selenium-server-standalone-2.42.0.jar and upwards - also change the format keyword to plugin

Once you make the above changes, this should resolve your problem.

  • 1
    Please don't use individual jars, but use a dependency manager like Maven or Gradle. This will help make sure you have the right transitive dependencies. – Marit Jun 04 '19 at 14:29