Java 类org.openqa.selenium.remote.SessionNotFoundException 实例源码

项目:bootstrapium    文件:BaseTest.java   
@BeforeMethod(alwaysRun = true)
public static void clearSession() {
    if(requiresReset.get()) {
    try {
        if (DriverType.isNative()) {
            getDriver().getWrappedAppiumDriver().resetApp();
        } else {
            getDriver().manage().deleteAllCookies();
        }
    } catch (SessionNotFoundException e) {
        logger.error("Session quit unexpectedly.");
    }
    } else {
        requiresReset.set(Boolean.TRUE);
    }
}
项目:galen-api-ports    文件:DriversPool.java   
public WebDriver getBySessionId(String sessionId) throws SessionNotFoundException {
    for (WebDriver driver : driversPool) {
        if (driver instanceof RemoteWebDriver) {
            if (((RemoteWebDriver) driver).getSessionId().toString().equals(sessionId)) {
                return driver;
            }
        }
    }
    throw new SessionNotFoundException(format("Driver with session id %s has never been created", sessionId));
}
项目:grid-refactor-remote-server    文件:ResultConfig.java   
private void throwUpIfSessionTerminated(SessionId sessId) throws SessionNotFoundException {
  if (sessId == null) return;
  Session session = sessions.get(sessId);
  final boolean isTerminated = session == null;
  if (isTerminated){
    throw new SessionNotFoundException();
  }
}