Skip to content

Commit

Permalink
Merge pull request #73 from YamStranger/webdriver_open_during_rest_fix
Browse files Browse the repository at this point in the history
Fixed issue with browser when rest is used
  • Loading branch information
YamStranger committed Apr 19, 2016
2 parents 3919529 + 65abdec commit d3ea853
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 d3ea853

Please sign in to comment.