Skip to content

Commit

Permalink
Fixed exception on closing Browserstack session.
Browse files Browse the repository at this point in the history
  • Loading branch information
vertigo17 committed Dec 31, 2024
1 parent 82026ef commit dad8507
Showing 1 changed file with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1180,16 +1180,22 @@ public boolean stopServer(TestCaseExecution tce) {

// We Stop the Robot Session (Selenium or Appium).
LOG.info("Stop execution robot session");
if (tce.getRobotProvider().equals(TestCaseExecution.ROBOTPROVIDER_KOBITON)) {
// For Kobiton, we should first close Appium session.
if (session.getAppiumDriver() != null) {
session.getAppiumDriver().close();
}
if (session.getDriver() != null) {
session.getDriver().quit();
}
} else {
session.quit();
switch (tce.getRobotProvider()) {
case TestCaseExecution.ROBOTPROVIDER_KOBITON:
if (session.getAppiumDriver() != null) {
session.getAppiumDriver().close();
}
if (session.getDriver() != null) {
session.getDriver().quit();
}
break;
case TestCaseExecution.ROBOTPROVIDER_BROWSERSTACK:
if (session.getDriver() != null) {
session.getDriver().quit();
}
break;
default:
session.quit();
}

return true;
Expand Down

0 comments on commit dad8507

Please sign in to comment.