RE: Error – Test class not found in selected project in cucumber

I am new to cucumber. I followed your whole cucumber tutorial step by step. I f I run the selenium test it runs successfully. But When I run TestRunner class, it shows this error for Login Functionality, when double clicked.

For code, its same whats on your website. Please help …

RE: Error - Test class not found in selected project in cucumber

Add Comment
4 Answers


Please find below the codes for festures file , step definition & test runner file.

feature file

Feature: Login Action
Scenario: Successful Login with Valid Credentials

Given User is on Home Page

When User Navigate to LogIn Page

And User enters UserName and Password

Then Message displayed Login Successfully
Scenario: Successful LogOut

When User LogOut from the Application

Then Message displayed LogOut Successfully

Step Definition

package stepDefinition;
import java.util.concurrent.TimeUnit;
import org.junit.rules.Timeout;

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.firefox.FirefoxDriver;
import cucumber.api.PendingException;



public class Test_Steps


public static WebDriver driver;
@Given("^User is on Home Page$")

public void user_is_on_Home_Page() throws Throwable


driver = new FirefoxDriver();




throw new PendingException();

@When("^User Navigate to LogIn Page$")

public void user_Navigate_to_LogIn_Page() throws Throwable



throw new PendingException();

@When("^User enters UserName and Password$")

public void user_enters_UserName_and_Password() throws Throwable





throw new PendingException();

@Then("^Message displayed Login Successfully$")

public void message_displayed_Login_Successfully() throws Throwable


System.out.println("Login Successfully");

throw new PendingException();

@When("^User LogOut from the Application$")

public void user_LogOut_from_the_Application() throws Throwable


driver.findElement (By.xpath(".//*[@id='account_logout']/a")).click();

throw new PendingException();

@Then("^Message displayed LogOut Successfully$")

public void message_displayed_LogOut_Successfully() throws Throwable


System.out.println("LogOut Successfully");


throw new PendingException();



Test Runner

package cucumberTest;
import org.junit.runner.RunWith;

import cucumber.api.CucumberOptions;

import cucumber.api.junit.Cucumber;


features = "Feature",

glue = {"stepDefinition"}

public class TestRunner {

Below hers is the link :


Train Answered on January 11, 2016.


I am also facing the same issue. Please let me know the solution.


Thanks and Regards,

Tanuja N

on June 5, 2018.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.