In eclipse cucumber is not recognising implemented feature Says steps missing Attached screenshot of project folder i am badly stuck for 3 days please help | Selenium Training|Java|WebDriver|TestNG|Frameworks|Videos
10% May Month Discount Avail now

Selenium Training Forum

In eclipse cucumber is not recognising implemented feature Says steps missing Attached screenshot of project folder i am badly stuck for 3 days please help

S
Sapna Post on 04/03/2019

My feature file:

@LoginTest
Feature: Login Functionality Test
I want to test the login functionality on the http://the-internet.herokuapp.com/login page

@LoginSuccess
Scenario: Login with valid username and password
Given I have username as tomsmith and Password as YYYY
When I click on Submit Button
Then I am able to login on the page with no error

 

My StepDefiniton:

package com.CCQA.com;

import java.util.List;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

import cucumber.api.PendingException;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;


public class StepDef
{
//WebDriver driver;
//WebDriverWait wait = new WebDriverWait(driver,30);


@Given("I have username as tomsmith and Password as YYYY")
public void i_have_username_as_tomsmith_and_Password_as_SuperSecretPassword()
{
System.out.println("hello");

}
@When("^I click on Submit Button$")
public void clickSubmitButton()
{
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//button[@type='submit']"))).click();
}

@Then("^I am able to login on the page with no error$")
public void ValidateLogin()
{
List<WebElement> ele = wait.until(ExpectedConditions.visibilityOfAllElementsLocatedBy(By.xpath("//a[@i='Logout']")));
if(ele.size()>0)
System.out.println("Login Successful");
else
System.out.println("Login Failed");
}

 

My testrunner:

package com.CCQA.com;


import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
@CucumberOptions(
plugin = {"pretty", "html:target/cucumber"},
features = {"src/test/resources"},
glue = {"com.CCQATEST.com"},
monochrome = true,
tags = {"@LoginSuccess"}
)


public class TestRunner{

}

 

D

Instructor

Demo Reply on 12/03/2019

Please share your project in a compressed zip file.

 

Additionally, i noticed that there are some issues in StedDef class.