Method: Appium::Core::Driver#appium_server_version

Defined in:
lib/appium_lib_core/driver.rb

#appium_server_versionHash

Returns the server’s version info. This method calls driver.remote_status internally

Returns blank hash in a case driver.remote_status got an error such as Selenium Grid. It returns 500 error against ‘remote_status’.

Examples:


@core.appium_server_version
  {
      "build" => {
          "version" => "1.9.2",
          "git-sha" => "fd7c7fd19d3896719616cd970229d73e63b5271a",
          "built" => "2018-11-08 12:24:02 +0900"
      }
  }

@core.appium_server_version #=> {}

Returns:

  • (Hash)

517
518
519
520
521
522
523
524
525
# File 'lib/appium_lib_core/driver.rb', line 517

def appium_server_version
  return {} if @driver.nil?

  @driver.remote_status
rescue StandardError
  # Ignore error case in a case the target appium server
  # does not support `/status` API.
  {}
end