diff --git a/lib/appium_lib/driver.rb b/lib/appium_lib/driver.rb index ae8f2b8f..a2736fb3 100644 --- a/lib/appium_lib/driver.rb +++ b/lib/appium_lib/driver.rb @@ -476,7 +476,9 @@ def automation_name_is_xcuitest? # If the Appium server is under REQUIRED_VERSION_XCUITEST, then error is raised. # @return [Boolean] def check_server_version_xcuitest - if automation_name_is_xcuitest? && (@appium_server_status['build']['version'] < REQUIRED_VERSION_XCUITEST) + if automation_name_is_xcuitest? && + !@appium_server_status.empty? && + (@appium_server_status['build']['version'] < REQUIRED_VERSION_XCUITEST) raise Appium::Error::NotSupportedAppiumServer, "XCUITest requires Appium version >= #{REQUIRED_VERSION_XCUITEST}" end true @@ -496,6 +498,10 @@ def check_server_version_xcuitest # @return [Hash] def appium_server_version driver.remote_status + rescue Selenium::WebDriver::Error::WebDriverError => ex + raise unless ex.message.include?('content-type=""') + # server (TestObject for instance) does not respond to status call + {} end # Returns the client's version info