Question

We're using Gherkin, Cucumber-jvm and Webdriver to run acceptance tests against a standard Java/Spring webapp. The issue is that, when running the tests using a Maven job, the tests completely successfully but the job does not complete. Only on closing of the Firefox window does the job complete.

We have a workaround of closing the browser explicitly after each feature, but this will quickly become unsustainable due to time lag.

The tech stack is as follows:

Cucumber-JVM 1.0.4

Selenium 2.12.0

Firefox 8.0

The app runs in JBoss EAP 5.1 on a Windows 7 machine.

When we used the JRuby version of Cucumber, this behaviour did not appear with the above selenium/firefox combination, although it did when we used higher versions of either.

Has anyone seen this behaviour before, and does anyone have any suggestions or workarounds?

Thanks in advance

Était-ce utile?

La solution

Do you close your WebDriver?

@cucumber.annotation.After
public void afterScenarioRun() {
    driver.close();
}

Autres conseils

I use Cucumber and Selenium in a spring environment (with cucumber-spring). When the WebDriver is managed by Spring, you can add destroy="close" to the bean defintion:

<bean id="webDriver" class="org.openqa.selenium.ie.InternetExplorerDriver" destroy-method="close"/>

This closes the browser after all tests have finished.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top