docs/android_docs.md in appium_lib-0.24.1 vs docs/android_docs.md in appium_lib-1.0.0
- old
+ new
@@ -1,680 +1,853 @@
-##### [s_texts](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/text.rb#L10)
+##### [load_appium_txt](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L71)
-> def s_texts text=nil
+> def self.load_appium_txt opts={}
-Get an array of text texts if text is nil else
-Get all static textfields that include text.
+Load appium.txt (toml format)
+the basedir of this file + appium.txt is what's used
+```
+[caps]
+app = "path/to/app"
+
+[appium_lib]
+port = 8080
+```
+
+:app is expanded
+:require is expanded
+all keys are converted to symbols
+
__Parameters:__
- [String] text - the text to find.
+ [Hash] opts - file: '/path/to/appium.txt', verbose: true
__Returns:__
- [Array]
+ [hash] the symbolized hash with updated :app and :require keys
--
-##### [s_texts_names](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/text.rb#L18)
+##### [symbolize_keys](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L141)
-> def s_texts_names
+> def self.symbolize_keys hash
+convert all keys (including nested) to symbols
+based on deep_symbolize_keys & deep_transform_keys from rails
+https://github.com/rails/docrails/blob/a3b1105ada3da64acfa3843b164b14b734456a50/activesupport/lib/active_support/core_ext/hash/keys.rb#L84
--
-##### [e_s_texts](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/text.rb#L24)
+##### [promote_singleton_appium_methods](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L151)
-> def e_s_texts
+> def self.promote_singleton_appium_methods main_module
-Get an array of text elements.
-__Returns:__
- [Array<Text>]
-
--
-##### [first_s_text](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/text.rb#L30)
+##### [promote_appium_methods](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L180)
-> def first_s_text
+> def self.promote_appium_methods class_array
-Get the first text element.
+Promote appium methods to class instance methods
-__Returns:__
+To promote methods to all classes:
- [Text]
+```ruby
+Appium.promote_appium_methods Object
+```
+__Parameters:__
+
+ [Array<Class>] class_array - An array of classes
+
--
-##### [last_s_text](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/text.rb#L36)
+##### [global_webdriver_http_sleep](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L213)
-> def last_s_text
+> def global_webdriver_http_sleep
-Get the last text element
+The amount to sleep in seconds before every webdriver http call.
-__Returns:__
+--
- [Text]
+##### [global_webdriver_http_sleep=](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L213)
+> def global_webdriver_http_sleep=(value)
+
+The amount to sleep in seconds before every webdriver http call.
+
--
-##### [s_text](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/text.rb#L43)
+##### [initialize](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L234)
-> def s_text text
+> def initialize opts={}
-Get the first element that includes text.
+Creates a new driver
+```ruby
+require 'rubygems'
+require 'appium_lib'
+
+# platformName takes a string or a symbol.
+
+# Start iOS driver
+opts = { caps: { platformName: :ios, app: '/path/to/MyiOS.app' } }
+Appium::Driver.new(opts).start_driver
+
+# Start Android driver
+opts = { caps: { platformName: :android, app: '/path/to/my.apk' } }
+Appium::Driver.new(apk).start_driver
+```
+
__Parameters:__
- [String, Integer] text - the text to find. If int then the text at that index is returned.
+ [Object] opts - A hash containing various options.
__Returns:__
- [Text]
+ [Driver]
--
-##### [s_text_exact](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/text.rb#L51)
+##### [driver_attributes](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L308)
-> def s_text_exact text
+> def driver_attributes
-Get the first textfield that matches text.
+Returns a hash of the driver attributes
-__Parameters:__
+--
- [String] text - the text that the tag must match
+##### [device_is_android?](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L328)
+> def device_is_android?
+
+
+
__Returns:__
- [Text]
+ [Boolean]
--
-##### [s_texts_exact](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/text.rb#L58)
+##### [appium_server_version](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L344)
-> def s_texts_exact text
+> def appium_server_version
-Get all static textfields that matches text.
+Returns the server's version info
-__Parameters:__
+```ruby
+{
+ "build" => {
+ "version" => "0.18.1",
+ "revision" => "d242ebcfd92046a974347ccc3a28f0e898595198"
+ }
+}
+```
- [String] text - the text that the tag must match
+__Returns:__
+ [Hash]
+
+--
+
+##### [absolute_app_path](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L350)
+
+> def self.absolute_app_path app_path
+
+Converts app_path to an absolute path.
+
__Returns:__
- [Array<Text>]
+ [String] APP_PATH as an absolute path
--
-##### [window_size](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/window.rb#L5)
+##### [server_url](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L374)
-> def window_size
+> def server_url
-Get the window's size
+Get the server url
+__Returns:__
+
+ [String] the server url
+
--
-##### [button](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/button.rb#L8)
+##### [restart](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L385)
-> def button text, number=0
+> def restart
-Find a button by text and optionally number.
+Restarts the driver
-__Parameters:__
+__Returns:__
- [String, Integer] text - the text to exactly match. If int then the button at that index is returned.
+ [Driver] the driver
- [Integer] number - the occurrence of the button matching text. Defaults to the first button.
+--
+##### [driver](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L392)
+
+> def driver
+
+Returns the driver
+
__Returns:__
- [Button] the button found with text and matching number
+ [Driver] the driver
--
-##### [buttons](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/button.rb#L19)
+##### [screenshot](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L402)
-> def buttons text=nil
+> def screenshot png_save_path
-Get an array of button texts or button elements if text is provided.
+Takes a png screenshot and saves to the target path.
+Example: screenshot '/tmp/hi.png'
+
__Parameters:__
- [String] text - the text to exactly match
+ [String] png_save_path - the full path to save the png
__Returns:__
- [Array<String>, Array<Buttons>] either an array of button texts or an array of button elements if text is provided.
+ [nil]
--
-##### [first_button](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/button.rb#L26)
+##### [driver_quit](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L409)
-> def first_button
+> def driver_quit
-Get the first button element.
+Quits the driver
__Returns:__
- [Button]
+ [void]
--
-##### [last_button](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/button.rb#L32)
+##### [start_driver](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L417)
-> def last_button
+> def start_driver
-Get the last button element.
+Creates a new global driver and quits the old one if it exists.
__Returns:__
- [Button]
+ [Selenium::WebDriver] the new global driver
--
-##### [button_exact](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/button.rb#L39)
+##### [no_wait](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L443)
-> def button_exact text
+> def no_wait
-Get the first button element that exactly matches text.
+Set implicit wait and default_wait to zero.
-__Parameters:__
+--
- [String] text - the text to match exactly
+##### [set_wait](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L462)
-__Returns:__
+> def set_wait timeout=nil
- [Button]
+Set implicit wait and default_wait to timeout, defaults to 30.
+if set_wait is called without a param then the second to last
+wait will be used.
---
+```ruby`
+set_wait 2
+set_wait 3
+set_wait # 2
-##### [buttons_exact](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/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
+ [Integer] timeout - the timeout in seconds
__Returns:__
- [Array<Button>]
+ [void]
--
-##### [e_buttons](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/button.rb#L52)
+##### [default_wait](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L480)
-> def e_buttons
+> def default_wait
-Get an array of button elements.
+Returns the default client side wait.
+This value is independent of what the server is using
__Returns:__
- [Array<Button>]
+ [Integer]
--
-##### [button_num](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/button.rb#L72)
+##### [exists](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L496)
-> def button_num text, number=1
+> def exists pre_check=0, post_check=@default_wait, &search_block
-Expected to be called via button method.
+Returns existence of element.
-Get the button element exactly matching text and
-occurrence. number=2 means the 2nd occurrence.
+Example:
-find the second Sign In button
+exists { button('sign in') } ? puts('true') : puts('false')
-b = e_button 'Sign In', 2
+__Parameters:__
-Button order will change in iOS vs Android
-so if there's no button found at number then
-return the first button.
+ [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/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L520)
+
+> def execute_script script, *args
+
+The same as @driver.execute_script
+
__Parameters:__
- [String] text - the text to match
+ [String] script - the script to execute
- [Integer] number - the button occurance to return. 1 = first button
+ [*args] args - the args to pass to the script
__Returns:__
- [Button] the button that matches text and number
+ [Object]
--
-##### [tag_name_to_android](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/helper.rb#L6) android
+##### [find_elements](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L528)
-> def tag_name_to_android tag_name
+> def find_elements *args
-Returns an array of android classes that match the tag name
+Calls @driver.find_elements
__Parameters:__
- [String] tag_name - the tag name to convert to an android class
+ [*args] args - the args to use
__Returns:__
- [String]
+ [Array<Element>] Array is empty when no elements are found.
--
-##### [find_eles_attr](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/helper.rb#L198) android
+##### [find_element](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L536)
-> def find_eles_attr tag_name, attribute=nil
+> def find_element *args
-Find all elements matching the attribute
-On android, assume the attr is name (which falls back to text).
+Calls @driver.find_elements
-```ruby
- find_eles_attr :text
-```
-
__Parameters:__
- [String] tag_name - the tag name to search for
+ [*args] args - the args to use
__Returns:__
[Element]
--
-##### [get_selendroid_inspect](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/helper.rb#L220) android
+##### [x](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L543)
-> def get_selendroid_inspect
+> def x
-Selendroid only.
-Returns a string containing interesting elements.
+Quit the driver and Pry.
+quit and exit are reserved by Pry.
__Returns:__
- [String]
+ [void]
--
-##### [get_page_class](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/helper.rb#L282) android
+##### [NoArgMethods](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L7)
-> def get_page_class
+> NoArgMethods = {
--
-##### [page_class](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/helper.rb#L310) android
+##### [app_strings](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L23)
-> def page_class
+> def app_strings
-Count all classes on screen and print to stdout.
-Useful for appium_console.
+Return the hash of all localization strings.
+```ruby
+app_strings #=> "TransitionsTitle"=>"Transitions", "WebTitle"=>"Web"
+```
--
-##### [get_android_inspect](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/helper.rb#L319) android
+##### [background_app](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L29)
-> def get_android_inspect
+> def background_app
-Android only.
-Returns a string containing interesting elements.
-If an element has no content desc or text, then it's not returned by this method.
+Backgrounds the app for a set number of seconds.
+This is a blocking application
-__Returns:__
+--
- [String]
+##### [current_activity](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L34)
+> def current_activity
+
+
+
--
-##### [get_inspect](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/helper.rb#L403) android
+##### [launch](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L36)
-> def get_inspect
+> def launch
-Automatically detects selendroid or android.
-Returns a string containing interesting elements.
+Start the simulator and applicaton configured with desired capabilities
-__Returns:__
+--
- [String]
+##### [reset](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L39)
+> def reset
+
+Reset the device, relaunching the application.
+
--
-##### [page](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/helper.rb#L409) android
+##### [shake](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L42)
-> def page
+> def shake
-Intended for use with console.
-Inspects and prints the current page.
+Cause the device to shake
--
-##### [fast_duration](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/helper.rb#L421) android
+##### [toggle_flight_mode](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L45)
-> def fast_duration
+> def toggle_flight_mode
-JavaScript code from https://github.com/appium/appium/blob/master/app/android.js
+toggle flight mode on or off
-```javascript
-Math.round(1.0/28.0 * 28) = 1
+--
+
+##### [complex_find](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L48)
+
+> def complex_find
+
+Find an element by a complex array of criteria. Available criteria
+are listed in [link here]. Criteria are formed by creating an array
+of arrays, each containing a selector and that selector's value.
+
+```ruby
+complex_find [[[2, 'Sau'], [14, true]]] # => Find a clickable element
+ # whose names starts with 'Sau'
```
-We want steps to be exactly 1. If it's zero then a tap is used instead of a swipe.
+__Parameters:__
+ [Symbol] mod - If present, will be the 0th element in the selector array.
+
+ [Array<Object>] selectors - The selectors to find elements with.
+
--
-##### [current_app](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/helper.rb#L427) android
+##### [hide_keyboard](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L60)
-> def current_app
+> def hide_keyboard
-Lists package, activity, and adb shell am start -n value for current app.
-Works on local host only (not remote).
+Hide the onscreen keyboard
+__Parameters:__
+
+ [String] close_key - the name of the key which closes the keyboard.
+Defaults to 'Done'.
+
--
-##### [id](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/helper.rb#L441) android
+##### [key_event](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L69)
-> def id id
+> def key_event
-Find by id. Useful for selendroid
+Send a key event to the device.
__Parameters:__
- [String] id - the id to search for
+ [integer] key - The key to send.
-__Returns:__
+ [String] metastate - The state the metakeys should be in when sending the key.
- [Element]
+--
+##### [push_file](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L74)
+
+> def push_file
+
+Place a file in a specific location on the device.
+
+__Parameters:__
+
+ [String] path - The absolute path on the device to store data at.
+
+ [String] data - Raw file data to be sent to the device.
+
--
-##### [alert_click](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/element/alert.rb#L6) android
+##### [pull_file](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L79)
-> def alert_click value
+> def pull_file
-Tap the alert button identified by value.
+Retrieve a file from the device. This can retrieve an absolute path or
+a path relative to the installed app (iOS only).
+```ruby
+pull_file '/local/data/some/path' #=> Get the file at that path
+pull_file 'Shenanigans.app/some/file' #=> Get 'some/file' from the install location of Shenanigans.app
+```
__Parameters:__
- [Integer, String] value - either an integer index of the button or the button's name
+ [String] path - Either an absolute path OR, for iOS devices, a path relative to the app, as described.
-__Returns:__
+--
- [void]
+##### [extend_search_contexts](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L277)
+> def extend_search_contexts
+
+
+
--
-##### [alert_accept](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/element/alert.rb#L13) android
+##### [accessiblity_id_find](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L277)
-> def alert_accept
+> def accessiblity_id_find
-Accept the alert.
-The last button is considered "accept."
+find_element/s with their accessibility_id
-__Returns:__
+```ruby
+ find_elements :accessibility_id, 'Animation'
+```
- [void]
+--
+##### [add_touch_actions](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L283)
+
+> def add_touch_actions
+
+
+
--
-##### [alert_accept_text](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/element/alert.rb#L20) android
+##### [current_context=](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L307)
-> def alert_accept_text
+> def current_context=
-Get the text of the alert's accept button.
-The last button is considered "accept."
+Change the context to the given context.
+```ruby
+current_context= "NATIVE_APP"
+```
-__Returns:__
+__Parameters:__
- [String]
+ [String] The - context to change to
--
-##### [alert_dismiss](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/element/alert.rb#L27) android
+##### [current_context](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L315)
-> def alert_dismiss
+> def current_context
-Dismiss the alert.
-The first button is considered "dismiss."
+
__Returns:__
- [void]
+ [String] The context currently being used.
--
-##### [alert_dismiss_text](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/element/alert.rb#L34) android
+##### [available_contexts](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L318)
-> def alert_dismiss_text
+> def available_contexts
-Get the text of the alert's dismiss button.
-The first button is considered "dismiss."
+
__Returns:__
- [String]
+ [Array<String>] All usable contexts, as an array of strings.
--
-##### [find](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/element/generic.rb#L44) android
+##### [within_context](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L328)
-> def find val
+> def within_context(context)
-Find the value contained in content description or text. Search elements
-in this order: EditText, Button, ImageButton
+Perform a block within the given context, then switch back to the starting context.
+```ruby
+within_context('NATIVE_APP') do
+ find_element [:tag, "button"]
+```
__Parameters:__
- [String] val - the value to search for
+ [String] context - The context to switch to for the duration of the block.
-__Returns:__
+--
- [Element]
+##### [switch_to_default_context](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L335)
+> def switch_to_default_context
+
+Change to the default context. This is equivalent to `current_context= nil`.
+
--
-##### [text](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/element/generic.rb#L70) android
+##### [pinch](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/multi_touch.rb#L30)
-> def text text
+> def pinch(percentage=25, auto_perform=true)
-Return the first element matching text.
+Convenience method for pinching the screen.
+Places two fingers at the edges of the screen and brings them together.
+```ruby
+action = pinch 75 #=> Pinch the screen from the top right and bottom left corners
+action.perform #=> to 25% of its size.
+```
__Parameters:__
- [String] text - the text to search for
+ [int] percentage - The percent size by which to shrink the screen when pinched.
-__Returns:__
+ [boolean] auto_perform - Whether to perform the action immediately (default true)
- [Element] the first matching element
-
--
-##### [texts](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/element/generic.rb#L79) android
+##### [zoom](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/multi_touch.rb#L58)
-> def texts text
+> def zoom(percentage=200, auto_perform=true)
-Return all elements matching text.
+Convenience method for zooming the screen.
+Places two fingers at the edges of the screen and brings them together.
+```ruby
+action = zoom 200 #=> Zoom in the screen from the center until it doubles in size.
+action.perform
+```
__Parameters:__
- [String] text - the text to search for
+ [int] percentage - The percent size by which to shrink the screen when pinched.
+ [boolean] auto_perform - Whether to perform the action immediately (default true)
+
+--
+
+##### [initialize](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/multi_touch.rb#L79)
+
+> def initialize
+
+Create a new multi-action
+
__Returns:__
- [Array<Element>] all matching elements
+ [MultiTouch] a new instance of MultiTouch
--
-##### [name](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/element/generic.rb#L88) android
+##### [add](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/multi_touch.rb#L85)
-> def name name
+> def add(chain)
-Return the first element matching name.
-on Android name is content description
-on iOS name is the accessibility label or the text.
+Add a touch_action to be performed
__Parameters:__
- [String] name - the name to search for
+ [TouchAction] chain - The action to add to the chain
-__Returns:__
+--
- [Element] the first matching element
+##### [perform](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/multi_touch.rb#L90)
+> def perform
+
+Ask Appium to perform the actions
+
--
-##### [name_exact](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/element/generic.rb#L99) android
+##### [ACTIONS](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L12)
-> def name_exact name
+> ACTIONS = [:move_to, :press_for_duration, :press, :release, :tap, :wait, :perform]
-Return the first element exactly matching name.
-on Android name is content description
-on iOS name is the accessibility label or the text.
-__Parameters:__
- [String] name - the name to search for
+--
-__Returns:__
+##### [COMPLEX_ACTIONS](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L13)
- [Element] the first matching element
+> COMPLEX_ACTIONS = [:swipe]
+
+
--
-##### [names](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/element/generic.rb#L117) android
+##### [actions](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L27)
-> def names name=''
+> def actions
-Return all elements matching name.
-on Android name is content description
-on iOS name is the accessibility label or the text.
+Returns the value of attribute actions
-__Parameters:__
+--
- [String] name - the name to search for
+##### [initialize](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L29)
+> def initialize
+
+
+
__Returns:__
- [Array<Element>] all matching elements
+ [TouchAction] a new instance of TouchAction
--
-##### [scroll_to](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/element/generic.rb#L131) android
+##### [move_to](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L37)
-> def scroll_to text
+> def move_to(opts)
-Scroll to an element containing target text or description.
+Move to the given co-ordinates.
__Parameters:__
- [String] text - the text to search for in the text value and content description
+ [Hash] opts - a customizable set of options
-__Returns:__
-
- [Element] the element scrolled to
-
--
-##### [scroll_to_exact](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/element/generic.rb#L144) android
+##### [press_for_duration](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L47)
-> def scroll_to_exact text
+> def press_for_duration(element, x, y, duration)
-Scroll to an element with the exact target text or description.
+Press down for a specific duration.
__Parameters:__
- [String] text - the text to search for in the text value and content description
+ [WebDriver::Element] element - the element to press.
-__Returns:__
+ [integer] x - x co-ordinate to press on.
- [Element] the element scrolled to
+ [integer] y - y co-ordinate to press on.
+ [integer] duration - Number of seconds to press.
+
--
-##### [textfields](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/element/textfield.rb#L7) android
+##### [press](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L58)
-> def textfields
+> def press(opts)
-Get an array of textfield texts.
+Press a finger onto the screen. Finger will stay down until you call
+`release`.
-__Returns:__
+__Parameters:__
- [Array<String>]
+ [Hash] opts - a customizable set of options
--
-##### [e_textfields](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/element/textfield.rb#L13) android
+##### [release](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L69)
-> def e_textfields
+> def release(opts=nil)
-Get an array of textfield elements.
+Remove a finger from the screen.
-__Returns:__
+__Parameters:__
- [Array<Textfield>]
+ [Hash] opts - a customizable set of options
--
-##### [first_textfield](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/element/textfield.rb#L19) android
+##### [tap](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L80)
-> def first_textfield
+> def tap(opts)
-Get the first textfield element.
+Touch a point on the screen
-__Returns:__
+__Parameters:__
- [Textfield]
+ [Hash] opts - a customizable set of options
--
-##### [last_textfield](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/element/textfield.rb#L25) android
+##### [wait](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L88)
-> def last_textfield
+> def wait(seconds)
-Get the last textfield element.
+Pause for a number of seconds before the next action
-__Returns:__
+__Parameters:__
- [Textfield]
+ [integer] seconds - Number of seconds to pause for
--
-##### [textfield](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/element/textfield.rb#L32) android
+##### [swipe](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L99)
-> def textfield text
+> def swipe(opts)
-Get the first textfield that includes text or name (content description).
+Convenience method to peform a swipe.
__Parameters:__
- [String, Integer] text - the text to search for. If int then the textfield at that index is returned.
+ [Hash] opts - a customizable set of options
-__Returns:__
+--
- [Textfield]
+##### [perform](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L114)
+> def perform
+
+Ask the driver to perform all actions in this action chain.
+
--
-##### [textfield_exact](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/android/element/textfield.rb#L45) android
+##### [cancel](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L120)
-> def textfield_exact text
+> def cancel
-Get the first textfield that matches text.
+Does nothing, currently.
-__Parameters:__
+--
- [String] text - the text to match
+##### [chain_method](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L128)
-__Returns:__
+> def chain_method(method, args=nil)
- [Textfield]
+
--
-##### [wait](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L33)
+##### [args_with_ele_ref](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L137)
+> def args_with_ele_ref(args)
+
+
+
+--
+
+##### [wait](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/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.
@@ -696,23 +869,25 @@
[Object] the result of block.call
--
-##### [ignore](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L45)
+##### [ignore](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L49)
> def ignore &block
Return block.call and ignore any exceptions.
--
-##### [wait_true](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L55)
+##### [wait_true](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L64)
> 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.
+Check every 0.5 seconds to see if block.call returns a truthy value.
+Note this isn't a strict boolean true, any truthy value is accepted.
+false and nil are considered failures.
Give up after 30 seconds.
__Parameters:__
[Integer] max_wait - the maximum time in seconds to wait for
@@ -725,11 +900,11 @@
[Object] the result of block.call
--
-##### [back](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L68)
+##### [back](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L81)
> def back
Navigate back.
@@ -737,19 +912,19 @@
[void]
--
-##### [session_id](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L73)
+##### [session_id](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L86)
> def session_id
For Sauce Labs reporting. Returns the current session id.
--
-##### [xpath](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L81)
+##### [xpath](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L94)
> def xpath xpath_str
Returns the first element that matches the provided xpath.
@@ -761,11 +936,11 @@
[Element]
--
-##### [xpaths](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L89)
+##### [xpaths](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L102)
> def xpaths xpath_str
Returns all elements that match the provided xpath.
@@ -777,904 +952,1065 @@
[Array<Element>]
--
-##### [ele_index](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L97)
+##### [source](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L108)
-> def ele_index tag_name, index
+> def source
-Get the element of type tag_name at matching index.
+Prints xml of the current page
-__Parameters:__
+__Returns:__
- [String] tag_name - the tag name to find
+ [void]
- [Integer] index - the index
+--
+##### [get_source](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L118)
+
+> def get_source
+
+Returns XML string for the current page
+Same as driver.page_source
+
__Returns:__
- [Element] the found element of type tag_name
+ [String]
--
-##### [find_eles](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L106)
+##### [result](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L125)
-> def find_eles tag_name
+> def result
-Get all elements exactly matching tag name
+Returns the value of attribute result
-__Parameters:__
+--
- [String] tag_name - the tag name to find
+##### [initialize](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L127)
+> def initialize
+
+
+
__Returns:__
- [Array<Element>] the found elements of type tag_name
+ [CountElements] a new instance of CountElements
--
-##### [find_ele_by_text](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L114)
+##### [reset](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L131)
-> def find_ele_by_text tag, text
+> def reset
-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
+##### [start_element](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L136)
-__Returns:__
+> def start_element name, attrs = []
- [Element] the element of type tag exactly matching text
+http://nokogiri.org/Nokogiri/XML/SAX/Document.html
--
-##### [find_eles_by_text](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L122)
+##### [formatted_result](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L140)
-> def find_eles_by_text tag, text
+> def formatted_result
-Get all tags that exactly match tag and text.
-__Parameters:__
- [String] tag - the tag name to match
+--
- [String] text - the text to exactly match
+##### [get_page_class](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L151)
-__Returns:__
+> def get_page_class
- [Array<Element>] the elements of type tag exactly matching text
+Returns a string of class counts.
--
-##### [find_ele_by_attr_include](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L131)
+##### [page_class](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L162)
-> def find_ele_by_attr_include tag, attr, value
+> def page_class
-Get the first tag by attribute that exactly matches value.
+Count all classes on screen and print to stdout.
+Useful for appium_console.
-__Parameters:__
+--
- [String] tag - the tag name to match
+##### [px_to_window_rel](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L172)
- [String] attr - the attribute to compare
+> def px_to_window_rel opts={}
- [String] value - the value of the attribute that the element must include
+Converts pixel values to window relative values
+```ruby
+px_to_window_rel x: 50, y: 150
+```
+
+--
+
+##### [xml_keys](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L189)
+
+> def xml_keys target
+
+Search strings.xml's values for target.
+
+__Parameters:__
+
+ [String] target - the target to search for in strings.xml values
+
__Returns:__
- [Element] the element of type tag who's attribute includes value
+ [Array]
--
-##### [find_eles_by_attr_include](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L140)
+##### [xml_values](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L197)
-> def find_eles_by_attr_include tag, attr, value
+> def xml_values target
-Get tags by attribute that include value.
+Search strings.xml's keys for target.
__Parameters:__
- [String] tag - the tag name to match
+ [String] target - the target to search for in strings.xml keys
- [String] attr - the attribute to compare
+__Returns:__
- [String] value - the value of the attribute that the element must include
+ [Array]
+--
+
+##### [resolve_id](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L205)
+
+> def resolve_id id
+
+Resolve id in strings.xml and return the value.
+
+__Parameters:__
+
+ [String] id - the id to resolve
+
__Returns:__
- [Array<Element>] the elements of type tag who's attribute includes value
+ [String]
--
-##### [find_ele_by_text_include](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L149)
+##### [window_size](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/element/window.rb#L5)
-> def find_ele_by_text_include tag, text
+> def window_size
-Get the first tag that includes text.
-element.attribute(:text).include? text
+Get the window's size
-__Parameters:__
+--
- [String] tag - the tag name to match
+##### [result](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/helper.rb#L7) android
- [String] text - the text the element must include
+> def result
-__Returns:__
+TODO: Support strings.xml ids
- [Element] the element of type tag that includes text
+--
+##### [keys](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/helper.rb#L7) android
+
+> def keys
+
+TODO: Support strings.xml ids
+
--
-##### [find_eles_by_text_include](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L158)
+##### [filter](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/helper.rb#L9) android
-> def find_eles_by_text_include tag, text
+> def filter
-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
+##### [filter=](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/helper.rb#L14) android
+> def filter= value
+
+convert to string to support symbols
+
+--
+
+##### [initialize](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/helper.rb#L20) android
+
+> def initialize
+
+
+
__Returns:__
- [Array<Element>] the elements of type tag that includes text
+ [AndroidElements] a new instance of AndroidElements
--
-##### [first_ele](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L165)
+##### [reset](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/helper.rb#L25) android
-> def first_ele tag_name
+> def reset
-Get the first tag that matches tag_name
-__Parameters:__
- [String] tag_name - the tag to match
+--
-__Returns:__
+##### [start_element](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/helper.rb#L31) android
- [Element]
+> def start_element name, attrs = []
+http://nokogiri.org/Nokogiri/XML/SAX/Document.html
+
--
-##### [last_ele](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L173)
+##### [get_android_inspect](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/helper.rb#L65) android
-> def last_ele tag_name
+> def get_android_inspect class_name=false
-Get the last tag that matches tag_name
+Android only.
+Returns a string containing interesting elements.
+The text, content description, and id are returned.
+if false (default) then all classes will be inspected
__Parameters:__
- [String] tag_name - the tag to match
+ [String] class_name - the class name to filter on.
__Returns:__
- [Element]
+ [String]
--
-##### [source](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L179)
+##### [page](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/helper.rb#L80) android
-> def source
+> def page class_name=false
-Prints a JSON view of the current page
+Intended for use with console.
+Inspects and prints the current page.
+if false (default) then all classes will be inspected
+__Parameters:__
+
+ [String] class_name - the class name to filter on.
+
__Returns:__
[void]
--
-##### [get_source](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L185)
+##### [current_app](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/helper.rb#L88) android
-> def get_source
+> def current_app
-Gets a JSON view of the current page
+Lists package, activity, and adb shell am start -n value for current app.
+Works on local host only (not remote).
+noinspection RubyArgCount
-__Returns:__
-
- [JSON]
-
--
-##### [find_name](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L194)
+##### [id](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/helper.rb#L102) android
-> def find_name name
+> def id id
-Returns the first element that exactly matches name
+Find by id
__Parameters:__
- [String] name - the name to exactly match
+ [String] id - the id to search for
__Returns:__
[Element]
--
-##### [find_names](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L202)
+##### [ele_index](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/helper.rb#L116) android
-> def find_names name
+> def ele_index class_name, index
-Returns all elements that exactly match name
+Find the element of type class_name at matching index.
__Parameters:__
- [String] name - the name to exactly match
+ [String] class_name - the class name to find
+ [Integer] index - the index
+
__Returns:__
- [Array<Element>]
+ [Element] the found element of type class_name
--
-##### [tag](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L210)
+##### [find_ele_by_attr](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/helper.rb#L134) android
-> def tag tag_name
+> def find_ele_by_attr class_name, attr, value
-Returns the first element matching tag_name
+Find the first element exactly matching class and attribute value.
__Parameters:__
- [String] tag_name - the tag_name to search for
+ [String] class_name - the class name to search for
+ [String] attr - the attribute to inspect
+
+ [String] value - the expected value of the attribute
+
__Returns:__
[Element]
--
-##### [tags](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L218)
+##### [find_eles_by_attr](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/helper.rb#L143) android
-> def tags tag_name
+> def find_eles_by_attr class_name, attr, value
-Returns all elements matching tag_name
+Find all elements exactly matching class and attribute value.
__Parameters:__
- [String] tag_name - the tag_name to search for
+ [String] class_name - the class name to match
+ [String] attr - the attribute to compare
+
+ [String] value - the value of the attribute that the element must have
+
__Returns:__
- [Element]
+ [Array<Element>]
--
-##### [px_to_window_rel](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L228)
+##### [find_ele_by_attr_include](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/helper.rb#L157) android
-> def px_to_window_rel opts={}
+> def find_ele_by_attr_include class_name, attr, value
-Converts pixel values to window relative values
+Find the first element by attribute that exactly matches value.
-```ruby
-px_to_window_rel x: 50, y: 150
-```
+__Parameters:__
---
+ [String] class_name - the class name to match
-##### [lazy_load_strings](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L238)
+ [String] attr - the attribute to compare
-> def lazy_load_strings
+ [String] value - the value of the attribute that the element must include
+__Returns:__
+ [Element] the element of type tag who's attribute includes value
--
-##### [xml_keys](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L245)
+##### [find_eles_by_attr_include](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/helper.rb#L166) android
-> def xml_keys target
+> def find_eles_by_attr_include class_name, attr, value
-Search strings.xml's values for target.
+Find elements by attribute that include value.
__Parameters:__
- [String] target - the target to search for in strings.xml values
+ [String] class_name - 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]
+ [Array<Element>] the elements of type tag who's attribute includes value
--
-##### [xml_values](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L253)
+##### [first_ele](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/helper.rb#L173) android
-> def xml_values target
+> def first_ele class_name
-Search strings.xml's keys for target.
+Find the first element that matches class_name
__Parameters:__
- [String] target - the target to search for in strings.xml keys
+ [String] class_name - the tag to match
__Returns:__
- [Array]
+ [Element]
--
-##### [resolve_id](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L261)
+##### [last_ele](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/helper.rb#L181) android
-> def resolve_id id
+> def last_ele class_name
-Resolve id in strings.xml and return the value.
+Find the last element that matches class_name
__Parameters:__
- [String] id - the id to resolve
+ [String] class_name - the tag to match
__Returns:__
- [String]
+ [Element]
--
-##### [raise_no_element_error](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L267)
+##### [tag](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/helper.rb#L189) android
-> def raise_no_element_error
+> def tag class_name
-Used to error when finding a single element fails.
+Find the first element of type class_name
---
+__Parameters:__
-##### [value](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/patch.rb#L32)
+ [String] class_name - the class_name to search for
-> def value
+__Returns:__
-Returns the value attribute
+ [Element]
-Fixes NoMethodError: undefined method `value' for Selenium::WebDriver::Element
-
--
-##### [name](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/patch.rb#L39)
+##### [tags](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/helper.rb#L197) android
-> def name
+> def tags class_name
-Returns the name attribute
+Find all elements of type class_name
-Fixes NoMethodError: undefined method `name' for Selenium::WebDriver::Element
+__Parameters:__
+ [String] class_name - the class_name to search for
+
+__Returns:__
+
+ [Element]
+
--
-##### [location_rel](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/patch.rb#L51)
+##### [xpath_visible_contains](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/helper.rb#L232) android
-> def location_rel
+> def xpath_visible_contains element, value
-For use with mobile tap.
+Find the first element that contains value
-```ruby
-execute_script 'mobile: tap', :x => 0.0, :y => 0.98
-```
+__Parameters:__
-https://github.com/appium/appium/wiki/Automating-mobile-gestures
+ [String] element - the class name for the element
+ [String] value - the value to search for
+
__Returns:__
- [OpenStruct] the relative x, y in a struct. ex: { x: 0.50, y: 0.20 }
+ [Element]
--
-##### [CORE](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L16)
+##### [xpaths_visible_contains](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/helper.rb#L240) android
-> CORE = [ :array, :hash, :class, :file, :dir, :bigdecimal, :rational, :struct, :openstruct, :method, :unboundmethod ]
+> def xpaths_visible_contains element, value
+Find all elements containing value
+__Parameters:__
+ [String] element - the class name for the element
+
+ [String] value - the value to search for
+
+__Returns:__
+
+ [Array<Element>]
+
--
-##### [awesome_openstruct](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L18)
+##### [xpath_visible_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/helper.rb#L266) android
-> def awesome_openstruct target
+> def xpath_visible_exact element, value
+Find the first element exactly matching value
+__Parameters:__
+ [String] element - the class name for the element
+
+ [String] value - the value to search for
+
+__Returns:__
+
+ [Element]
+
--
-##### [load_appium_txt](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L27)
+##### [xpaths_visible_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/helper.rb#L274) android
-> def load_appium_txt opts
+> def xpaths_visible_exact element, value
-Load appium.txt (toml format) into system ENV
-the basedir of this file + appium.txt is what's used
+Find all elements exactly matching value
__Parameters:__
- [Hash] opts - file: '/path/to/appium.txt', verbose: true
+ [String] element - the class name for the element
+ [String] value - the value to search for
+
__Returns:__
- [Array<String>] the require files. nil if require doesn't exist
+ [Element]
--
-##### [promote_singleton_appium_methods](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L145)
+##### [TextView](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/text.rb#L4) android
-> def self.promote_singleton_appium_methods main_module
+> TextView = 'android.widget.TextView'
--
-##### [promote_appium_methods](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L175)
+##### [s_text](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/text.rb#L10) android
-> def self.promote_appium_methods class_array
+> def s_text value
-Promote appium methods to class instance methods
+Find the first TextView that contains value or by index.
+If int then the TextView at that index is returned.
-To promote methods to all classes:
+__Parameters:__
-```ruby
-Appium.promote_appium_methods Object
-```
+ [String, Integer] value - the value to find.
-__Parameters:__
+__Returns:__
- [Array<Class>] class_array - An array of classes
+ [TextView]
--
-##### [default_wait](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L550)
+##### [s_texts](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/text.rb#L18) android
-> def default_wait
+> def s_texts value
-Returns the default client side wait.
-This value is independent of what the server is using
+Find all TextViews containing value.
+__Parameters:__
+
+ [String] value - the value to search for
+
__Returns:__
- [Integer]
+ [Array<TextView>]
--
-##### [app_path](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
+##### [first_s_text](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/text.rb#L24) android
-> def app_path
+> def first_s_text
-Returns the value of attribute app_path
+Find the first TextView.
---
+__Returns:__
-##### [app_name](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
+ [TextView]
-> def app_name
+--
-Returns the value of attribute app_name
+##### [last_s_text](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/text.rb#L30) android
---
+> def last_s_text
-##### [device](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
+Find the last TextView.
-> def device
+__Returns:__
-Returns the value of attribute device
+ [TextView]
--
-##### [app_package](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
+##### [s_text_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/text.rb#L37) android
-> def app_package
+> def s_text_exact value
-Returns the value of attribute app_package
+Find the first TextView that exactly matches value.
---
+__Parameters:__
-##### [app_activity](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
+ [String] value - the value to match exactly
-> def app_activity
+__Returns:__
-Returns the value of attribute app_activity
+ [TextView]
--
-##### [app_wait_activity](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
+##### [s_texts_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/text.rb#L44) android
-> def app_wait_activity
+> def s_texts_exact value
-Returns the value of attribute app_wait_activity
+Find all TextViews that exactly match value.
---
+__Parameters:__
-##### [sauce_username](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
+ [String] value - the value to match exactly
-> def sauce_username
+__Returns:__
-Returns the value of attribute sauce_username
+ [Array<TextView>]
--
-##### [sauce_access_key](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
+##### [e_s_texts](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/text.rb#L50) android
-> def sauce_access_key
+> def e_s_texts
-Returns the value of attribute sauce_access_key
+Find all TextViews.
+__Returns:__
+
+ [Array<TextView>]
+
--
-##### [port](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
+##### [alert_click](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/alert.rb#L6) android
-> def port
+> def alert_click value
-Returns the value of attribute port
+Click the first alert button that contains value or by index.
---
+__Parameters:__
-##### [debug](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
+ [Integer, String] value - either an integer index of the button or the button's name
-> def debug
+__Returns:__
-Returns the value of attribute debug
+ [void]
--
-##### [export_session](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
+##### [alert_accept](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/alert.rb#L13) android
-> def export_session
+> def alert_accept
-Returns the value of attribute export_session
+Accept the alert.
+The last button is considered "accept."
+__Returns:__
+
+ [void]
+
--
-##### [device_cap](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
+##### [alert_accept_text](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/alert.rb#L20) android
-> def device_cap
+> def alert_accept_text
-Returns the value of attribute device_cap
+Get the text of the alert's accept button.
+The last button is considered "accept."
+__Returns:__
+
+ [String]
+
--
-##### [compress_xml](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
+##### [alert_dismiss](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/alert.rb#L27) android
-> def compress_xml
+> def alert_dismiss
-Returns the value of attribute compress_xml
+Dismiss the alert.
+The first button is considered "dismiss."
+__Returns:__
+
+ [void]
+
--
-##### [custom_url](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
+##### [alert_dismiss_text](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/alert.rb#L34) android
-> def custom_url
+> def alert_dismiss_text
-Returns the value of attribute custom_url
+Get the text of the alert's dismiss button.
+The first button is considered "dismiss."
+__Returns:__
+
+ [String]
+
--
-##### [global_webdriver_http_sleep](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L210)
+##### [uiautomator_find](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/mobile_methods.rb#L10) android
-> def global_webdriver_http_sleep
+> def uiautomator_find
-The amount to sleep in seconds before every webdriver http call.
+find_element/s can be used with a [UISelector](http://developer.android.com/tools/help/uiautomator/UiSelector.html).
+```ruby
+ find_elements :uiautomator, 'new UiSelector().clickable(true)'
+```
+
--
-##### [global_webdriver_http_sleep=](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L210)
+##### [Button](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/button.rb#L4) android
-> def global_webdriver_http_sleep=(value)
+> Button = 'android.widget.Button'
-The amount to sleep in seconds before every webdriver http call.
+
--
-##### [initialize](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L240)
+##### [ImageButton](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/button.rb#L5) android
-> def initialize opts={}
+> ImageButton = 'android.widget.ImageButton'
-Creates a new driver.
-:device is :android, :ios, or :selendroid
-```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 = { device: :ios, app_path: '/path/to/MyiOS.app'}
-Appium::Driver.new(app).start_driver
+##### [button](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/button.rb#L39) android
-# Start Android driver
-apk = { device: :android
- app_path: '/path/to/the.apk',
- app_package: 'com.example.pkg',
- app_activity: 'act.Start',
- app_wait_activity: 'act.Start'
-}
+> def button value
-Appium::Driver.new(apk).start_driver
-```
+Find the first button that contains value or by index.
+If int then the button at that index is returned.
__Parameters:__
- [Object] opts - A hash containing various options.
+ [String, Integer] value - the value to exactly match.
__Returns:__
- [Driver]
+ [Button]
--
-##### [status](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L363)
+##### [buttons](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/button.rb#L55) android
-> def status
+> def buttons value
-Returns the status payload
+Find all buttons containing value
-```ruby
-{"status"=>0,
- "value"=>
- {"build"=>
- {"version"=>"0.8.2",
- "revision"=>"f2a2bc3782e4b0370d97a097d7e04913cf008995"}},
- "sessionId"=>"8f4b34a7-a9a9-4ac5-b125-36258143446a"}
-```
+__Parameters:__
- Discover the Appium rev running on the server.
+ [String] value - the value to search for
-`status["value"]["build"]["revision"]`
-`f2a2bc3782e4b0370d97a097d7e04913cf008995`
-
__Returns:__
- [JSON]
+ [Array<Button>]
--
-##### [server_version](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L369)
+##### [first_button](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/button.rb#L61) android
-> def server_version
+> def first_button
-Returns the server's version string
+Find the first button.
__Returns:__
- [String]
+ [Button]
--
-##### [absolute_app_path](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L412)
+##### [last_button](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/button.rb#L67) android
-> def self.absolute_app_path app_path
+> def last_button
-Converts environment variable APP_PATH to an absolute path.
+Find the last button.
__Returns:__
- [String] APP_PATH as an absolute path
+ [Button]
--
-##### [server_url](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L436)
+##### [button_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/button.rb#L74) android
-> def server_url
+> def button_exact value
-Get the server url for sauce or local based on env vars.
+Find the first button that exactly matches value.
+__Parameters:__
+
+ [String] value - the value to match exactly
+
__Returns:__
- [String] the server url
+ [Button]
--
-##### [restart](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L447)
+##### [buttons_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/button.rb#L81) android
-> def restart
+> def buttons_exact value
-Restarts the driver
+Find all buttons that exactly match value.
+__Parameters:__
+
+ [String] value - the value to match exactly
+
__Returns:__
- [Driver] the driver
+ [Array<Button>]
--
-##### [driver](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L454)
+##### [e_buttons](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/button.rb#L87) android
-> def driver
+> def e_buttons
-Returns the driver
+Find all buttons.
__Returns:__
- [Driver] the driver
+ [Array<Button>]
--
-##### [screenshot](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L464)
+##### [find](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/generic.rb#L7) android
-> def screenshot png_save_path
+> def find value
-Takes a png screenshot and saves to the target path.
+Find the first element containing value
-Example: screenshot '/tmp/hi.png'
-
__Parameters:__
- [String] png_save_path - the full path to save the png
+ [String] value - the value to search for
__Returns:__
- [nil]
+ [Element]
--
-##### [driver_quit](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L471)
+##### [finds](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/generic.rb#L14) android
-> def driver_quit
+> def finds value
-Quits the driver
+Find all elements containing value
+__Parameters:__
+
+ [String] value - the value to search for
+
__Returns:__
- [void]
+ [Array<Element>]
--
-##### [start_driver](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L479)
+##### [find_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/generic.rb#L21) android
-> def start_driver
+> def find_exact value
-Creates a new global driver and quits the old one if it exists.
+Find the first element exactly matching value
+__Parameters:__
+
+ [String] value - the value to search for
+
__Returns:__
- [Selenium::WebDriver] the new global driver
+ [Element]
--
-##### [no_wait](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L513)
+##### [finds_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/generic.rb#L28) android
-> def no_wait
+> def finds_exact value
-Set implicit wait and default_wait to zero.
+Find all elements exactly matching value
+__Parameters:__
+
+ [String] value - the value to search for
+
+__Returns:__
+
+ [Array<Element>]
+
--
-##### [set_wait](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L532)
+##### [scroll_to](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/generic.rb#L35) android
-> def set_wait timeout=nil
+> def scroll_to text
-Set implicit wait and default_wait to timeout, defaults to 30.
-if set_wait is called without a param then the second to last
-wait will be used.
+Scroll to the first element containing target text or description.
-```ruby`
-set_wait 2
-set_wait 3
-set_wait # 2
+__Parameters:__
-````
+ [String] text - the text to search for in the text value and content description
+__Returns:__
+
+ [Element] the element scrolled to
+
+--
+
+##### [scroll_to_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/generic.rb#L48) android
+
+> def scroll_to_exact text
+
+Scroll to the first element with the exact target text or description.
+
__Parameters:__
- [Integer] timeout - the timeout in seconds
+ [String] text - the text to search for in the text value and content description
__Returns:__
- [void]
+ [Element] the element scrolled to
--
-##### [exists](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L566)
+##### [EditText](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/textfield.rb#L3) android
-> def exists pre_check=0, post_check=@default_wait, &search_block
+> EditText = 'android.widget.EditText'
-Returns existence of element.
-Example:
-exists { button('sign in') } ? puts('true') : puts('false')
+--
-__Parameters:__
+##### [textfield](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/textfield.rb#L9) android
- [Integer] pre_check - the amount in seconds to set the
-wait to before checking existance
+> def textfield value
- [Integer] post_check - the amount in seconds to set the
-wait to after checking existance
+Find the first EditText that contains value or by index.
+If int then the EditText at that index is returned.
- [Block] search_block - the block to call
+__Parameters:__
+ [String, Integer] value - the text to match exactly.
+
__Returns:__
- [Boolean]
+ [EditText]
--
-##### [execute_script](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L590)
+##### [textfields](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/textfield.rb#L17) android
-> def execute_script script, *args
+> def textfields value
-The same as @driver.execute_script
+Find all EditTexts containing value.
__Parameters:__
- [String] script - the script to execute
+ [String] value - the value to search for
- [*args] args - the args to pass to the script
-
__Returns:__
- [Object]
+ [Array<EditText>]
--
-##### [mobile](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L606)
+##### [first_textfield](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/textfield.rb#L23) android
-> def mobile method, *args
+> def first_textfield
-Helper method for mobile gestures
+Find the first EditText.
-https://github.com/appium/appium/wiki/Automating-mobile-gestures
+__Returns:__
-driver.execute_script 'mobile: swipe', endX: 100, endY: 100, duration: 0.01
+ [EditText]
-becomes
+--
-mobile :swipe, endX: 100, endY: 100, duration: 0.01
+##### [last_textfield](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/textfield.rb#L29) android
-__Parameters:__
+> def last_textfield
- [String, Symbol] method - the method to execute
+Find the last EditText.
- [*args] args - the args to pass to the method
-
__Returns:__
- [Object]
+ [EditText]
--
-##### [find_elements](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L617)
+##### [textfield_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/textfield.rb#L36) android
-> def find_elements *args
+> def textfield_exact value
-Calls @driver.find_elements
+Find the first EditText that exactly matches value.
__Parameters:__
- [*args] args - the args to use
+ [String] value - the value to match exactly
__Returns:__
- [Array<Element>] Array is empty when no elements are found.
+ [EditText]
--
-##### [find_element](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L625)
+##### [textfields_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/textfield.rb#L43) android
-> def find_element *args
+> def textfields_exact value
-Calls @driver.find_elements
+Find all EditTexts that exactly match value.
__Parameters:__
- [*args] args - the args to use
+ [String] value - the value to match exactly
__Returns:__
- [Element]
+ [Array<EditText>]
--
-##### [x](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L632)
+##### [e_textfields](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/android/element/textfield.rb#L49) android
-> def x
+> def e_textfields
-Quit the driver and Pry.
-quit and exit are reserved by Pry.
+Find all EditTexts.
__Returns:__
- [void]
+ [Array<EditText>]
+
+--
+
+##### [value](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/patch.rb#L10)
+
+> def value
+
+Returns the value attribute
+
+Fixes NoMethodError: undefined method `value' for Selenium::WebDriver::Element
+
+--
+
+##### [name](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/patch.rb#L17)
+
+> def name
+
+Returns the name attribute
+
+Fixes NoMethodError: undefined method `name' for Selenium::WebDriver::Element
+
+--
+
+##### [location_rel](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/patch.rb#L29)
+
+> def location_rel
+
+For use with mobile tap.
+
+```ruby
+execute_script 'mobile: tap', :x => 0.0, :y => 0.98
+```
+
+https://github.com/appium/appium/wiki/Automating-mobile-gestures
+
+__Returns:__
+
+ [OpenStruct] the relative x, y in a struct. ex: { x: 0.50, y: 0.20 }
--