Skip to content

Commit dad8507

Browse files
committed
Fixed exception on closing Browserstack session.
1 parent 82026ef commit dad8507

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

source/src/main/java/org/cerberus/core/engine/execution/impl/RobotServerService.java

+16-10
Original file line numberDiff line numberDiff line change
@@ -1180,16 +1180,22 @@ public boolean stopServer(TestCaseExecution tce) {
11801180

11811181
// We Stop the Robot Session (Selenium or Appium).
11821182
LOG.info("Stop execution robot session");
1183-
if (tce.getRobotProvider().equals(TestCaseExecution.ROBOTPROVIDER_KOBITON)) {
1184-
// For Kobiton, we should first close Appium session.
1185-
if (session.getAppiumDriver() != null) {
1186-
session.getAppiumDriver().close();
1187-
}
1188-
if (session.getDriver() != null) {
1189-
session.getDriver().quit();
1190-
}
1191-
} else {
1192-
session.quit();
1183+
switch (tce.getRobotProvider()) {
1184+
case TestCaseExecution.ROBOTPROVIDER_KOBITON:
1185+
if (session.getAppiumDriver() != null) {
1186+
session.getAppiumDriver().close();
1187+
}
1188+
if (session.getDriver() != null) {
1189+
session.getDriver().quit();
1190+
}
1191+
break;
1192+
case TestCaseExecution.ROBOTPROVIDER_BROWSERSTACK:
1193+
if (session.getDriver() != null) {
1194+
session.getDriver().quit();
1195+
}
1196+
break;
1197+
default:
1198+
session.quit();
11931199
}
11941200

11951201
return true;

0 commit comments

Comments
 (0)