How can I use same step from step definition for 2 feature file

24 Views Asked by At
eg 
Home.feature
Given User is in the website Landing page


Search.feature
Given User is in the website Landing page

Given User is in the website Landing page is the HomeSteps.java step file

here is the step file:

@Given("User is in the Home page")
    public void user_is_in_the_home_page() {
        driver = DriverFactory.getDriver();
        homePage = new HomePage(driver);
    }

an error : java.lang.IllegalArgumentException: Input must be set is thrown

how to fix this? or is there a way to create a common file for step definition that connects 2 or more feature?

0

There are 0 best solutions below