Why is my Cucumber code in eclipse skipping the actual test?

51
February 13, 2018, at 4:41 PM

I wrote some code for cucumber in eclipse to open a website, input username password and get confirmation. But for some reason, every time I run it, it’s just giving me a message on the console saying that the site is open, username and pw is entered and user got confirmation. But nothing’s really happening on the screen. The chrome web driver is not opening at all for any of the steps to even execute and still I am getting a Junit message saying that the test passed.

Why is my code skipping the browser launch? It seems like it’s skipping everything since I am not getting any errors at all.

My Glue Code is as follows.

    package stepImplementations;
    import org.openqa.selenium.By;
    import org.openqa.selenium.WebDriver;
    import cucumber.api.java.en.Given;
    import cucumber.api.java.en.Then;
    import cucumber.api.java.en.When;
    public class BDDLoginTest {
    WebDriver driver;
//Given user is on the login page
@Given("^user is on the login page$")
public void user_is_on_the_login_page () { 
    //open driver 
    driver = utilities.DriverFactory.open("firefox");
    driver.get("http://sdettraining.com/trguitransactions/AccountManagement.aspx");
}

//When user enters correct username and correct password
@When ("^user enters correct username and correct password$")
public void user_enters_correct_username_and_password () { 
    driver.findElement(By.name("ctl00$MainContent$txtUserName")).sendKeys("tim@testemail.com");
    driver.findElement(By.name("ctl00$MainContent$txtPassword")).sendKeys("trpass");
    driver.findElement(By.name("ctl00$MainContent$btnLogin")).click();      
}

//Then user gets confirmation
@Then("^user gets confirmation$")
public void user_gets_confirmation () { 
}

Test Runner

    package cucumberTests;
    import org.junit.runner.RunWith;
    import cucumber.api.CucumberOptions;
    import cucumber.api.junit.Cucumber;
    @RunWith(Cucumber.class)
    @CucumberOptions(features="features",glue="stepImplementations")
    public class LoginTestRunner {
    }

This is what my console says [ It is not opening website or even giving an error for not opening the website ]

    User is on the Login Page
    User enters username and password
    User gets confirmation
    1 Scenarios ([32m1 passed[0m)
    3 Steps ([32m3 passed[0m)
    0m0.097s

READ ALSO
Any command to install all missing files for maven project in .M2 folder?

Any command to install all missing files for maven project in .M2 folder?

My maven project environment was set up few months back in working condition and then I deleted my m2 folder to create a different set up of environment other projectNow, I am trying to access the maven project environment but so many dependency files missing...

80
How do I do coordination between multiple application instances?

How do I do coordination between multiple application instances?

Need help in deciding what frameworks I can use in this scenarioI'm exploring Zookeeper, but not completely sure on how to solution this usecase

90
Apache Curator NPE on serviceProvider.start()

Apache Curator NPE on serviceProvider.start()

I'm using Apache Curator discovery version 40

78
Is A New Object Instantiated Every Time This Loop Runs?

Is A New Object Instantiated Every Time This Loop Runs?

I was taking a Java test today and I got this weird question and I feel like I am right, but some of my classmates are saying another answer is rightThere was a basic class, a default constructor that initialized the instances, and some methods

49