Selenium opening two browsers even I instantiating only one

1

Galera,

I'm using Cucumber with Selenium in JAVA. I have the following problem: at each step I do:

private WebDriver driver;
@Before
public void before(){
   driver = new FirefoxDriver();
}

@Given("^something$)
public void someGivenMehtod(){...}
@When("^anotherThing$)
public void someWhenMethod(){...}
@Then("^conclusion$)
public void someThenMethod(){...}

@After
public void after(){
   driver.close();
}

However, I have 4 steps. At each step, two (2) Firefox instances are opened.

Could you tell me why this occurs?

Thank you.

My environment: Java 8, Firefox 47.0.1 plus maven follows:

<!-- SELENIUM -->
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>2.53.1</version>
        </dependency>

        <!-- SELENIUM: Fifefox WebDriver -->
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-firefox-driver</artifactId>
            <version>2.53.1</version>
        </dependency>

        <!-- SELENIUM: Chrome WebDriver -->
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-chrome-driver</artifactId>
            <version>2.53.1</version>
        </dependency>

        <!-- CUCUMBER -->

        <!-- CUCUMBER: Java -->

        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>1.2.4</version>
            <scope>test</scope>
        </dependency>

        <!-- CUCUMBER: Core -->
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-core</artifactId>
            <version>1.2.4</version>
        </dependency>

        <!-- CUCUMBER: JUnit -->
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>1.2.4</version>
        </dependency>

        <!-- CUCUMBER: JVM Deps -->
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-jvm-deps</artifactId>
            <version>1.0.5</version>
        </dependency>

        <!-- CUCUMBER: Reports -->
        <dependency>
            <groupId>net.masterthought</groupId>
            <artifactId>cucumber-reporting</artifactId>
            <version>2.5.0</version>
        </dependency>

        <!-- CUCUMBER: Gherkin -->
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>gherkin</artifactId>
            <version>2.12.2</version>
        </dependency>

        <!-- MOCKITO: All -->
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.10.19</version>
        </dependency>

        <!-- GOOGLE COBERTURA -->
        <dependency>
            <groupId>com.google.code.maven-play-plugin.net.sourceforge.cobertura</groupId>
            <artifactId>cobertura</artifactId>
            <version>1.9.2-patched-play-cobertura-1.0-jdk15</version>
        </dependency>

        <!-- SELENIUM: Firefox WebDriver -->
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-firefox-driver</artifactId>
            <version>2.53.1</version>
        </dependency>

        <!-- SELENIUM: Chrome WebDriver -->
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-chrome-driver</artifactId>
            <version>2.53.1</version>
        </dependency>

        <!-- JUnit -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
        </dependency>
    
asked by anonymous 26.07.2016 / 15:43

0 answers