Skip to main content
formatting
Source Link
Bharat Mane
  • 6.8k
  • 11
  • 41
  • 69

This error clearly says that "Not a file or directory" which means the path is not correct. I assume that the feature files can be at the two places only:

  1. With in the src folder or src sub-folders.
  2. Outside the src folder, which means you keep your features files in some folder in the project but outside src package.

In the first case you should specify your CucumberOptions as below:

@RunWith(Cucumber.class)
@CucumberOptions(
        features = "src/somefolder/Feature"

In the second case:

@RunWith(Cucumber.class)
@CucumberOptions(
        features = "Feature")

Look at the example of second case here http://toolsqacase here.com/cucumber/first-cucumber-selenium-java-test/

This error clearly says that "Not a file or directory" which means the path is not correct. I assume that the feature files can be at the two places only:

  1. With in the src folder or src sub-folders.
  2. Outside the src folder, which means you keep your features files in some folder in the project but outside src package.

In the first case you should specify your CucumberOptions as below:

@RunWith(Cucumber.class)
@CucumberOptions(
        features = "src/somefolder/Feature"

In the second case:

@RunWith(Cucumber.class)
@CucumberOptions(
        features = "Feature")

Look at the example of second case here http://toolsqa.com/cucumber/first-cucumber-selenium-java-test/

This error clearly says that "Not a file or directory" which means the path is not correct. I assume that the feature files can be at the two places only:

  1. With in the src folder or src sub-folders.
  2. Outside the src folder, which means you keep your features files in some folder in the project but outside src package.

In the first case you should specify your CucumberOptions as below:

@RunWith(Cucumber.class)
@CucumberOptions(
        features = "src/somefolder/Feature"

In the second case:

@RunWith(Cucumber.class)
@CucumberOptions(
        features = "Feature")

Look at the example of second case here.

Source Link

This error clearly says that "Not a file or directory" which means the path is not correct. I assume that the feature files can be at the two places only:

  1. With in the src folder or src sub-folders.
  2. Outside the src folder, which means you keep your features files in some folder in the project but outside src package.

In the first case you should specify your CucumberOptions as below:

@RunWith(Cucumber.class)
@CucumberOptions(
        features = "src/somefolder/Feature"

In the second case:

@RunWith(Cucumber.class)
@CucumberOptions(
        features = "Feature")

Look at the example of second case here http://toolsqa.com/cucumber/first-cucumber-selenium-java-test/