##### [load_appium_txt](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L12) > def load_appium_txt opts Load appium.txt (toml format) into system ENV the basedir of this file + appium.txt is what's used __Parameters:__      [Hash] opts - file: '/path/to/appium.txt', verbose: true __Returns:__      [nil] -- ##### [default_wait](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L346) > def default_wait Returns the default client side wait. This value is independent of what the server is using __Returns:__      [Integer] -- ##### [app_path](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L87) > def app_path Returns the value of attribute app_path -- ##### [app_name](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L87) > def app_name Returns the value of attribute app_name -- ##### [selendroid](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L87) > def selendroid Returns the value of attribute selendroid -- ##### [app_package](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L87) > def app_package Returns the value of attribute app_package -- ##### [app_activity](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L87) > def app_activity Returns the value of attribute app_activity -- ##### [app_wait_activity](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L87) > def app_wait_activity Returns the value of attribute app_wait_activity -- ##### [sauce_username](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L87) > def sauce_username Returns the value of attribute sauce_username -- ##### [sauce_access_key](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L87) > def sauce_access_key Returns the value of attribute sauce_access_key -- ##### [port](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L87) > def port Returns the value of attribute port -- ##### [os](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L87) > def os Returns the value of attribute os -- ##### [debug](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L87) > def debug Returns the value of attribute debug -- ##### [initialize](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L117) > def initialize opts={} Creates a new driver. ```ruby # Options include: :app_path, :app_name, :app_package, :app_activity, :app_wait_activity, :sauce_username, :sauce_access_key, :port, :os, :debug require 'rubygems' require 'appium_lib' # Start iOS driver app = { app_path: '/path/to/MyiOS.app'} Appium::Driver.new(app).start_driver # Start Android driver apk = { app_path: '/path/to/the.apk', app_package: 'com.example.pkg', app_activity: 'act.Start', app_wait_activity: 'act.Start' } Appium::Driver.new(apk).start_driver ``` __Parameters:__      [Object] opts - A hash containing various options. __Returns:__      [Driver] -- ##### [status](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L204) > def status Returns the status payload -- ##### [server_version](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L210) > def server_version Returns the server's version string __Returns:__      [String] -- ##### [absolute_app_path](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L251) > def absolute_app_path Converts environment variable APP_PATH to an absolute path. __Returns:__      [String] APP_PATH as an absolute path -- ##### [server_url](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L267) > def server_url Get the server url for sauce or local based on env vars. __Returns:__      [String] the server url -- ##### [restart](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L277) > def restart Restarts the driver __Returns:__      [Driver] the driver -- ##### [driver](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L284) > def driver Returns the driver __Returns:__      [Driver] the driver -- ##### [screenshot](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L294) > def screenshot png_save_path Takes a png screenshot and saves to the target path. Example: screenshot '/tmp/hi.png' __Parameters:__      [String] png_save_path - the full path to save the png __Returns:__      [void] -- ##### [driver_quit](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L300) > def driver_quit Quits the driver __Returns:__      [void] -- ##### [start_driver](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L308) > def start_driver Creates a new global driver and quits the old one if it exists. __Returns:__      [Selenium::WebDriver] the new global driver -- ##### [no_wait](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L332) > def no_wait Set implicit wait to zero. -- ##### [set_wait](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L339) > def set_wait timeout=@default_wait Set implicit wait to timeout, defaults to 30. __Parameters:__      [Integer] timeout - the timeout in seconds __Returns:__      [void] -- ##### [exists](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L362) > def exists pre_check=0, post_check=@default_wait, &search_block Returns existence of element. Example: exists { button('sign in') } ? puts('true') : puts('false') __Parameters:__      [Integer] pre_check - the amount in seconds to set the wait to before checking existance      [Integer] post_check - the amount in seconds to set the wait to after checking existance      [Block] search_block - the block to call __Returns:__      [Boolean] -- ##### [execute_script](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L384) > def execute_script script, *args The same as @driver.execute_script __Parameters:__      [String] script - the script to execute      [*args] args - the args to pass to the script __Returns:__      [Object] -- ##### [mobile](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L400) > def mobile method, *args Helper method for mobile gestures https://github.com/appium/appium/wiki/Automating-mobile-gestures driver.execute_script 'mobile: swipe', endX: 100, endY: 100, duration: 0.01 becomes mobile :swipe, endX: 100, endY: 100, duration: 0.01 __Parameters:__      [String, Symbol] method - the method to execute      [*args] args - the args to pass to the method __Returns:__      [Object] -- ##### [find_elements](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L411) > def find_elements *args Calls @driver.find_elements __Parameters:__      [*args] args - the args to use __Returns:__      [Array] Array is empty when no elements are found. -- ##### [find_element](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L419) > def find_element *args Calls @driver.find_elements __Parameters:__      [*args] args - the args to use __Returns:__      [Element] -- ##### [x](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/driver.rb#L426) > def x Quit the driver and Pry. quit and exit are reserved by Pry. __Returns:__      [void] -- ##### [wait](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/helper.rb#L33) > def wait max_wait=30, interval=0.5, &block Check every 0.5 seconds to see if block.call doesn't raise an exception. if .call raises an exception then it will be tried again. if .call doesn't raise an exception then it will stop waiting. Example: wait { name('back').click } Give up after 30 seconds. __Parameters:__      [Integer] max_wait - the maximum time in seconds to wait for. Note that max wait 0 means infinity.      [Float] interval - the time in seconds to wait after calling the block      [Block] block - the block to call __Returns:__      [Object] the result of block.call -- ##### [ignore](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/helper.rb#L45) > def ignore &block Return block.call and ignore any exceptions. -- ##### [wait_true](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/helper.rb#L55) > def wait_true max_wait=30, interval=0.5, &block Check every 0.5 seconds to see if block.call returns true. nil is considered a failure. Give up after 30 seconds. __Parameters:__      [Integer] max_wait - the maximum time in seconds to wait for      [Float] interval - the time in seconds to wait after calling the block      [Block] block - the block to call __Returns:__      [Object] the result of block.call -- ##### [id](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/helper.rb#L69) > def id id Find by id. Useful for selendroid __Parameters:__      [String] id - the id to search for __Returns:__      [Element] -- ##### [back](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/helper.rb#L75) > def back Navigate back. __Returns:__      [void] -- ##### [session_id](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/helper.rb#L80) > def session_id For Sauce Labs reporting. Returns the current session id. -- ##### [xpath](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/helper.rb#L88) > def xpath xpath_str Returns the first element that matches the provided xpath. __Parameters:__      [String] xpath_str - the XPath string __Returns:__      [Element] -- ##### [xpaths](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/helper.rb#L96) > def xpaths xpath_str Returns all elements that match the provided xpath. __Parameters:__      [String] xpath_str - the XPath string __Returns:__      [Array] -- ##### [ele_index](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/helper.rb#L104) > def ele_index tag_name, index Get the element of type tag_name at matching index. __Parameters:__      [String] tag_name - the tag name to find      [Integer] index - the index __Returns:__      [Element] the found element of type tag_name -- ##### [find_eles](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/helper.rb#L112) > def find_eles tag_name Get all elements exactly matching tag name __Parameters:__      [String] tag_name - the tag name to find __Returns:__      [Array] the found elements of type tag_name -- ##### [find_ele_by_text](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/helper.rb#L120) > def find_ele_by_text tag, text Get the first tag that exactly matches tag and text. __Parameters:__      [String] tag - the tag name to match      [String] text - the text to exactly match __Returns:__      [Element] the element of type tag exactly matching text -- ##### [find_eles_by_text](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/helper.rb#L128) > def find_eles_by_text tag, text Get all tags that exactly match tag and text. __Parameters:__      [String] tag - the tag name to match      [String] text - the text to exactly match __Returns:__      [Array] the elements of type tag exactly matching text -- ##### [find_ele_by_attr_include](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/helper.rb#L137) > def find_ele_by_attr_include tag, attr, value Get the first tag by attribute that exactly matches value. __Parameters:__      [String] tag - the tag name to match      [String] attr - the attribute to compare      [String] value - the value of the attribute that the element must include __Returns:__      [Element] the element of type tag who's attribute includes value -- ##### [find_eles_by_attr_include](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/helper.rb#L146) > def find_eles_by_attr_include tag, attr, value Get tags by attribute that include value. __Parameters:__      [String] tag - the tag name to match      [String] attr - the attribute to compare      [String] value - the value of the attribute that the element must include __Returns:__      [Array] the elements of type tag who's attribute includes value -- ##### [find_ele_by_text_include](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/helper.rb#L155) > def find_ele_by_text_include tag, text Get the first tag that includes text. element.attribute(:text).include? text __Parameters:__      [String] tag - the tag name to match      [String] text - the text the element must include __Returns:__      [Element] the element of type tag that includes text -- ##### [find_eles_by_text_include](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/helper.rb#L164) > def find_eles_by_text_include tag, text Get the tags that include text. element.attribute(:text).include? text __Parameters:__      [String] tag - the tag name to match      [String] text - the text the element must include __Returns:__      [Array] the elements of type tag that includes text -- ##### [first_ele](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/helper.rb#L171) > def first_ele tag_name Get the first tag that matches tag_name __Parameters:__      [String] tag_name - the tag to match __Returns:__      [Element] -- ##### [last_ele](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/helper.rb#L179) > def last_ele tag_name Get the last tag that matches tag_name __Parameters:__      [String] tag_name - the tag to match __Returns:__      [Element] -- ##### [source](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/helper.rb#L185) > def source Prints a JSON view of the current page __Returns:__      [void] -- ##### [get_source](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/helper.rb#L191) > def get_source Gets a JSON view of the current page __Returns:__      [JSON] -- ##### [find_name](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/helper.rb#L200) > def find_name name Returns the first element that exactly matches name __Parameters:__      [String] name - the name to exactly match __Returns:__      [Element] -- ##### [find_names](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/helper.rb#L208) > def find_names name Returns all elements that exactly match name __Parameters:__      [String] name - the name to exactly match __Returns:__      [Array] -- ##### [s_texts](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/element/text.rb#L8) > def s_texts Get an array of text texts. __Returns:__      [Array] -- ##### [e_s_texts](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/element/text.rb#L14) > def e_s_texts Get an array of text elements. __Returns:__      [Array] -- ##### [first_s_text](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/element/text.rb#L20) > def first_s_text Get the first text element. __Returns:__      [Text] -- ##### [last_s_text](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/element/text.rb#L26) > def last_s_text Get the last text element __Returns:__      [Text] -- ##### [s_text](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/element/text.rb#L33) > def s_text text Get the first element that includes text. __Parameters:__      [String, Integer] text - the text to find. If int then the text at that index is returned. __Returns:__      [Text] -- ##### [s_text_exact](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/element/text.rb#L41) > def s_text_exact text Get the first textfield that matches text. __Parameters:__      [String] text - the text that the tag must match __Returns:__      [Text] -- ##### [window_size](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/element/window.rb#L5) > def window_size Get the window's size -- ##### [button](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/element/button.rb#L8) > def button text, number=0 Find a button by text and optionally number. __Parameters:__      [String, Integer] text - the text to exactly match. If int then the button at that index is returned.      [Integer] number - the occurrence of the button matching text. Defaults to the first button. __Returns:__      [Button] the button found with text and matching number -- ##### [buttons](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/element/button.rb#L19) > def buttons text=nil Get an array of button texts or button elements if text is provided. __Parameters:__      [String] text - the text to exactly match __Returns:__      [Array, Array] either an array of button texts or an array of button elements if text is provided. -- ##### [first_button](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/element/button.rb#L26) > def first_button Get the first button element. __Returns:__      [Button] -- ##### [last_button](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/element/button.rb#L32) > def last_button Get the last button element. __Returns:__      [Button] -- ##### [button_exact](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/element/button.rb#L39) > def button_exact text Get the first button element that exactly matches text. __Parameters:__      [String] text - the text to match exactly __Returns:__      [Button] -- ##### [buttons_exact](https://github.com/appium/ruby_lib/blob/669f7345b7e8a92e8206b847d4a2263731df3c4b/lib/appium_lib/common/element/button.rb#L46) > def buttons_exact text Get all button elements that exactly match text. __Parameters:__      [String] text - the text to match exactly __Returns:__      [Array