Skip to content

Commit

Permalink
fix: updated isAlive implementation to work with appium
Browse files Browse the repository at this point in the history
  • Loading branch information
YamStranger committed May 11, 2016
1 parent fab8b79 commit b902c2e
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -793,12 +793,19 @@ public Duration getDefaultImplicitTimeout() {

public static boolean isAlive(final WebDriver driver) {
try {
driver.getCurrentUrl();
WebDriver local = driver;
if(driver instanceof WebDriverFacade){
local = ((WebDriverFacade)driver).getDriverInstance();
}
if(!(local instanceof AppiumDriver)){
local.getCurrentUrl();
}
} catch (Exception e) {
return false;
}
return true;
}

public static boolean isNotAlive(final WebDriver driver){
return !isAlive(driver);
}
Expand Down

0 comments on commit b902c2e

Please sign in to comment.