Skip to content

Commit

Permalink
feat: fixed issue with browser when rest is used
Browse files Browse the repository at this point in the history
Fixed bug for JBehave when non web test executed browsers opens because of check if
it is alive
  • Loading branch information
YamStranger committed Apr 19, 2016
1 parent 3919529 commit 65abdec
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main/java/net/serenitybdd/jbehave/SerenityReporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import net.thucydides.core.util.NameConverter;
import net.thucydides.core.webdriver.Configuration;
import net.thucydides.core.webdriver.ThucydidesWebDriverSupport;
import net.thucydides.core.webdriver.WebDriverFacade;
import net.thucydides.core.webdriver.WebdriverProxyFactory;
import org.codehaus.plexus.util.StringUtils;
import org.jbehave.core.configuration.Keywords;
Expand Down Expand Up @@ -211,10 +212,12 @@ public void beforeScenario(String scenarioTitle) {
}

private boolean managedDriverIsNotAlive() {
try {
ThucydidesWebDriverSupport.getDriver().getTitle();
} catch (Exception e) {
return true;
if(((WebDriverFacade)ThucydidesWebDriverSupport.getDriver()).isInstantiated()) {
try {
ThucydidesWebDriverSupport.getDriver().getTitle();
} catch (Exception e) {
return true;
}
}
return false;
}
Expand Down

0 comments on commit 65abdec

Please sign in to comment.