Exception in thread "main" cucumber.runtime.CucumberException: Unknown option: --plugin

7,053 views
Skip to first unread message

Mustafa Topçu

unread,
Mar 24, 2016, 10:26:46 AM3/24/16
to Cukes
Hi Guys, 

I was  trying to install cucumber/selenium on eclipse but i got below excepiton. CAn you help me please?
Thanks.


My CucumberRunner Java:

package cucumber;

import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)

@CucumberOptions(
 features={"src/cucumber/"},
 format={"pretty","json:target/"}
 )


public class CucumberRunner {

}


Myfeature.feature

Feature: I want to use this template for my feature file

  Scenario: Title of your scenario
    Given I want to write a step with precondition
    And some other precondition
    When I complete action
    Then I validate the outcomes

The exception i got :

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.

Exception in thread "main" 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)

aslak hellesoy

unread,
Mar 24, 2016, 10:28:57 AM3/24/16
to Cucumber Users
You must be using a very old version. Try upgrading to the latest version, which is 1.2.4.

--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mustafa Topçu

unread,
Mar 24, 2016, 11:22:47 AM3/24/16
to Cukes
Which jar did you mean old version Aslak? 

Thanks. 

24 Mart 2016 Perşembe 16:26:46 UTC+2 tarihinde Mustafa Topçu yazdı:

aslak hellesoy

unread,
Mar 24, 2016, 11:45:04 AM3/24/16
to Cucumber Users
All the cucumber-* jars

gaura...@gmail.com

unread,
Mar 25, 2016, 1:22:12 AM3/25/16
to Cukes
Hi All,

I am also getting the same error. I am using the updated latest jars.

Please advice.

Thanks,
Gaurav Sharma

Mustafa Topçu

unread,
Mar 25, 2016, 3:08:52 AM3/25/16
to Cukes
i think the problem is not jars. Please help us. 

25 Mart 2016 Cuma 07:22:12 UTC+2 tarihinde gaura...@gmail.com yazdı:

Thomas Sundberg

unread,
Mar 25, 2016, 4:23:25 AM3/25/16
to cu...@googlegroups.com
On 25 March 2016 at 08:08, Mustafa Topçu <mustafatop...@gmail.com> wrote:
> i think the problem is not jars. Please help us.
>

Help us with more details about how you try to run Cucumber.

* Which command are you using to run Cucumber?

* How do you specify your Cucumber libraries?

* Which version of Cucumber are you using?

This is information that may give us enough details so we can help you
with where you should do a change.

You can also try to to download
https://github.com/cucumber/cucumber-java-skeleton and follow the
instructions on how to get cucumber up and running using Maven.

/Thomas
--
Thomas Sundberg
M. Sc. in Computer Science

Mobile: +46 70 767 33 15
Blog: http://thomassundberg.wordpress.com/
Twitter: @thomassundberg

Better software through faster feedback

Join me for a Selenium kickstart in Timisoara, Romania in April.
http://mozaicworks.com/public-trainings-and-workshops/selenium-webdriver-test-automation-for-web-applications/

Interested in a BDD Kickstart in Stockholm?
https://cucumber.io/events/bdd-kickstart-stockholm-16

Mustafa Topçu

unread,
Mar 25, 2016, 5:16:00 AM3/25/16
to Cukes, t...@kth.se
Hi,

I added a screenshot of my eclipse, jars and all my other codes and setting. 


My Feature:

Feature: Title of your feature
  I want to use this template for my feature file

  Scenario: Title of your scenario
    Given first
    When second
    Then third

Thanks.

25 Mart 2016 Cuma 10:23:25 UTC+2 tarihinde Thomas Sundberg yazdı:

Paolo Ambrosio

unread,
Mar 25, 2016, 9:04:33 AM3/25/16
to cu...@googlegroups.com
I suspect Cucumber-Eclipse is not compatible with the very old version
of Cucumber you are including (1.1.5 was released in September 2013).
Try with 1.2.4 and see if the errors go away.

