@@ -29,12 +29,6 @@ class ActionsInDifferentModulesSuite extends \Codeception\GroupObject
2929 private $testCount = 1;
3030 private $preconditionFailure = null;
3131 private $currentTestRun = 0;
32- /**
33- * Remote Web Driver
34- *
35- * @var RemoteWebDriver
36- */
37- private $remoteWebDriver = null;
3832 private static $HOOK_EXECUTION_INIT = "\n/******** Beginning execution of ActionsInDifferentModulesSuite suite %s block ********/\n";
3933 private static $HOOK_EXECUTION_END = "\n/******** Execution of ActionsInDifferentModulesSuite suite %s block complete ********/\n";
4034 /** @var MagentoWebDriver */
@@ -204,12 +198,16 @@ class ActionsInDifferentModulesSuite extends \Codeception\GroupObject
204198 );
205199 $availableSessions = RemoteWebDriver::getAllSessions($wdHost);
206200 foreach ($availableSessions as $session) {
207- // Create an instance of ChromeOptions:
208- $chromeOptions = new ChromeOptions();
209- $capabilities = DesiredCapabilities::chrome();
210- $remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost,
211- $webDriverConfig['connection_timeout'], $webDriverConfig['request_timeout'], true, $capabilities);
212- $remoteWebDriver->quit();
201+ try {
202+ $chromeOptions = new ChromeOptions();
203+ $capabilities = DesiredCapabilities::chrome();
204+ $remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost,
205+ $webDriverConfig['connection_timeout'], $webDriverConfig['request_timeout'], true, $capabilities);
206+ $remoteWebDriver->quit();
207+ } catch (\Exception $exception) {
208+ print("Failed trying to quit WebDriver session. Exception message: " . $exception->getMessage() . " Test execution will continue." . PHP_EOL);
209+ // Session already closed so nothing to do
210+ }
213211 }
214212 }
215213 }
0 commit comments