Already tried almost all solutions which are on SO but still missing something here.
I have created simple JAVA program, Added Feature file and Class for cucumber. When I run I am getting output :
@Search Scenario Outline: Successful Open Google.com [90m# Open_Google.feature:4[0m [36mGiven [0m[36mUser is with blank page[0m [36mWhen [0m[36mUser enter URL[0m [36mThen [0m[36mGoogle WebSite should open[0m
0 Scenarios
0 Steps
0m0.000s
Feature File :
Feature: Open Google WebSite
@Search
Scenario Outline: Successful Open Google.com
Given User is with blank page
When User enter URL
Then Google WebSite should open
Test Runner Class :
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(
features = "Feature"
)
public class TestRunner {
}
Test Case Class :
public class cucumber_test {
public static WebDriver driver;
public static void main(String[] args) {
// TODO Auto-generated method stub
System.setProperty("webdriver.chrome.driver", "D:\\chromedriver.exe");
driver = new ChromeDriver();
driver.get("http://www.google.com");
driver.manage().window().maximize();
System.out.println("Google open successfully");
}
}
Using Selenium Webdriver, JAVA, Junit and cucumber.
Also Am I doing right? Is it correct method to use cucumber?