Paolo

Mustafa Topçu

unread,
Mar 25, 2016, 11:04:36 AM3/25/16
to Cukes
I have just updated cucumber jars. Now i got different problem. screenshot is  http://prnt.sc/ajvadz

Feature

Feature: Title of your feature
  I want to use this template for my feature file

  Scenario: Title of your scenario
    Given I want to write a step with precondition
    And some other precondition
    When I complete action
    Then done it


CucumberRunner.java

package cucumber;

import org.junit.runner.RunWith;

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

@RunWith(Cucumber.class)
@CucumberOptions(
 features={"src/cucumber/"},
 format={"pretty","json:target/"}
 )
public class CucumberRunner {


}


Exception:
Exception in thread "main" java.lang.NoSuchMethodError: gherkin.formatter.model.Scenario.getId()Ljava/lang/String;
at cucumber.runtime.ScenarioImpl.<init>(ScenarioImpl.java:28)
at cucumber.runtime.Runtime.buildBackendWorlds(Runtime.java:145)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:38)
at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:165)
at cucumber.runtime.Runtime.run(Runtime.java:121)
at cucumber.api.cli.Main.run(Main.java:36)
at cucumber.api.cli.Main.main(Main.java:18)







25 Mart 2016 Cuma 15:04:33 UTC+2 tarihinde Paolo Ambrosio yazdı:

George Dinwiddie

unread,
Mar 25, 2016, 3:11:59 PM3/25/16
to cu...@googlegroups.com
Mustafa,

On 3/24/16 10:23 AM, Mustafa Topçu wrote:
> Hi Guys,
>
> I was trying to install cucumber/selenium on eclipse but i got below
> excepiton. CAn you help me please?
> Thanks.
>
> *
> *
> *My CucumberRunner Java:*
>
> package cucumber;
>
> import org.junit.runner.RunWith;
> import cucumber.api.CucumberOptions;
> import cucumber.api.junit.Cucumber;
>
> @RunWith(Cucumber.class)
>
> @CucumberOptions(
> features={"src/cucumber/"},
> format={"pretty","json:target/"}
> )
>
>
> public class CucumberRunner {
>
> }

This class is for running Cucumber under Junit.

>
>
> *Myfeature.feature*
>
> Feature: I want to use this template for my feature file
>
> Scenario: Title of your scenario
> Given I want to write a step with precondition
> And some other precondition
> When I complete action
> Then I validate the outcomes
> *
> *
> *The exception i got :*
This stack trace says that you're running the Command Line Interface.
These two ways of running Cucumber take the arguments in different ways.

How are you starting Cucumber?

Also, how are you setting your classpath?

- George



--
----------------------------------------------------------------------
* George Dinwiddie * http://blog.gdinwiddie.com
Software Development http://www.idiacomputing.com
Consultant and Coach http://www.agilemaryland.org
----------------------------------------------------------------------

Paolo Ambrosio

unread,
Mar 25, 2016, 3:14:02 PM3/25/16
to cu...@googlegroups.com
Using tools for dependency management would really help with this. You
forgot to upgrade gherkin to 2.12.2 and cucumber-jvm-deps to 1.0.5.

On Fri, Mar 25, 2016 at 3:04 PM, Mustafa Topçu

Ahmet Mesut Erçıkan

unread,
Sep 26, 2017, 8:45:11 AM9/26/17
to Cukes
@Mustafa Topçu sorunu çözebildiniz mi ?

24 Mart 2016 Perşembe 18:22:47 UTC+3 tarihinde Mustafa Topçu yazdı:

sree m

unread,
Mar 22, 2018, 6:51:17 AM3/22/18
to Cukes
hi


