0
votes

I am trying to run a basic cucumber feature file via JAVA ECLIPSE on my MacBook and getting this java.lang.IllegalArgumentException error .

Following steps are taken care.

  1. Added the dependencies
  2. Created a Maven project
  3. Created a feature file
  4. Created a Runner Class
  5. Created a Step Definition class

Trying to run the feature file so that I will get the implementation steps as part of errors in consolidating so that I can use the same in the step definition file.

Feature file : Feature: POC on gmail Login Page

  Scenario: gmail login test
    Given User navigated to gmail Login page
    When User enter the Loginid
    And User enter Password for gmail
    And User click on Login button
    Then Verification Page Displayed
    Then Inbox page is displayed

Error in detail:

Exception in thread "main" java.lang.IllegalArgumentException: Not a file or directory: /Users/civakalyan/Documents/Java Eclipse/FIrstCucumberMavenProject/--plugin at cucumber.runtime.io.FileResourceIterator$FileIterator.(FileResourceIterator.java:54) at cucumber.runtime.io.FileResourceIterator.(FileResourceIterator.java:20) at cucumber.runtime.io.FileResourceIterable.iterator(FileResourceIterable.java:19) at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:38) at cucumber.runtime.RuntimeOptions.cucumberFeatures(RuntimeOptions.java:117) at cucumber.runtime.Runtime.run(Runtime.java:92) at cucumber.api.cli.Main.run(Main.java:20) at cucumber.api.cli.Main.main(Main.java:12)

1
can you share you runner class code? - Murthi
Hi Murthi , Thanks for the reply please find the code for my runner class. package MyFIrstCucumberMavenProject.FIrstCucumberMavenProject; import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; @RunWith(Cucumber.class) @CucumberOptions( features = "src/test/resource/", glue = {"src/test/resource/"} ) public class gmailRunnerTest { } - civakalyan
Which folder you are keeping step definitions class file? Glue path should be your step definitions package path. - Murthi

1 Answers

1
votes

U have to build the path etc, restart eclipse. Try making a new Fresh Project with the same feature file and run it. it worked for me , however still looking for a better solution