Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test class not found in selected project #434

Open
utkarssh01 opened this issue May 29, 2021 · 3 comments
Open

Test class not found in selected project #434

utkarssh01 opened this issue May 29, 2021 · 3 comments

Comments

@utkarssh01
Copy link

utkarssh01 commented May 29, 2021

Issue:
Test class not found in selected project

Steps to recreate:

  1. Create a cucumber feature file.
  2. Create a Step Definitions file
  3. Create a Runner test file using Junit

But when I run the Runner file , it shows all tests are passed but when I click on any of the test it shows the error "Test class not found in selected project".
image

For example Below is my feature file:
Feature: Select Site
<<<
In order to Tableau select site
As a user
I want to choose a Tableau Site to generate reports

Scenario Outline: Verify if Tableau allows user to select a Site
Given user navigates to Tableau Site Page
When user validates the homepage title
Then user will click on search box
And user will enter the search string
| |
Then user user will select the site
| |
And user will successfully reach to home page
Examples:
| searchSite | selectSite |
| Test1 | Test1 |

Below is my Step Definition file for the same
<<<
package StepDefinitions;

import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;

public class SelectSiteStep
{
@given("^user navigates to Tableau Site Page$")
public void user_navigates_to_tableau_site_page() throws Throwable{
// Write code here that turns the phrase above into concrete actions
System.out.println("user navigates to Tableau Site page");
}

@Then("^user will click on search box$")
public void user_will_click_on_search_box() throws Throwable{
    // Write code here that turns the phrase above into concrete actions
	System.out.println("user will click on search box");
}

@Then("^user will senter the search string$")
public void user_will_senter_the_search_string(String searchSite) throws Throwable{
	System.out.println("user will senter the search string "+searchSite);
}

@Then("^user user will select the site$")
public void user_user_will_select_the_site(String selectSite) throws Throwable{
	System.out.println("user user will select the site "+selectSite);
}

@Then("^user will succesfully reach to home page$")
public void user_will_succesfully_reach_to_home_page() throws Throwable{
    // Write code here that turns the phrase above into concrete actions

}

}

Below is my Test runner file
<<<
package com.web.automation.base;

import org.junit.runner.RunWith;

import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;

@RunWith(Cucumber.class)
@CucumberOptions
(
features = {"src/test/java/Features"},
glue = {"StepDefinitions"},
monochrome = true,
plugin={"junit:reports/junit/reports.xml",
"pretty:target/cucumber-pretty.text",
"html:target/cucumber-html-report",
"json:target/cucumber.json",
"usage:target/cucumber-usage.json",}

)
public class TestRunner
{

}

Please let me know why I'm seeing that error "Test class not found in selected project".

@aslakhellesoy
Copy link
Contributor

Can you please surround your code with triple bacticks (fenced code blocks)? I find this too hard to read.

@aslakhellesoy aslakhellesoy transferred this issue from cucumber/common May 29, 2021
@mohdAslah
Copy link

Hi @aslakhellesoy

I am new learner and also getting the same issue, not able to resolve. Please help me out

@Rakesh993
Copy link

I am also getting the same issue if someone could help it would be great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants