Search code examples
javaselenium-webdrivercucumbercucumber-java

How to link setpDefication and feature file in cucumber is not working


I'm new to Cucumber jJava and had this problem in the initial stages. I'm using the MAVEN project.

I have created a feature file, stepDefination file, and Test Runner file. In the feature file, I have mentioned some scenarios and step definition files, write Selenium Java code, and the last TestRunner class I have created and mentioned codes.

enter image description here


Solution

  • Check what Given, When, Then annotations you are using, whether it matches the correct cucumber version and library or not. According to your attached screenshot, your Given, When, Then annotations should be from the cucumber.api package and not from the io.cucumber package.