AmbiguousStepDefinitionsException

203 views
Skip to first unread message

Vinoth Kannan

unread,
Jul 13, 2016, 3:35:48 PM7/13/16
to Cukes

cucumber.runtime.AmbiguousStepDefinitionsException: ?.Given I create a OME application with the below table(C:/workspace/com.APM/src/test/resources/features/login.feature:76) matches more than one step definition:
  I create a OME application in CreateApplication.I_Create_OME_App()
  I create a OME application with the below table in CreateApplication.I_Create_OME_Application(DataTable)

at cucumber.runtime.RuntimeGlue.stepDefinitionMatch(RuntimeGlue.java:71)
at cucumber.runtime.Runtime.runStep(Runtime.java:266)
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:121)
at cucumber.api.cli.Main.run(Main.java:36)
at cucumber.api.cli.Main.main(Main.java:18)



why am i getting this error.

it clearly states that one is pointing to I_Create_OME_App() and other one to  I_Create_OME_Application(DataTable)
and the scenario step is also different.

Can someone please help me in this.

Thanks
Vinoth

aslak hellesoy

unread,
Jul 13, 2016, 3:38:16 PM7/13/16
to cu...@googlegroups.com


On Wednesday, 13 July 2016, Vinoth Kannan <vinothk...@gmail.com> wrote:

cucumber.runtime.AmbiguousStepDefinitionsException: ?.Given I create a OME application with the below table(C:/workspace/com.APM/src/test/resources/features/login.feature:76) matches more than one step definition:
  I create a OME application in CreateApplication.I_Create_OME_App()
  I create a OME application with the below table in CreateApplication.I_Create_OME_Application(DataTable)

at cucumber.runtime.RuntimeGlue.stepDefinitionMatch(RuntimeGlue.java:71)
at cucumber.runtime.Runtime.runStep(Runtime.java:266)
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:121)
at cucumber.api.cli.Main.run(Main.java:36)
at cucumber.api.cli.Main.main(Main.java:18)



why am i getting this error.


Your ghekin step matches two java stepdefs and Cucumber doesn't know which one to pick.
 
it clearly states that one is pointing to I_Create_OME_App() and other one to  I_Create_OME_Application(DataTable)
and the scenario step is also different.

Can someone please help me in this.

Thanks
Vinoth

--
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.

Vinoth Kannan

unread,
Jul 13, 2016, 3:48:57 PM7/13/16
to Cukes
yeah i got it but the java method names are different and the cucumber steps are also different

----------------------------------------------------------------------------------------------------------------
Given I create a OME application with the below table
|   Fields       |    Values       |
| UserName |  admin |

this is one cucumber step 
---------------------------------------------------------------------------------------------------------------------------------------------------------
and the other one is below 
#@CreateAppOME
#Scenario: create a SMB application in OME
#Given I create a OME application

--------------------------------------------------------------------------------------------------------------------------------------------------------


java method 1:

@Given("I create a OME application with the below table")
public void I_Create_OME_Application(DataTable table) throws InterruptedException{


--------------------------------------------------------------------------------------------------------------------------------------------------------------

java method 2:


@Given("I create a OME application")
public void I_Create_OME_App() throws InterruptedException{

-------------------------------------------------------------------------------------------------------------------------------------------------------------


 

Tim Walker

unread,
Jul 13, 2016, 3:57:03 PM7/13/16
to cu...@googlegroups.com

On Jul 13, 2016 14:49, "Vinoth Kannan" <vinothk...@gmail.com> wrote:
>>
>> yeah i got it but the java method names are different and the cucumber steps are also different
>
>
> ----------------------------------------------------------------------------------------------------------------
> Given I create a OME application with the below table
> |   Fields       |    Values       |
> | UserName |  admin |
>
> this is one cucumber step 
> ---------------------------------------------------------------------------------------------------------------------------------------------------------
> and the other one is below 
> #@CreateAppOME
> #Scenario: create a SMB application in OME
> #Given I create a OME application
>
> --------------------------------------------------------------------------------------------------------------------------------------------------------
>
>
> java method 1:
>
> @Given("I create a OME application with the below table")
> public void I_Create_OME_Application(DataTable table) throws InterruptedException{
>
>
> --------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> java method 2:

Try putting a $ in your Regex at the end to mark the end of line anchor.

Tim


>
> @Given("I create a OME application")
> public void I_Create_OME_App() throws InterruptedException{
>
> -------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>
>  
>

Reply all
Reply to author
Forward
0 new messages