Skip to content


Subversion checkout URL

You can clone with
Download ZIP


com.beust.jcommander.ParameterException: Trouble running test with tags option #266

restagner opened this Issue · 6 comments

3 participants


Cucumber-JVM version: 1.0.0.RC21
Modules: cucumber-picocontainer, cucumber-junit & cucumber-html
Executed the following JUnit test:

@Cucumber.Options(features = {"features/"}, glue = {"com.twds.example.stepdefs"}, tags = {"@selenium"})
public class RunExampleTest {

Output from test

com.beust.jcommander.ParameterException: Could not read file selenium: selenium (The system cannot find the file specified)
at com.beust.jcommander.JCommander.readFile(
at com.beust.jcommander.JCommander.expandArgs(
at com.beust.jcommander.JCommander.parse(
at com.beust.jcommander.JCommander.parse(
at cucumber.runtime.RuntimeOptions.(
at cucumber.junit.RuntimeOptionsFactory.create(
at cucumber.junit.Cucumber.(
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
at java.lang.reflect.Constructor.newInstance(
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(
at org.junit.internal.requests.ClassRequest.getRunner(
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.(
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.(
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(

Steps to reproduce

  1. add the 'tags' option to the Cucumber.Options annotation contained in the JUnit class
  2. add a tag to a feature file (place the tag at the scenario level) -- the name of the tag should match the one added in Step 1.
  3. run the test

I just ran into the same issue - I'll look into it


The culprit is here. It's common for many command line tools to use @ to refer to contents in a file.

We have 3 options:

1) Patch JCommander and wait for a new release
2) Don't use JCommander at all

I'll have to think about this.


For what it's worth, it would have been trivial for me to make this '@' parameter configurable.


@cbeust yeah I figured it would have been easy, but implementing our own parsing turned out to be just as simple :-)


Fair enough :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.