Skip to content

Commit 5e67b88

Browse files
titusfortnerKazuCocoa
authored andcommitted
allow using TestObject server (#538)
1 parent 9fdf89f commit 5e67b88

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/appium_lib/driver.rb

+7-1
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,9 @@ def automation_name_is_xcuitest?
476476
# If the Appium server is under REQUIRED_VERSION_XCUITEST, then error is raised.
477477
# @return [Boolean]
478478
def check_server_version_xcuitest
479-
if automation_name_is_xcuitest? && (@appium_server_status['build']['version'] < REQUIRED_VERSION_XCUITEST)
479+
if automation_name_is_xcuitest? &&
480+
!@appium_server_status.empty? &&
481+
(@appium_server_status['build']['version'] < REQUIRED_VERSION_XCUITEST)
480482
raise Appium::Error::NotSupportedAppiumServer, "XCUITest requires Appium version >= #{REQUIRED_VERSION_XCUITEST}"
481483
end
482484
true
@@ -496,6 +498,10 @@ def check_server_version_xcuitest
496498
# @return [Hash]
497499
def appium_server_version
498500
driver.remote_status
501+
rescue Selenium::WebDriver::Error::WebDriverError => ex
502+
raise unless ex.message.include?('content-type=""')
503+
# server (TestObject for instance) does not respond to status call
504+
{}
499505
end
500506

501507
# Returns the client's version info

0 commit comments

Comments
 (0)