diff --git a/lib/maze/hooks/appium_hooks.rb b/lib/maze/hooks/appium_hooks.rb index aca02ee68..02b5babb9 100644 --- a/lib/maze/hooks/appium_hooks.rb +++ b/lib/maze/hooks/appium_hooks.rb @@ -34,7 +34,7 @@ def after(scenario) # commands from the previous scenario (in idempotent mode). begin Maze.driver.terminate_app Maze.driver.app_id - rescue Selenium::WebDriver::Error::UnknownError + rescue Selenium::WebDriver::Error::UnknownError, Selenium::WebDriver::Error::InvalidSessionIdError if Maze.config.appium_version && Maze.config.appium_version.to_f < 2.0 $logger.warn 'terminate_app failed, using the slower but more forceful close_app instead' Maze.driver.close_app