docs/ios_docs.md in appium_lib-0.24.1 vs docs/ios_docs.md in appium_lib-1.0.0
- old
+ new
@@ -1,1135 +1,1048 @@
-##### [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:__
-##### [last_s_text](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/text.rb#L36)
+ [Array<Class>] class_array - An array of classes
-> def last_s_text
+--
-Get the last text element
+##### [global_webdriver_http_sleep](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L213)
-__Returns:__
+> def global_webdriver_http_sleep
- [Text]
+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)
+##### [global_webdriver_http_sleep=](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L213)
-> def s_text text
+> def global_webdriver_http_sleep=(value)
-Get the first element that includes text.
+The amount to sleep in seconds before every webdriver http call.
-__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/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/text.rb#L51)
+##### [initialize](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L234)
-> def s_text_exact text
+> def initialize opts={}
-Get the first textfield that matches text.
+Creates a new driver
-__Parameters:__
+```ruby
+require 'rubygems'
+require 'appium_lib'
- [String] text - the text that the tag must match
+# platformName takes a string or a symbol.
-__Returns:__
+# Start iOS driver
+opts = { caps: { platformName: :ios, app: '/path/to/MyiOS.app' } }
+Appium::Driver.new(opts).start_driver
- [Text]
+# Start Android driver
+opts = { caps: { platformName: :android, app: '/path/to/my.apk' } }
+Appium::Driver.new(apk).start_driver
+```
---
-
-##### [s_texts_exact](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/text.rb#L58)
-
-> def s_texts_exact text
-
-Get all static textfields that matches text.
-
__Parameters:__
- [String] text - the text that the tag must match
+ [Object] opts - A hash containing various options.
__Returns:__
- [Array<Text>]
+ [Driver]
--
-##### [window_size](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/window.rb#L5)
+##### [driver_attributes](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L308)
-> def window_size
+> def driver_attributes
-Get the window's size
+Returns a hash of the driver attributes
--
-##### [button](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/button.rb#L8)
+##### [device_is_android?](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L328)
-> def button text, number=0
+> def device_is_android?
-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
+ [Boolean]
--
-##### [buttons](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/button.rb#L19)
+##### [appium_server_version](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L344)
-> def buttons text=nil
+> def appium_server_version
-Get an array of button texts or button elements if text is provided.
+Returns the server's version info
-__Parameters:__
+```ruby
+{
+ "build" => {
+ "version" => "0.18.1",
+ "revision" => "d242ebcfd92046a974347ccc3a28f0e898595198"
+ }
+}
+```
- [String] text - the text to exactly match
-
__Returns:__
- [Array<String>, Array<Buttons>] either an array of button texts or an array of button elements if text is provided.
+ [Hash]
--
-##### [first_button](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/button.rb#L26)
+##### [absolute_app_path](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L350)
-> def first_button
+> def self.absolute_app_path app_path
-Get the first button element.
+Converts app_path to an absolute path.
__Returns:__
- [Button]
+ [String] APP_PATH as an absolute path
--
-##### [last_button](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/button.rb#L32)
+##### [server_url](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L374)
-> def last_button
+> def server_url
-Get the last button element.
+Get the server url
__Returns:__
- [Button]
+ [String] the server url
--
-##### [button_exact](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/button.rb#L39)
+##### [restart](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L385)
-> def button_exact text
+> def restart
-Get the first button element that exactly matches text.
+Restarts the driver
-__Parameters:__
-
- [String] text - the text to match exactly
-
__Returns:__
- [Button]
+ [Driver] the driver
--
-##### [buttons_exact](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/button.rb#L46)
+##### [driver](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L392)
-> def buttons_exact text
+> def driver
-Get all button elements that exactly match text.
+Returns the driver
-__Parameters:__
-
- [String] text - the text to match exactly
-
__Returns:__
- [Array<Button>]
+ [Driver] the driver
--
-##### [e_buttons](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/button.rb#L52)
+##### [screenshot](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L402)
-> def e_buttons
+> def screenshot png_save_path
-Get an array of button elements.
+Takes a png screenshot and saves to the target path.
-__Returns:__
+Example: screenshot '/tmp/hi.png'
- [Array<Button>]
-
---
-
-##### [button_num](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/button.rb#L72)
-
-> def button_num text, number=1
-
-Expected to be called via button method.
-
-Get the button element exactly matching text and
-occurrence. number=2 means the 2nd occurrence.
-
-find the second Sign In button
-
-b = e_button 'Sign In', 2
-
-Button order will change in iOS vs Android
-so if there's no button found at number then
-return the first button.
-
__Parameters:__
- [String] text - the text to match
+ [String] png_save_path - the full path to save the png
- [Integer] number - the button occurance to return. 1 = first button
-
__Returns:__
- [Button] the button that matches text and number
+ [nil]
--
-##### [find_eles_attr](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/helper.rb#L8) ios
+##### [driver_quit](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L409)
-> def find_eles_attr tag_name, attribute
+> def driver_quit
-iOS only. Android uses uiautomator instead of uiautomation.
-Get an array of attribute values from elements exactly matching tag name.
+Quits the driver
-__Parameters:__
-
- [String] tag_name - the tag name to find
-
- [String] attribute - the attribute to collect
-
__Returns:__
- [Array<String>] an array of strings containing the attribute from found elements of type tag_name.
+ [void]
--
-##### [find_2_eles_attr](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/helper.rb#L29) ios
+##### [start_driver](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L417)
-> def find_2_eles_attr tag_name_1, tag_name_2, attribute
+> def start_driver
-iOS only. Android doesn't use find_2_eles_attr.
-Get an array of attribute values from elements exactly matching tag name.
+Creates a new global driver and quits the old one if it exists.
-__Parameters:__
+__Returns:__
- [String] tag_name_1 - the 1st tag name to find
+ [Selenium::WebDriver] the new global driver
- [String] tag_name_2 - the 2nd tag name to find
+--
- [String] attribute - the attribute to collect
+##### [no_wait](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L443)
-__Returns:__
+> def no_wait
- [Array<String>] an array of strings containing the attribute from found elements of type tag_name.
+Set implicit wait and default_wait to zero.
--
-##### [ios_password](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/helper.rb#L50) ios
+##### [set_wait](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L462)
-> def ios_password length=1
+> def set_wait timeout=nil
-iOS only. On Android uiautomator always returns an empty string for EditText password.
+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.
-Password character returned from value of UIASecureTextField
+```ruby`
+set_wait 2
+set_wait 3
+set_wait # 2
+````
+
__Parameters:__
- [Integer] length - the length of the password to generate
+ [Integer] timeout - the timeout in seconds
__Returns:__
- [String] the returned string is of size length
+ [void]
--
-##### [get_page_class](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/helper.rb#L55) ios
+##### [default_wait](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L480)
-> def get_page_class
+> def default_wait
-Returns a string of class counts.
+Returns the default client side wait.
+This value is independent of what the server is using
---
+__Returns:__
-##### [page_class](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/helper.rb#L81) ios
+ [Integer]
-> def page_class
-
-
-
--
-##### [get_page](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/helper.rb#L93) ios
+##### [exists](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L496)
-> def get_page element=source_window(0)
+> def exists pre_check=0, post_check=@default_wait, &search_block
-Returns a string of interesting elements. iOS only.
+Returns existence of element.
-Defaults to inspecting the 1st windows source only.
-use get_page(get_source) for all window sources
+Example:
+exists { button('sign in') } ? puts('true') : puts('false')
+
__Parameters:__
- [Object] element - the element to search. omit to search everything
+ [Integer] pre_check - the amount in seconds to set the
+wait to before checking existance
-__Returns:__
+ [Integer] post_check - the amount in seconds to set the
+wait to after checking existance
- [String]
+ [Block] search_block - the block to call
---
-
-##### [page](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/helper.rb#L161) ios
-
-> def page window_number = -1
-
-Prints a string of interesting elements to the console.
-
__Returns:__
- [void]
+ [Boolean]
--
-##### [source_window](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/helper.rb#L176) ios
+##### [execute_script](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L520)
-> def source_window window_number=0
+> def execute_script script, *args
-Gets the JSON source of window number
+The same as @driver.execute_script
__Parameters:__
- [Integer] window_number - the int index of the target window
+ [String] script - the script to execute
+ [*args] args - the args to pass to the script
+
__Returns:__
- [JSON]
+ [Object]
--
-##### [page_window](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/helper.rb#L183) ios
+##### [find_elements](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L528)
-> def page_window window_number=0
+> def find_elements *args
-Prints parsed page source to console.
-example: page_window 0
+Calls @driver.find_elements
__Parameters:__
- [Integer] window_number - the int index of the target window
+ [*args] args - the args to use
---
-
-##### [fast_duration](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/helper.rb#L190) ios
-
-> def fast_duration
-
-The fastest duration that can be used on iOS.
-
__Returns:__
- [Float]
+ [Array<Element>] Array is empty when no elements are found.
--
-##### [id](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/helper.rb#L197) ios
+##### [find_element](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L536)
-> def id id
+> def find_element *args
-Find by id. Useful for selendroid
+Calls @driver.find_elements
__Parameters:__
- [String] id - the id to search for
+ [*args] args - the args to use
__Returns:__
[Element]
--
-##### [ios_version](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/helper.rb#L205) ios
+##### [x](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L543)
-> def ios_version
+> def x
-Return the iOS version as an array of integers
+Quit the driver and Pry.
+quit and exit are reserved by Pry.
__Returns:__
- [Array<Integer>]
+ [void]
--
-##### [alert_click](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/alert.rb#L14) ios
+##### [NoArgMethods](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L7)
-> def alert_click value
+> NoArgMethods = {
-iOS only
-Tap the alert button identified by value.
-Click the ok button:
- alert_click 'OK'
-Click the first button:
- alert_click 0
+--
-__Parameters:__
+##### [app_strings](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L23)
- [Integer, String] value - either an integer index of the button or the button's name
+> def app_strings
-__Returns:__
+Return the hash of all localization strings.
+```ruby
+app_strings #=> "TransitionsTitle"=>"Transitions", "WebTitle"=>"Web"
+```
- [void]
-
--
-##### [alert_text](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/alert.rb#L21) ios
+##### [background_app](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L29)
-> def alert_text
+> def background_app
-Get the alert message text.
+Backgrounds the app for a set number of seconds.
+This is a blocking application
-__Returns:__
-
- [String]
-
--
-##### [alert_accept](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/alert.rb#L30) ios
+##### [current_activity](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L34)
-> def alert_accept
+> def current_activity
-Accept the alert.
-__Returns:__
- [void]
-
--
-##### [alert_accept_text](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/alert.rb#L40) ios
+##### [launch](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L36)
-> def alert_accept_text
+> def launch
-Get the text of the alert's accept button.
-The last button is considered "accept." on iOS 6
-The first button is considered "accept." on iOS 7
+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
-##### [alert_dismiss](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/alert.rb#L64) ios
+Reset the device, relaunching the application.
-> def alert_dismiss
+--
-Dismiss the alert.
+##### [shake](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L42)
-__Returns:__
+> def shake
- [void]
+Cause the device to shake
--
-##### [alert_dismiss_text](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/alert.rb#L74) ios
+##### [toggle_flight_mode](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L45)
-> def alert_dismiss_text
+> def toggle_flight_mode
-Get the text of the alert's dismiss button.
-The first button is considered "dismiss." on iOS 6
-The last button is considered "dismiss." on iOS 7
+toggle flight mode on or off
-__Returns:__
-
- [String]
-
--
-##### [find](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/generic.rb#L61) ios
+##### [complex_find](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L48)
-> def find text
+> def complex_find
-Return the first element matching text.
+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'
+```
+
__Parameters:__
- [String] text - the text to search for
+ [Symbol] mod - If present, will be the 0th element in the selector array.
-__Returns:__
+ [Array<Object>] selectors - The selectors to find elements with.
- [Element] the first matching element
-
--
-##### [finds](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/generic.rb#L84) ios
+##### [hide_keyboard](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L60)
-> def finds text
+> def hide_keyboard
-Return all elements matching text.
+Hide the onscreen keyboard
__Parameters:__
- [String] text - the text to search for
+ [String] close_key - the name of the key which closes the keyboard.
+Defaults to 'Done'.
-__Returns:__
-
- [Array<Element>] all matching elements
-
--
-##### [text](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/generic.rb#L99) ios
+##### [key_event](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L69)
-> def text text
+> def key_event
-Return the first element matching text.
+Send a key event to the device.
__Parameters:__
- [String] text - the text to search for
+ [integer] key - The key to send.
-__Returns:__
+ [String] metastate - The state the metakeys should be in when sending the key.
- [Element] the first matching element
-
--
-##### [texts](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/generic.rb#L108) ios
+##### [push_file](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L74)
-> def texts text
+> def push_file
-Return all elements matching text.
+Place a file in a specific location on the device.
__Parameters:__
- [String] text - the text to search for
+ [String] path - The absolute path on the device to store data at.
-__Returns:__
+ [String] data - Raw file data to be sent to the device.
- [Array<Element>] all matching elements
-
--
-##### [name](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/generic.rb#L130) ios
+##### [pull_file](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L79)
-> def name name
+> def pull_file
-Return the first element matching name.
-on Android name is content description
-on iOS name is the accessibility label or the text.
-
+Retrieve a file from the device. This can retrieve an absolute path or
+a path relative to the installed app (iOS only).
```ruby
-# find element with name or label containing example and access the name attribute.
-name('example').name
-
-# find element with name or label containing example and access the label attribute.
-name('example').label
+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:__
- [String] name - the name to search for
+ [String] path - Either an absolute path OR, for iOS devices, a path relative to the app, as described.
-__Returns:__
-
- [Element] the first matching element
-
--
-##### [name_exact](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/generic.rb#L135) ios
+##### [extend_search_contexts](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L277)
-> def name_exact name
+> def extend_search_contexts
--
-##### [names](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/generic.rb#L154) ios
+##### [accessiblity_id_find](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L277)
-> def names name
+> def accessiblity_id_find
-Return all elements matching name.
-on Android name is content description
-on iOS name is the accessibility label or the text.
+find_element/s with their accessibility_id
-__Parameters:__
+```ruby
+ find_elements :accessibility_id, 'Animation'
+```
- [String] name - the name to search for
-
-__Returns:__
-
- [Array<Element>] all matching elements
-
--
-##### [escape_single_quote](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/generic.rb#L162) ios
+##### [add_touch_actions](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L283)
-> def escape_single_quote text_to_escape
+> def add_touch_actions
--
-##### [locate_single_textfield](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/textfield.rb#L8) ios
+##### [current_context=](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L307)
-> def locate_single_textfield js
+> def current_context=
-UIATextField & UIASecureTextField methods
+Change the context to the given context.
+```ruby
+current_context= "NATIVE_APP"
+```
-Find textfield and then secure elements in one server call
-to match Android.
+__Parameters:__
+ [String] The - context to change to
+
--
-##### [textfields](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/textfield.rb#L18) ios
+##### [current_context](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L315)
-> def textfields
+> def current_context
-Get an array of textfield texts.
-Does not respect implicit wait because we're using execute_script.
+
__Returns:__
- [Array<String>]
+ [String] The context currently being used.
--
-##### [e_textfields](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/textfield.rb#L24) ios
+##### [available_contexts](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L318)
-> def e_textfields
+> def available_contexts
-Get an array of textfield elements.
+
__Returns:__
- [Array<Textfield>]
+ [Array<String>] All usable contexts, as an array of strings.
--
-##### [first_textfield](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/textfield.rb#L30) ios
+##### [within_context](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L328)
-> def first_textfield
+> def within_context(context)
-Get the first textfield element.
+Perform a block within the given context, then switch back to the starting context.
+```ruby
+within_context('NATIVE_APP') do
+ find_element [:tag, "button"]
+```
-__Returns:__
+__Parameters:__
- [Textfield]
+ [String] context - The context to switch to for the duration of the block.
--
-##### [last_textfield](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/textfield.rb#L36) ios
+##### [switch_to_default_context](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L335)
-> def last_textfield
+> def switch_to_default_context
-Get the last textfield element.
+Change to the default context. This is equivalent to `current_context= nil`.
-__Returns:__
-
- [Textfield]
-
--
-##### [textfield](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/textfield.rb#L43) ios
+##### [pinch](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/multi_touch.rb#L30)
-> def textfield text
+> def pinch(percentage=25, auto_perform=true)
-Get the first textfield that matches 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, Integer] text - the text to match exactly. If int then the textfield at that index is returned.
+ [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)
- [Textfield]
-
--
-##### [textfield_include](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/textfield.rb#L57) ios
+##### [zoom](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/multi_touch.rb#L58)
-> def textfield_include text
+> def zoom(percentage=200, auto_perform=true)
-Get the first textfield that includes 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 the textfield must include
+ [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)
- [Textfield]
-
--
-##### [textfield_exact](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/textfield.rb#L64) ios
+##### [initialize](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/multi_touch.rb#L79)
-> def textfield_exact text
+> def initialize
-Get the first textfield that exactly matches text.
+Create a new multi-action
-__Parameters:__
-
- [String] text - the text the textfield must exactly match
-
__Returns:__
- [Textfield]
+ [MultiTouch] a new instance of MultiTouch
--
-##### [textfield_named](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/textfield.rb#L70) ios
+##### [add](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/multi_touch.rb#L85)
-> def textfield_named target_name
+> def add(chain)
-Get the first textfield that exactly matches name
+Add a touch_action to be performed
-__Returns:__
+__Parameters:__
- [Element]
+ [TouchAction] chain - The action to add to the chain
--
-##### [wait](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L33)
+##### [perform](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/multi_touch.rb#L90)
-> def wait max_wait=30, interval=0.5, &block
+> def perform
-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.
+Ask Appium to perform the actions
-Example: wait { name('back').click }
+--
-Give up after 30 seconds.
+##### [ACTIONS](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L12)
-__Parameters:__
+> ACTIONS = [:move_to, :press_for_duration, :press, :release, :tap, :wait, :perform]
- [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/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L45)
+##### [COMPLEX_ACTIONS](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L13)
-> def ignore &block
+> COMPLEX_ACTIONS = [:swipe]
-Return block.call and ignore any exceptions.
+
--
-##### [wait_true](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L55)
+##### [actions](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L27)
-> def wait_true max_wait=30, interval=0.5, &block
+> def actions
-Check every 0.5 seconds to see if block.call returns true. nil is considered a failure.
-Give up after 30 seconds.
+Returns the value of attribute actions
-__Parameters:__
+--
- [Integer] max_wait - the maximum time in seconds to wait for
+##### [initialize](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L29)
- [Float] interval - the time in seconds to wait after calling the block
+> def initialize
- [Block] block - the block to call
+
__Returns:__
- [Object] the result of block.call
+ [TouchAction] a new instance of TouchAction
--
-##### [back](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L68)
+##### [move_to](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L37)
-> def back
+> def move_to(opts)
-Navigate back.
+Move to the given co-ordinates.
-__Returns:__
+__Parameters:__
- [void]
+ [Hash] opts - a customizable set of options
--
-##### [session_id](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L73)
+##### [press_for_duration](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L47)
-> def session_id
+> def press_for_duration(element, x, y, duration)
-For Sauce Labs reporting. Returns the current session id.
+Press down for a specific duration.
---
-
-##### [xpath](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L81)
-
-> def xpath xpath_str
-
-Returns the first element that matches the provided xpath.
-
__Parameters:__
- [String] xpath_str - the XPath string
+ [WebDriver::Element] element - the element to press.
-__Returns:__
+ [integer] x - x co-ordinate to press on.
- [Element]
+ [integer] y - y co-ordinate to press on.
+ [integer] duration - Number of seconds to press.
+
--
-##### [xpaths](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L89)
+##### [press](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L58)
-> def xpaths xpath_str
+> def press(opts)
-Returns all elements that match the provided xpath.
+Press a finger onto the screen. Finger will stay down until you call
+`release`.
__Parameters:__
- [String] xpath_str - the XPath string
+ [Hash] opts - a customizable set of options
-__Returns:__
-
- [Array<Element>]
-
--
-##### [ele_index](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L97)
+##### [release](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L69)
-> def ele_index tag_name, index
+> def release(opts=nil)
-Get the element of type tag_name at matching index.
+Remove a finger from the screen.
__Parameters:__
- [String] tag_name - the tag name to find
+ [Hash] opts - a customizable set of options
- [Integer] index - the index
+--
-__Returns:__
+##### [tap](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L80)
- [Element] the found element of type tag_name
+> def tap(opts)
---
+Touch a point on the screen
-##### [find_eles](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L106)
+__Parameters:__
-> def find_eles tag_name
+ [Hash] opts - a customizable set of options
-Get all elements exactly matching tag name
+--
-__Parameters:__
+##### [wait](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L88)
- [String] tag_name - the tag name to find
+> def wait(seconds)
-__Returns:__
+Pause for a number of seconds before the next action
- [Array<Element>] the found elements of type tag_name
+__Parameters:__
+ [integer] seconds - Number of seconds to pause for
+
--
-##### [find_ele_by_text](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L114)
+##### [swipe](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L99)
-> def find_ele_by_text tag, text
+> def swipe(opts)
-Get the first tag that exactly matches tag and text.
+Convenience method to peform a swipe.
__Parameters:__
- [String] tag - the tag name to match
+ [Hash] opts - a customizable set of options
- [String] text - the text to exactly match
+--
-__Returns:__
+##### [perform](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L114)
- [Element] the element of type tag exactly matching text
+> def perform
+Ask the driver to perform all actions in this action chain.
+
--
-##### [find_eles_by_text](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L122)
+##### [cancel](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L120)
-> def find_eles_by_text tag, text
+> def cancel
-Get all tags that exactly match tag and text.
+Does nothing, currently.
-__Parameters:__
+--
- [String] tag - the tag name to match
+##### [chain_method](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L128)
- [String] text - the text to exactly match
+> def chain_method(method, args=nil)
-__Returns:__
- [Array<Element>] the elements of type tag exactly matching text
--
-##### [find_ele_by_attr_include](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L131)
+##### [args_with_ele_ref](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L137)
-> def find_ele_by_attr_include tag, attr, value
+> def args_with_ele_ref(args)
-Get the first tag by attribute that exactly matches value.
-__Parameters:__
- [String] tag - the tag name to match
+--
- [String] attr - the attribute to compare
+##### [wait](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L33)
- [String] value - the value of the attribute that the element must include
+> def wait max_wait=30, interval=0.5, &block
-__Returns:__
+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.
- [Element] the element of type tag who's attribute includes value
+Example: wait { name('back').click }
---
+Give up after 30 seconds.
-##### [find_eles_by_attr_include](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L140)
+__Parameters:__
-> def find_eles_by_attr_include tag, attr, value
+ [Integer] max_wait - the maximum time in seconds to wait for.
+Note that max wait 0 means infinity.
-Get tags by attribute that include value.
+ [Float] interval - the time in seconds to wait after calling the block
-__Parameters:__
+ [Block] block - the block to call
- [String] tag - the tag name to match
+__Returns:__
- [String] attr - the attribute to compare
+ [Object] the result of block.call
- [String] value - the value of the attribute that the element must include
+--
-__Returns:__
+##### [ignore](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L49)
- [Array<Element>] the elements of type tag who's attribute includes value
+> def ignore &block
+Return block.call and ignore any exceptions.
+
--
-##### [find_ele_by_text_include](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L149)
+##### [wait_true](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L64)
-> def find_ele_by_text_include tag, text
+> def wait_true max_wait=30, interval=0.5, &block
-Get the first tag that includes text.
-element.attribute(:text).include? text
+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:__
- [String] tag - the tag name to match
+ [Integer] max_wait - the maximum time in seconds to wait for
- [String] text - the text the element must include
+ [Float] interval - the time in seconds to wait after calling the block
+ [Block] block - the block to call
+
__Returns:__
- [Element] the element of type tag that includes text
+ [Object] the result of block.call
--
-##### [find_eles_by_text_include](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L158)
+##### [back](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L81)
-> def find_eles_by_text_include tag, text
+> def back
-Get the tags that include text.
-element.attribute(:text).include? text
+Navigate back.
-__Parameters:__
+__Returns:__
- [String] tag - the tag name to match
+ [void]
- [String] text - the text the element must include
+--
-__Returns:__
+##### [session_id](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L86)
- [Array<Element>] the elements of type tag that includes text
+> def session_id
+For Sauce Labs reporting. Returns the current session id.
+
--
-##### [first_ele](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L165)
+##### [xpath](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L94)
-> def first_ele tag_name
+> def xpath xpath_str
-Get the first tag that matches tag_name
+Returns the first element that matches the provided xpath.
__Parameters:__
- [String] tag_name - the tag to match
+ [String] xpath_str - the XPath string
__Returns:__
[Element]
--
-##### [last_ele](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L173)
+##### [xpaths](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L102)
-> def last_ele tag_name
+> def xpaths xpath_str
-Get the last tag that matches tag_name
+Returns all elements that match the provided xpath.
__Parameters:__
- [String] tag_name - the tag to match
+ [String] xpath_str - the XPath string
__Returns:__
- [Element]
+ [Array<Element>]
--
-##### [source](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L179)
+##### [source](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L108)
> def source
-Prints a JSON view of the current page
+Prints xml of the current page
__Returns:__
[void]
--
-##### [get_source](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L185)
+##### [get_source](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L118)
> def get_source
-Gets a JSON view of the current page
+Returns XML string for the current page
+Same as driver.page_source
__Returns:__
- [JSON]
+ [String]
--
-##### [find_name](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L194)
+##### [result](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L125)
-> def find_name name
+> def result
-Returns the first element that exactly matches name
+Returns the value of attribute result
-__Parameters:__
+--
- [String] name - the name to exactly match
+##### [initialize](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L127)
-__Returns:__
+> def initialize
- [Element]
---
-##### [find_names](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L202)
+__Returns:__
-> def find_names name
+ [CountElements] a new instance of CountElements
-Returns all elements that exactly match name
+--
-__Parameters:__
+##### [reset](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L131)
- [String] name - the name to exactly match
+> def reset
-__Returns:__
- [Array<Element>]
--
-##### [tag](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L210)
+##### [start_element](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L136)
-> def tag tag_name
+> def start_element name, attrs = []
-Returns the first element matching tag_name
+http://nokogiri.org/Nokogiri/XML/SAX/Document.html
-__Parameters:__
+--
- [String] tag_name - the tag_name to search for
+##### [formatted_result](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L140)
-__Returns:__
+> def formatted_result
- [Element]
+
--
-##### [tags](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L218)
+##### [get_page_class](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L151)
-> def tags tag_name
+> def get_page_class
-Returns all elements matching tag_name
+Returns a string of class counts.
-__Parameters:__
+--
- [String] tag_name - the tag_name to search for
+##### [page_class](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L162)
-__Returns:__
+> def page_class
- [Element]
+Count all classes on screen and print to stdout.
+Useful for appium_console.
--
-##### [px_to_window_rel](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L228)
+##### [px_to_window_rel](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L172)
> def px_to_window_rel opts={}
Converts pixel values to window relative values
@@ -1137,20 +1050,12 @@
px_to_window_rel x: 50, y: 150
```
--
-##### [lazy_load_strings](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L238)
+##### [xml_keys](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L189)
-> def lazy_load_strings
-
-
-
---
-
-##### [xml_keys](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L245)
-
> def xml_keys target
Search strings.xml's values for target.
__Parameters:__
@@ -1161,11 +1066,11 @@
[Array]
--
-##### [xml_values](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L253)
+##### [xml_values](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L197)
> def xml_values target
Search strings.xml's keys for target.
@@ -1177,11 +1082,11 @@
[Array]
--
-##### [resolve_id](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L261)
+##### [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.
@@ -1193,568 +1098,486 @@
[String]
--
-##### [raise_no_element_error](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L267)
+##### [window_size](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/element/window.rb#L5)
-> def raise_no_element_error
+> def window_size
-Used to error when finding a single element fails.
+Get the window's size
--
-##### [value](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/patch.rb#L32)
+##### [UIAStaticText](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/text.rb#L4) ios
-> def value
+> UIAStaticText = 'UIAStaticText'
-Returns the value attribute
-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)
+##### [s_text](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/text.rb#L10) ios
-> def name
+> def s_text value
-Returns the name attribute
+Find the first UIAStaticText that contains value or by index.
+If int then the UIAStaticText at that index is returned.
-Fixes NoMethodError: undefined method `name' for Selenium::WebDriver::Element
+__Parameters:__
---
+ [String, Integer] value - the value to find.
-##### [location_rel](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/patch.rb#L51)
-
-> 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 }
+ [UIAStaticText]
--
-##### [CORE](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L16)
+##### [s_texts](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/text.rb#L18) ios
-> CORE = [ :array, :hash, :class, :file, :dir, :bigdecimal, :rational, :struct, :openstruct, :method, :unboundmethod ]
+> def s_texts value
+Find all UIAStaticText containing value.
+__Parameters:__
---
+ [String] value - the value to search for
-##### [awesome_openstruct](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L18)
+__Returns:__
-> def awesome_openstruct target
+ [Array<UIAStaticText>]
-
-
--
-##### [load_appium_txt](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L27)
+##### [first_s_text](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/text.rb#L24) ios
-> def load_appium_txt opts
+> def first_s_text
-Load appium.txt (toml format) into system ENV
-the basedir of this file + appium.txt is what's used
+Find the first UIAStaticText.
-__Parameters:__
-
- [Hash] opts - file: '/path/to/appium.txt', verbose: true
-
__Returns:__
- [Array<String>] the require files. nil if require doesn't exist
+ [UIAStaticText]
--
-##### [promote_singleton_appium_methods](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L145)
+##### [last_s_text](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/text.rb#L30) ios
-> def self.promote_singleton_appium_methods main_module
+> def last_s_text
+Find the last UIAStaticText.
+__Returns:__
+ [UIAStaticText]
+
--
-##### [promote_appium_methods](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L175)
+##### [s_text_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/text.rb#L37) ios
-> def self.promote_appium_methods class_array
+> def s_text_exact value
-Promote appium methods to class instance methods
+Find the first UIAStaticText that exactly matches value.
-To promote methods to all classes:
-
-```ruby
-Appium.promote_appium_methods Object
-```
-
__Parameters:__
- [Array<Class>] class_array - An array of classes
+ [String] value - the value to match exactly
---
-
-##### [default_wait](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L550)
-
-> def default_wait
-
-Returns the default client side wait.
-This value is independent of what the server is using
-
__Returns:__
- [Integer]
+ [UIAStaticText]
--
-##### [app_path](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/ios/element/text.rb#L44) ios
-> def app_path
+> def s_texts_exact value
-Returns the value of attribute app_path
+Find all UIAStaticTexts that exactly match value.
---
+__Parameters:__
-##### [app_name](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
+ [String] value - the value to match exactly
-> def app_name
+__Returns:__
-Returns the value of attribute app_name
+ [Array<UIAStaticText>]
--
-##### [device](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/ios/element/text.rb#L50) ios
-> def device
+> def e_s_texts
-Returns the value of attribute device
+Find all UIAStaticTexts.
---
+__Returns:__
-##### [app_package](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
+ [Array<UIAStaticText>]
-> def app_package
-
-Returns the value of attribute app_package
-
--
-##### [app_activity](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/ios/element/alert.rb#L5) ios
-> def app_activity
+> def alert_accept
-Returns the value of attribute app_activity
+Accept the alert.
---
+__Returns:__
-##### [app_wait_activity](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
+ [void]
-> def app_wait_activity
-
-Returns the value of attribute app_wait_activity
-
--
-##### [sauce_username](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/ios/element/alert.rb#L13) ios
-> def sauce_username
+> def alert_dismiss
-Returns the value of attribute sauce_username
+Dismiss the alert.
---
+__Returns:__
-##### [sauce_access_key](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
+ [void]
-> def sauce_access_key
-
-Returns the value of attribute sauce_access_key
-
--
-##### [port](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
+##### [uiautomation_find](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/mobile_methods.rb#L10) ios
-> def port
+> def uiautomation_find
-Returns the value of attribute port
+find_element/s can be used with a [UIAutomation command](https://developer.apple.com/library/ios/documentation/ToolsLanguages/Reference/UIAWindowClassReference/UIAWindow/UIAWindow.html#//apple_ref/doc/uid/TP40009930).
+```ruby
+ find_elements :uiautomation, 'elements()
+```
+
--
-##### [debug](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
+##### [UIAButton](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/button.rb#L4) ios
-> def debug
+> UIAButton = 'UIAButton'
-Returns the value of attribute debug
+
--
-##### [export_session](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
+##### [button](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/button.rb#L10) ios
-> def export_session
+> def button value
-Returns the value of attribute export_session
+Find the first UIAButton that contains value or by index.
+If int then the UIAButton at that index is returned.
---
+__Parameters:__
-##### [device_cap](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
+ [String, Integer] value - the value to exactly match.
-> def device_cap
+__Returns:__
-Returns the value of attribute device_cap
+ [UIAButton]
--
-##### [compress_xml](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
+##### [buttons](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/button.rb#L19) ios
-> def compress_xml
+> def buttons value
-Returns the value of attribute compress_xml
+Find all UIAButtons containing value
---
+__Parameters:__
-##### [custom_url](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
+ [String] value - the value to search for
-> def custom_url
+__Returns:__
-Returns the value of attribute custom_url
+ [Array<UIAButton>]
--
-##### [global_webdriver_http_sleep](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L210)
+##### [first_button](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/button.rb#L25) ios
-> def global_webdriver_http_sleep
+> def first_button
-The amount to sleep in seconds before every webdriver http call.
+Find the first UIAButton.
---
+__Returns:__
-##### [global_webdriver_http_sleep=](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L210)
+ [UIAButton]
-> def global_webdriver_http_sleep=(value)
-
-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)
+##### [last_button](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/button.rb#L31) ios
-> def initialize opts={}
+> def last_button
-Creates a new driver.
-:device is :android, :ios, or :selendroid
+Find the last UIAButton.
-```ruby
-# Options include:
-:app_path, :app_name, :app_package, :app_activity,
-:app_wait_activity, :sauce_username, :sauce_access_key,
-:port, :os, :debug
+__Returns:__
-require 'rubygems'
-require 'appium_lib'
+ [UIAButton]
-# Start iOS driver
-app = { device: :ios, app_path: '/path/to/MyiOS.app'}
-Appium::Driver.new(app).start_driver
+--
-# 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'
-}
+##### [button_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/button.rb#L38) ios
-Appium::Driver.new(apk).start_driver
-```
+> def button_exact value
+Find the first UIAButton that exactly matches value.
+
__Parameters:__
- [Object] opts - A hash containing various options.
+ [String] value - the value to match exactly
__Returns:__
- [Driver]
+ [UIAButton]
--
-##### [status](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L363)
+##### [buttons_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/button.rb#L45) ios
-> def status
+> def buttons_exact value
-Returns the status payload
+Find all UIAButtons that exactly match 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 match exactly
-`status["value"]["build"]["revision"]`
-`f2a2bc3782e4b0370d97a097d7e04913cf008995`
-
__Returns:__
- [JSON]
+ [Array<UIAButton>]
--
-##### [server_version](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L369)
+##### [e_buttons](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/button.rb#L51) ios
-> def server_version
+> def e_buttons
-Returns the server's version string
+Find all UIAButtons.
__Returns:__
- [String]
+ [Array<UIAButton>]
--
-##### [absolute_app_path](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L412)
+##### [find](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/generic.rb#L7) ios
-> def self.absolute_app_path app_path
+> def find value
-Converts environment variable APP_PATH to an absolute path.
+Find the first element containing value
-__Returns:__
+__Parameters:__
- [String] APP_PATH as an absolute path
+ [String] value - the value to search for
---
-
-##### [server_url](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L436)
-
-> def server_url
-
-Get the server url for sauce or local based on env vars.
-
__Returns:__
- [String] the server url
+ [Element]
--
-##### [restart](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L447)
+##### [finds](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/generic.rb#L14) ios
-> def restart
+> def finds value
-Restarts the driver
+Find all elements containing value
+__Parameters:__
+
+ [String] value - the value to search for
+
__Returns:__
- [Driver] the driver
+ [Array<Element>]
--
-##### [driver](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L454)
+##### [find_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/generic.rb#L21) ios
-> def driver
+> def find_exact value
-Returns the driver
+Find the first element exactly matching value
+__Parameters:__
+
+ [String] value - the value to search for
+
__Returns:__
- [Driver] the driver
+ [Element]
--
-##### [screenshot](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L464)
+##### [finds_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/generic.rb#L28) ios
-> def screenshot png_save_path
+> def finds_exact value
-Takes a png screenshot and saves to the target path.
+Find all elements exactly matching 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]
+ [Array<Element>]
--
-##### [driver_quit](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L471)
+##### [UIATextField](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/textfield.rb#L3) ios
-> def driver_quit
+> UIATextField = 'UIATextField'
-Quits the driver
-__Returns:__
- [void]
-
--
-##### [start_driver](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L479)
+##### [UIASecureTextField](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/textfield.rb#L4) ios
-> def start_driver
+> UIASecureTextField = 'UIASecureTextField'
-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/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L513)
+##### [textfield](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/textfield.rb#L38) ios
-> def no_wait
+> def textfield value
-Set implicit wait and default_wait to zero.
+Find the first TextField that contains value or by index.
+If int then the TextField at that index is returned.
---
+__Parameters:__
-##### [set_wait](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L532)
+ [String, Integer] value - the text to match exactly.
-> def set_wait timeout=nil
+__Returns:__
-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.
+ [TextField]
-```ruby`
-set_wait 2
-set_wait 3
-set_wait # 2
+--
-````
+##### [textfields](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/textfield.rb#L54) ios
+> def textfields value
+
+Find all TextFields containing value.
+
__Parameters:__
- [Integer] timeout - the timeout in seconds
+ [String] value - the value to search for
__Returns:__
- [void]
+ [Array<TextField>]
--
-##### [exists](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L566)
+##### [first_textfield](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/textfield.rb#L60) ios
-> def exists pre_check=0, post_check=@default_wait, &search_block
+> def first_textfield
-Returns existence of element.
+Find the first TextField.
-Example:
+__Returns:__
-exists { button('sign in') } ? puts('true') : puts('false')
+ [TextField]
-__Parameters:__
+--
- [Integer] pre_check - the amount in seconds to set the
-wait to before checking existance
+##### [last_textfield](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/textfield.rb#L66) ios
- [Integer] post_check - the amount in seconds to set the
-wait to after checking existance
+> def last_textfield
- [Block] search_block - the block to call
+Find the last TextField.
__Returns:__
- [Boolean]
+ [TextField]
--
-##### [execute_script](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L590)
+##### [textfield_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/textfield.rb#L73) ios
-> def execute_script script, *args
+> def textfield_exact value
-The same as @driver.execute_script
+Find the first TextField that exactly matches value.
__Parameters:__
- [String] script - the script to execute
+ [String] value - the value to match exactly
- [*args] args - the args to pass to the script
-
__Returns:__
- [Object]
+ [TextField]
--
-##### [mobile](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L606)
+##### [textfields_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/textfield.rb#L80) ios
-> def mobile method, *args
+> def textfields_exact value
-Helper method for mobile gestures
+Find all TextFields that exactly match value.
-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
+ [String] value - the value to match exactly
- [*args] args - the args to pass to the method
-
__Returns:__
- [Object]
+ [Array<TextField>]
--
-##### [find_elements](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L617)
+##### [e_textfields](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/textfield.rb#L86) ios
-> def find_elements *args
+> def e_textfields
-Calls @driver.find_elements
+Find all TextFields.
-__Parameters:__
-
- [*args] args - the args to use
-
__Returns:__
- [Array<Element>] Array is empty when no elements are found.
+ [Array<TextField>]
--
-##### [find_element](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L625)
+##### [value](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/patch.rb#L10)
-> def find_element *args
+> def value
-Calls @driver.find_elements
+Returns the value attribute
-__Parameters:__
+Fixes NoMethodError: undefined method `value' for Selenium::WebDriver::Element
- [*args] args - the args to use
+--
-__Returns:__
+##### [name](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/patch.rb#L17)
- [Element]
+> def name
+Returns the name attribute
+
+Fixes NoMethodError: undefined method `name' for Selenium::WebDriver::Element
+
--
-##### [x](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L632)
+##### [location_rel](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/patch.rb#L29)
-> def x
+> def location_rel
-Quit the driver and Pry.
-quit and exit are reserved by Pry.
+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:__
- [void]
+ [OpenStruct] the relative x, y in a struct. ex: { x: 0.50, y: 0.20 }
--