Search code examples
seleniumcucumbercucumber-jvm

Duplicate Step definition in cucumber


Why cucumber compares same method and gives error as duplicate step definitions

cucumber.runtime.DuplicateStepDefinitionException: Duplicate step definitions in stepDefinitions.LogIn.SDLogin.inputUserCredentials() in file:/Users/nagarjunareddy/Documents/projectworkspace/eclipse/s360UIAutomationCC/target/classes/ and stepDefinitions.LogIn.SDLogin.inputUserCredentials() in file:/Users/nagarjunareddy/Documents/projectworkspace/eclipse/s360UIAutomationCC/target/classes/ project structurenavigation feature fileenter image description here enter image description here


Solution

  • glue={"helpers","stepDefinitions"} instead of glue={"helpers","classpath/stepDefinitions", "classpath/stepDefinitions.LogIn","classpath/stepDefinitions.Publish"}

    Refer this link Same issue on Github