'Blank console upon trying to run cucumber feature file

I am trying to run a Cucumber feature file by Right Click > Run As > Feature File. But no action is triggered. Blank console output. What may be the case?

I have installed the following dependencies in pom.xml:

  1. Junit
  2. Cucumber-Java
  3. Cucumber-Junit

enter image description here



Solution 1:[1]

Your file structure has to meet certain conditions to let cucumber run everything smoothly.

  1. Put your feature file to resources folder
  2. You step definition file(s) has to reside at the same package as your runner class (or in sub-packages)
  3. Your feature file in resource folder has to be at the folder that reproduces package structure where your runner class is (or subfolders)

Say you have a package my.test.package where your runner class resides. That means that your feature file has to be under resources/my/test/package folder or its sub-folders. At the same time your step definition file has to be under my.test.package or its sub-packages.

Solution 2:[2]

Right click on feature file -> Run as -> Run Configurations -> Cucumber Feature -> select the feature file -> Run

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alexey R.
Solution 2 Rithesh B