this is sirisha i have this error i create feature file , runner class and step definition, but when i executed my feature file having below error . please help me how to solve this 
Feature: Test Automation of amazon
Exception in thread "main" java.lang.AbstractMethodError: cucumber.runtime.java.JavaStepDefinition.matchedArguments(Lgherkin/formatter/model/Step;)Ljava/util/List;
at cucumber.runtime.RuntimeGlue.stepDefinitionMatches(RuntimeGlue.java:81)
at cucumber.runtime.RuntimeGlue.stepDefinitionMatch(RuntimeGlue.java:62)
at cucumber.runtime.Runtime.runStep(Runtime.java:267)
at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44)
at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:165)
at cucumber.runtime.Runtime.run(Runtime.java:122)
at cucumber.api.cli.Main.run(Main.java:36)
at cucumber.api.cli.Main.main(Main.java:18)

Feature: Test Automation of amazon
Exception in thread "main" java.lang.AbstractMethodError: cucumber.runtime.java.JavaStepDefinition.matchedArguments(Lgherkin/formatter/model/Step;)Ljava/util/List;
at cucumber.runtime.RuntimeGlue.stepDefinitionMatches(RuntimeGlue.java:81)
at cucumber.runtime.RuntimeGlue.stepDefinitionMatch(RuntimeGlue.java:62)
at cucumber.runtime.Runtime.runStep(Runtime.java:267)
at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44)
at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:165)
at cucumber.runtime.Runtime.run(Runtime.java:122)
at cucumber.api.cli.Main.run(Main.java:36)
at cucumber.api.cli.Main.main(Main.java:18)
Feature: Test Automation of amazon

  Scenario: Open site valid credentials
    Given User open chromeBrowser and start application
    Then Enter Valid "username" and "password"
    Then User open amzon user account  successfully
    Then Close site
    And Close chrome browser

package runnerpack;




import org.junit.runner.RunWith;

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


@RunWith(Cucumber.class)
@CucumberOptions(features="feature", glue = "stepdefination")



public class Runnerclass {

}
package stepdefination;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;

public class Stepamazon {
WebDriver driver;
@Given("^User open chromeBrowser and start application$")
public void user_open_chromeBrowser_and_start_application() throws Exception {
System.setProperty("webdriver.chrome.driver","F:\\SELENIUM INSTALLS\\WEBDRIVERS\\chromedriver.exe");
driver=new ChromeDriver();
driver.get("https://www.amazon.com");
driver.manage().window().maximize();
Thread.sleep(1000);
//click sign button:
driver.findElement(By.xpath(".//*[text() = 'Hello. Sign in']")).click();
Thread.sleep(600);
}
@Then("^Enter Valid \"([^\"]*)\" and \"([^\"]*)\"$")
public void enter_Valid_and(String username, String password) throws Exception {
   driver.findElement(By.name("email")).sendKeys(username);
   driver.findElement(By.id("continue")).click();
   driver.findElement(By.name("password")).sendKeys(password);
   driver.findElement(By.id("signInSubmit")).click();
   Thread.sleep(600);
}

@Then("^User open amzon user account  successfully$")
public void user_open_amzon_user_account_successfully() throws Exception {
driver.findElement(By.xpath(".//*[text()='Hello, Sirisha']")) ;
Thread.sleep(1000);
    }
@Then("^Close site$")
public void close_site() throws Exception {
WebElement e = driver.findElement(By.xpath(".//*[@id='nav-item-signout-sa']/span[class = 'nav-text' or text() ='Sign Out']"));
Actions a = new Actions(driver);
a.moveToElement(e).build().perform();
Thread.sleep(1000);
}

@Then("^Close chrome browser$")
public void close_chrome_browser() throws Exception {
    driver.close();
}


}

Koen Prins

unread,
Mar 25, 2018, 2:17:12 AM3/25/18
to cu...@googlegroups.com
It seems your runner is in a strange place compared to the classpath and it thus has some issues locating the glue code.
Move stuff around and try some solutions to that. The error is pretty clear: "Where is my glue?"

--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages