docs/ios_docs.md in appium_lib-0.6.3 vs docs/ios_docs.md in appium_lib-0.6.4
- old
+ new
@@ -1,442 +1,649 @@
-##### [load_appium_txt](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L12)
+##### [s_texts](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/element/text.rb#L8)
-> def load_appium_txt opts
+> def s_texts
-Load appium.txt (toml format) into system ENV
-the basedir of this file + appium.txt is what's used
+Get an array of text texts.
-__Parameters:__
+__Returns:__
- [Hash] opts - file: '/path/to/appium.txt', verbose: true
+ [Array<String>]
+--
+
+##### [e_s_texts](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/element/text.rb#L14)
+
+> def e_s_texts
+
+Get an array of text elements.
+
__Returns:__
- [Array<String>] the require files. nil if require doesn't exist
+ [Array<Text>]
--
-##### [promote_appium_methods](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L129)
+##### [first_s_text](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/element/text.rb#L20)
-> def self.promote_appium_methods class_array
+> def first_s_text
-Promote appium methods to class instance methods
+Get the first text element.
-To promote methods to all classes:
+__Returns:__
-```ruby
-Appium.promote_appium_methods Object
-```
+ [Text]
-__Parameters:__
+--
- [Array<Class>] class_array - An array of classes
+##### [last_s_text](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/element/text.rb#L26)
+> def last_s_text
+
+Get the last text element
+
+__Returns:__
+
+ [Text]
+
--
-##### [default_wait](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L426)
+##### [s_text](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/element/text.rb#L33)
-> def default_wait
+> def s_text text
-Returns the default client side wait.
-This value is independent of what the server is using
+Get the first element that includes text.
+__Parameters:__
+
+ [String, Integer] text - the text to find. If int then the text at that index is returned.
+
__Returns:__
- [Integer]
+ [Text]
--
-##### [app_path](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L158)
+##### [s_text_exact](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/element/text.rb#L41)
-> def app_path
+> def s_text_exact text
-Returns the value of attribute app_path
+Get the first textfield that matches text.
+__Parameters:__
+
+ [String] text - the text that the tag must match
+
+__Returns:__
+
+ [Text]
+
--
-##### [app_name](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L158)
+##### [window_size](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/element/window.rb#L5)
-> def app_name
+> def window_size
-Returns the value of attribute app_name
+Get the window's size
--
-##### [device](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L158)
+##### [button](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/element/button.rb#L8)
-> def device
+> def button text, number=0
-Returns the value of attribute device
+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
+
--
-##### [app_package](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L158)
+##### [buttons](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/element/button.rb#L19)
-> def app_package
+> def buttons text=nil
-Returns the value of attribute app_package
+Get an array of button texts or button elements if text is provided.
+__Parameters:__
+
+ [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.
+
--
-##### [app_activity](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L158)
+##### [first_button](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/element/button.rb#L26)
-> def app_activity
+> def first_button
-Returns the value of attribute app_activity
+Get the first button element.
+__Returns:__
+
+ [Button]
+
--
-##### [app_wait_activity](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L158)
+##### [last_button](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/element/button.rb#L32)
-> def app_wait_activity
+> def last_button
-Returns the value of attribute app_wait_activity
+Get the last button element.
+__Returns:__
+
+ [Button]
+
--
-##### [sauce_username](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L158)
+##### [button_exact](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/element/button.rb#L39)
-> def sauce_username
+> def button_exact text
-Returns the value of attribute sauce_username
+Get the first button element that exactly matches text.
+__Parameters:__
+
+ [String] text - the text to match exactly
+
+__Returns:__
+
+ [Button]
+
--
-##### [sauce_access_key](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L158)
+##### [buttons_exact](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/element/button.rb#L46)
-> def sauce_access_key
+> def buttons_exact text
-Returns the value of attribute sauce_access_key
+Get all button elements that exactly match text.
+__Parameters:__
+
+ [String] text - the text to match exactly
+
+__Returns:__
+
+ [Array<Button>]
+
--
-##### [port](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L158)
+##### [e_buttons](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/element/button.rb#L52)
-> def port
+> def e_buttons
-Returns the value of attribute port
+Get an array of button elements.
+__Returns:__
+
+ [Array<Button>]
+
--
-##### [debug](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L158)
+##### [button_num](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/element/button.rb#L72)
-> def debug
+> def button_num text, number=1
-Returns the value of attribute debug
+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
+
+ [Integer] number - the button occurance to return. 1 = first button
+
+__Returns:__
+
+ [Button] the button that matches text and number
+
--
-##### [initialize](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L190)
+##### [find_eles_attr](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/helper.rb#L8) ios
-> def initialize opts={}
+> def find_eles_attr tag_name, attribute
-Creates a new driver.
-:device is :android, :ios, or :selendroid
+iOS only. Android uses uiautomator instead of uiautomation.
+Get an array of attribute values from elements exactly matching tag name.
-```ruby
-# Options include:
-:app_path, :app_name, :app_package, :app_activity,
-:app_wait_activity, :sauce_username, :sauce_access_key,
-:port, :os, :debug
+__Parameters:__
-require 'rubygems'
-require 'appium_lib'
+ [String] tag_name - the tag name to find
-# Start iOS driver
-app = { device: :ios, app_path: '/path/to/MyiOS.app'}
-Appium::Driver.new(app).start_driver
+ [String] attribute - the attribute to collect
-# 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'
-}
+__Returns:__
-Appium::Driver.new(apk).start_driver
-```
+ [Array<String>] an array of strings containing the attribute from found elements of type tag_name.
+--
+
+##### [find_2_eles_attr](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/helper.rb#L29) ios
+
+> def find_2_eles_attr tag_name_1, tag_name_2, attribute
+
+iOS only. Android doesn't use find_2_eles_attr.
+Get an array of attribute values from elements exactly matching tag name.
+
__Parameters:__
- [Object] opts - A hash containing various options.
+ [String] tag_name_1 - the 1st tag name to find
+ [String] tag_name_2 - the 2nd tag name to find
+
+ [String] attribute - the attribute to collect
+
__Returns:__
- [Driver]
+ [Array<String>] an array of strings containing the attribute from found elements of type tag_name.
--
-##### [status](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L284)
+##### [password](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/helper.rb#L50) ios
-> def status
+> def password length=1
-Returns the status payload
+iOS only. On Android uiautomator always returns an empty string for EditText password.
-```ruby
-{"status"=>0,
- "value"=>
- {"build"=>
- {"version"=>"0.8.2",
- "revision"=>"f2a2bc3782e4b0370d97a097d7e04913cf008995"}},
- "sessionId"=>"8f4b34a7-a9a9-4ac5-b125-36258143446a"}
-```
+Password character returned from value of UIASecureTextField
- Discover the Appium rev running on the server.
+__Parameters:__
-`status["value"]["build"]["revision"]`
-`f2a2bc3782e4b0370d97a097d7e04913cf008995`
+ [Integer] length - the length of the password to generate
__Returns:__
- [JSON]
+ [String] the returned string is of size length
--
-##### [server_version](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L290)
+##### [get_page_class](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/helper.rb#L55) ios
-> def server_version
+> def get_page_class
-Returns the server's version string
+Returns a string of class counts.
+--
+
+##### [page_class](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/helper.rb#L81) ios
+
+> def page_class
+
+
+
+--
+
+##### [get_page](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/helper.rb#L90) ios
+
+> def get_page element=get_source
+
+Returns a string of interesting elements. iOS only.
+
+__Parameters:__
+
+ [Object] element - the element to search. omit to search everything
+
__Returns:__
[String]
--
-##### [absolute_app_path](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L331)
+##### [page](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/helper.rb#L135) ios
-> def absolute_app_path
+> def page
-Converts environment variable APP_PATH to an absolute path.
+Prints a string of interesting elements to the console.
__Returns:__
- [String] APP_PATH as an absolute path
+ [void]
--
-##### [server_url](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L347)
+##### [source_window](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/helper.rb#L143) ios
-> def server_url
+> def source_window window_number=0
-Get the server url for sauce or local based on env vars.
+Gets the JSON source of window number
+__Parameters:__
+
+ [Integer] window_number - the int index of the target window
+
__Returns:__
- [String] the server url
+ [JSON]
--
-##### [restart](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L357)
+##### [page_window](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/helper.rb#L150) ios
-> def restart
+> def page_window window_number=0
-Restarts the driver
+Prints parsed page source to console.
+example: page_window 0
-__Returns:__
+__Parameters:__
- [Driver] the driver
+ [Integer] window_number - the int index of the target window
--
-##### [driver](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L364)
+##### [fast_duration](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/helper.rb#L157) ios
-> def driver
+> def fast_duration
-Returns the driver
+The fastest duration that can be used on iOS.
__Returns:__
- [Driver] the driver
+ [Float]
--
-##### [screenshot](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L374)
+##### [alert_click](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/element/alert.rb#L14) ios
-> def screenshot png_save_path
+> def alert_click value
-Takes a png screenshot and saves to the target path.
+iOS only
+Tap the alert button identified by value.
-Example: screenshot '/tmp/hi.png'
+Click the ok button:
+ alert_click 'OK'
+Click the first button:
+ alert_click 0
+
__Parameters:__
- [String] png_save_path - the full path to save the png
+ [Integer, String] value - either an integer index of the button or the button's name
__Returns:__
[void]
--
-##### [driver_quit](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L380)
+##### [alert_text](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/element/alert.rb#L21) ios
-> def driver_quit
+> def alert_text
-Quits the driver
+Get the alert message text.
__Returns:__
+ [String]
+
+--
+
+##### [alert_accept](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/element/alert.rb#L30) ios
+
+> def alert_accept
+
+Accept the alert.
+
+__Returns:__
+
[void]
--
-##### [start_driver](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L388)
+##### [alert_accept_text](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/element/alert.rb#L39) ios
-> def start_driver
+> def alert_accept_text
-Creates a new global driver and quits the old one if it exists.
+Get the text of the alert's accept button.
+The last button is considered "accept."
__Returns:__
- [Selenium::WebDriver] the new global driver
+ [String]
--
-##### [no_wait](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L412)
+##### [alert_dismiss](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/element/alert.rb#L48) ios
-> def no_wait
+> def alert_dismiss
-Set implicit wait to zero.
+Dismiss the alert.
+__Returns:__
+
+ [void]
+
--
-##### [set_wait](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L419)
+##### [alert_dismiss_text](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/element/alert.rb#L57) ios
-> def set_wait timeout=@default_wait
+> def alert_dismiss_text
-Set implicit wait to timeout, defaults to 30.
+Get the text of the alert's dismiss button.
+The first button is considered "dismiss."
+__Returns:__
+
+ [String]
+
+--
+
+##### [find](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/element/generic.rb#L61) ios
+
+> def find text
+
+Return the first element matching text.
+
__Parameters:__
- [Integer] timeout - the timeout in seconds
+ [String] text - the text to search for
__Returns:__
- [void]
+ [Element] the first matching element
--
-##### [exists](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L442)
+##### [finds](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/element/generic.rb#L83) ios
-> def exists pre_check=0, post_check=@default_wait, &search_block
+> def finds text
-Returns existence of element.
+Return all elements matching text.
-Example:
+__Parameters:__
-exists { button('sign in') } ? puts('true') : puts('false')
+ [String] text - the text to search for
+__Returns:__
+
+ [Array<Element>] all matching elements
+
+--
+
+##### [text](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/element/generic.rb#L97) ios
+
+> def text text
+
+Return the first element matching text.
+
__Parameters:__
- [Integer] pre_check - the amount in seconds to set the
-wait to before checking existance
+ [String] text - the text to search for
- [Integer] post_check - the amount in seconds to set the
-wait to after checking existance
+__Returns:__
- [Block] search_block - the block to call
+ [Element] the first matching element
+--
+
+##### [texts](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/element/generic.rb#L105) ios
+
+> def texts text
+
+Return all elements matching text.
+
+__Parameters:__
+
+ [String] text - the text to search for
+
__Returns:__
- [Boolean]
+ [Array<Element>] all matching elements
--
-##### [execute_script](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L464)
+##### [name](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/element/generic.rb#L117) ios
-> def execute_script script, *args
+> def name name
-The same as @driver.execute_script
+Return the first element matching name.
+on Android name is content description
+on iOS name is the accessibility label or the text.
__Parameters:__
- [String] script - the script to execute
+ [String] name - the name to search for
- [*args] args - the args to pass to the script
+__Returns:__
+ [Element] the first matching element
+
+--
+
+##### [names](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/element/generic.rb#L126) ios
+
+> def names name
+
+Return all elements 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:__
- [Object]
+ [Array<Element>] all matching elements
--
-##### [mobile](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L480)
+##### [textfields](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/element/textfield.rb#L10) ios
-> def mobile method, *args
+> def textfields
-Helper method for mobile gestures
+Get an array of textfield texts.
-https://github.com/appium/appium/wiki/Automating-mobile-gestures
+__Returns:__
-driver.execute_script 'mobile: swipe', endX: 100, endY: 100, duration: 0.01
+ [Array<String>]
-becomes
+--
-mobile :swipe, endX: 100, endY: 100, duration: 0.01
+##### [e_textfields](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/element/textfield.rb#L16) ios
-__Parameters:__
+> def e_textfields
- [String, Symbol] method - the method to execute
+Get an array of textfield elements.
- [*args] args - the args to pass to the method
+__Returns:__
+ [Array<Textfield>]
+
+--
+
+##### [first_textfield](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/element/textfield.rb#L22) ios
+
+> def first_textfield
+
+Get the first textfield element.
+
__Returns:__
- [Object]
+ [Textfield]
--
-##### [find_elements](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L491)
+##### [last_textfield](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/element/textfield.rb#L29) ios
-> def find_elements *args
+> def last_textfield
-Calls @driver.find_elements
+Get the last textfield element.
+__Returns:__
+
+ [Textfield]
+
+--
+
+##### [textfield](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/element/textfield.rb#L37) ios
+
+> def textfield text
+
+Get the first textfield that matches text.
+
__Parameters:__
- [*args] args - the args to use
+ [String, Integer] text - the text to match exactly. If int then the textfield at that index is returned.
__Returns:__
- [Array<Element>] Array is empty when no elements are found.
+ [Textfield]
--
-##### [find_element](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L499)
+##### [textfield_include](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/element/textfield.rb#L51) ios
-> def find_element *args
+> def textfield_include text
-Calls @driver.find_elements
+Get the first textfield that includes text.
__Parameters:__
- [*args] args - the args to use
+ [String] text - the text the textfield must include
__Returns:__
- [Element]
+ [Textfield]
--
-##### [x](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/driver.rb#L506)
+##### [textfield_exact](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/ios/element/textfield.rb#L64) ios
-> def x
+> def textfield_exact text
-Quit the driver and Pry.
-quit and exit are reserved by Pry.
+Get the first textfield that exactly matches text.
+__Parameters:__
+
+ [String] text - the text the textfield must exactly match
+
__Returns:__
- [void]
+ [Textfield]
--
-##### [wait](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/helper.rb#L33)
+##### [wait](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/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.
@@ -459,19 +666,19 @@
[Object] the result of block.call
--
-##### [ignore](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/helper.rb#L45)
+##### [ignore](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/helper.rb#L45)
> def ignore &block
Return block.call and ignore any exceptions.
--
-##### [wait_true](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/helper.rb#L55)
+##### [wait_true](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/helper.rb#L55)
> def wait_true max_wait=30, interval=0.5, &block
Check every 0.5 seconds to see if block.call returns true. nil is considered a failure.
Give up after 30 seconds.
@@ -488,11 +695,11 @@
[Object] the result of block.call
--
-##### [id](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/helper.rb#L69)
+##### [id](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/helper.rb#L69)
> def id id
Find by id. Useful for selendroid
@@ -504,11 +711,11 @@
[Element]
--
-##### [back](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/helper.rb#L75)
+##### [back](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/helper.rb#L75)
> def back
Navigate back.
@@ -516,19 +723,19 @@
[void]
--
-##### [session_id](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/helper.rb#L80)
+##### [session_id](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/helper.rb#L80)
> def session_id
For Sauce Labs reporting. Returns the current session id.
--
-##### [xpath](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/helper.rb#L88)
+##### [xpath](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/helper.rb#L88)
> def xpath xpath_str
Returns the first element that matches the provided xpath.
@@ -540,11 +747,11 @@
[Element]
--
-##### [xpaths](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/helper.rb#L96)
+##### [xpaths](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/helper.rb#L96)
> def xpaths xpath_str
Returns all elements that match the provided xpath.
@@ -556,11 +763,11 @@
[Array<Element>]
--
-##### [ele_index](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/helper.rb#L104)
+##### [ele_index](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/helper.rb#L104)
> def ele_index tag_name, index
Get the element of type tag_name at matching index.
@@ -574,11 +781,11 @@
[Element] the found element of type tag_name
--
-##### [find_eles](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/helper.rb#L112)
+##### [find_eles](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/helper.rb#L112)
> def find_eles tag_name
Get all elements exactly matching tag name
@@ -590,11 +797,11 @@
[Array<Element>] the found elements of type tag_name
--
-##### [find_ele_by_text](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/helper.rb#L120)
+##### [find_ele_by_text](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/helper.rb#L120)
> def find_ele_by_text tag, text
Get the first tag that exactly matches tag and text.
@@ -608,11 +815,11 @@
[Element] the element of type tag exactly matching text
--
-##### [find_eles_by_text](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/helper.rb#L128)
+##### [find_eles_by_text](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/helper.rb#L128)
> def find_eles_by_text tag, text
Get all tags that exactly match tag and text.
@@ -626,11 +833,11 @@
[Array<Element>] the elements of type tag exactly matching text
--
-##### [find_ele_by_attr_include](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/helper.rb#L137)
+##### [find_ele_by_attr_include](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/helper.rb#L137)
> def find_ele_by_attr_include tag, attr, value
Get the first tag by attribute that exactly matches value.
@@ -646,11 +853,11 @@
[Element] the element of type tag who's attribute includes value
--
-##### [find_eles_by_attr_include](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/helper.rb#L146)
+##### [find_eles_by_attr_include](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/helper.rb#L146)
> def find_eles_by_attr_include tag, attr, value
Get tags by attribute that include value.
@@ -666,11 +873,11 @@
[Array<Element>] the elements of type tag who's attribute includes value
--
-##### [find_ele_by_text_include](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/helper.rb#L155)
+##### [find_ele_by_text_include](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/helper.rb#L155)
> def find_ele_by_text_include tag, text
Get the first tag that includes text.
element.attribute(:text).include? text
@@ -685,11 +892,11 @@
[Element] the element of type tag that includes text
--
-##### [find_eles_by_text_include](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/helper.rb#L164)
+##### [find_eles_by_text_include](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/helper.rb#L164)
> def find_eles_by_text_include tag, text
Get the tags that include text.
element.attribute(:text).include? text
@@ -704,11 +911,11 @@
[Array<Element>] the elements of type tag that includes text
--
-##### [first_ele](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/helper.rb#L171)
+##### [first_ele](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/helper.rb#L171)
> def first_ele tag_name
Get the first tag that matches tag_name
@@ -720,11 +927,11 @@
[Element]
--
-##### [last_ele](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/helper.rb#L179)
+##### [last_ele](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/helper.rb#L179)
> def last_ele tag_name
Get the last tag that matches tag_name
@@ -736,11 +943,11 @@
[Element]
--
-##### [source](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/helper.rb#L185)
+##### [source](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/helper.rb#L185)
> def source
Prints a JSON view of the current page
@@ -748,11 +955,11 @@
[void]
--
-##### [get_source](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/helper.rb#L191)
+##### [get_source](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/helper.rb#L191)
> def get_source
Gets a JSON view of the current page
@@ -760,11 +967,11 @@
[JSON]
--
-##### [find_name](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/helper.rb#L200)
+##### [find_name](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/helper.rb#L200)
> def find_name name
Returns the first element that exactly matches name
@@ -776,11 +983,11 @@
[Element]
--
-##### [find_names](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/helper.rb#L208)
+##### [find_names](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/helper.rb#L208)
> def find_names name
Returns all elements that exactly match name
@@ -792,11 +999,11 @@
[Array<Element>]
--
-##### [tag](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/helper.rb#L216)
+##### [tag](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/helper.rb#L216)
> def tag tag_name
Returns the first element matching tag_name
@@ -808,11 +1015,11 @@
[Element]
--
-##### [px_to_window_rel](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/helper.rb#L226)
+##### [px_to_window_rel](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/helper.rb#L226)
> def px_to_window_rel opts={}
Converts pixel values to window relative values
@@ -820,696 +1027,505 @@
px_to_window_rel x: 50, y: 150
```
--
-##### [s_texts](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/element/text.rb#L8)
+##### [value](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/patch.rb#L32)
-> def s_texts
+> def value
-Get an array of text texts.
+Returns the value attribute
-__Returns:__
+Fixes NoMethodError: undefined method `value' for Selenium::WebDriver::Element
- [Array<String>]
-
--
-##### [e_s_texts](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/element/text.rb#L14)
+##### [name](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/patch.rb#L39)
-> def e_s_texts
+> def name
-Get an array of text elements.
+Returns the name attribute
-__Returns:__
+Fixes NoMethodError: undefined method `name' for Selenium::WebDriver::Element
- [Array<Text>]
-
--
-##### [first_s_text](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/element/text.rb#L20)
+##### [tag_name](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/patch.rb#L46)
-> def first_s_text
+> def tag_name
-Get the first text element.
+Returns the type attribute
-__Returns:__
+Fixes Selenium::WebDriver::Error::UnknownError: Not yet implemented
- [Text]
-
--
-##### [last_s_text](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/element/text.rb#L26)
+##### [location_rel](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/common/patch.rb#L58)
-> def last_s_text
+> def location_rel
-Get the last text element
+For use with mobile tap.
-__Returns:__
+```ruby
+execute_script 'mobile: tap', :x => 0.0, :y => 0.98
+```
- [Text]
+https://github.com/appium/appium/wiki/Automating-mobile-gestures
---
-
-##### [s_text](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/element/text.rb#L33)
-
-> def s_text text
-
-Get the first element that includes text.
-
-__Parameters:__
-
- [String, Integer] text - the text to find. If int then the text at that index is returned.
-
__Returns:__
- [Text]
+ [OpenStruct] the relative x, y in a struct. ex: { x: 0.50, y: 0.20 }
--
-##### [s_text_exact](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/element/text.rb#L41)
+##### [CORE](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L16)
-> def s_text_exact text
+> CORE = [ :array, :hash, :class, :file, :dir, :bigdecimal, :rational, :struct, :openstruct, :method, :unboundmethod ]
-Get the first textfield that matches text.
-__Parameters:__
- [String] text - the text that the tag must match
-
-__Returns:__
-
- [Text]
-
--
-##### [window_size](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/element/window.rb#L5)
+##### [awesome_openstruct](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L18)
-> def window_size
+> def awesome_openstruct target
-Get the window's size
---
-##### [button](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/element/button.rb#L8)
-
-> def button text, number=0
-
-Find a button by text and optionally number.
-
-__Parameters:__
-
- [String, Integer] text - the text to exactly match. If int then the button at that index is returned.
-
- [Integer] number - the occurrence of the button matching text. Defaults to the first button.
-
-__Returns:__
-
- [Button] the button found with text and matching number
-
--
-##### [buttons](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/element/button.rb#L19)
+##### [load_appium_txt](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L28)
-> def buttons text=nil
+> def load_appium_txt opts
-Get an array of button texts or button elements if text is provided.
+Load appium.txt (toml format) into system ENV
+the basedir of this file + appium.txt is what's used
__Parameters:__
- [String] text - the text to exactly match
+ [Hash] opts - file: '/path/to/appium.txt', verbose: true
__Returns:__
- [Array<String>, Array<Buttons>] either an array of button texts or an array of button elements if text is provided.
+ [Array<String>] the require files. nil if require doesn't exist
--
-##### [first_button](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/element/button.rb#L26)
+##### [promote_appium_methods](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L147)
-> def first_button
+> def self.promote_appium_methods class_array
-Get the first button element.
+Promote appium methods to class instance methods
-__Returns:__
+To promote methods to all classes:
- [Button]
+```ruby
+Appium.promote_appium_methods Object
+```
---
+__Parameters:__
-##### [last_button](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/element/button.rb#L32)
+ [Array<Class>] class_array - An array of classes
-> def last_button
-
-Get the last button element.
-
-__Returns:__
-
- [Button]
-
--
-##### [button_exact](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/element/button.rb#L39)
+##### [default_wait](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L444)
-> def button_exact text
+> def default_wait
-Get the first button element that exactly matches text.
+Returns the default client side wait.
+This value is independent of what the server is using
-__Parameters:__
-
- [String] text - the text to match exactly
-
__Returns:__
- [Button]
+ [Integer]
--
-##### [buttons_exact](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/element/button.rb#L46)
+##### [app_path](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L176)
-> def buttons_exact text
+> def app_path
-Get all button elements that exactly match text.
+Returns the value of attribute app_path
-__Parameters:__
-
- [String] text - the text to match exactly
-
-__Returns:__
-
- [Array<Button>]
-
--
-##### [e_buttons](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/element/button.rb#L52)
+##### [app_name](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L176)
-> def e_buttons
+> def app_name
-Get an array of button elements.
+Returns the value of attribute app_name
-__Returns:__
-
- [Array<Button>]
-
--
-##### [button_num](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/element/button.rb#L72)
+##### [device](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L176)
-> def button_num text, number=1
+> def device
-Expected to be called via button method.
+Returns the value of attribute device
-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
-
- [Integer] number - the button occurance to return. 1 = first button
-
-__Returns:__
-
- [Button] the button that matches text and number
-
--
-##### [find_eles_attr](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/helper.rb#L8) ios
+##### [app_package](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L176)
-> def find_eles_attr tag_name, attribute
+> def app_package
-iOS only. Android uses uiautomator instead of uiautomation.
-Get an array of attribute values from elements exactly matching tag name.
+Returns the value of attribute app_package
-__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.
-
--
-##### [find_2_eles_attr](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/helper.rb#L29) ios
+##### [app_activity](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L176)
-> def find_2_eles_attr tag_name_1, tag_name_2, attribute
+> def app_activity
-iOS only. Android doesn't use find_2_eles_attr.
-Get an array of attribute values from elements exactly matching tag name.
+Returns the value of attribute app_activity
-__Parameters:__
-
- [String] tag_name_1 - the 1st tag name to find
-
- [String] tag_name_2 - the 2nd 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.
-
--
-##### [password](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/helper.rb#L50) ios
+##### [app_wait_activity](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L176)
-> def password length=1
+> def app_wait_activity
-iOS only. On Android uiautomator always returns an empty string for EditText password.
+Returns the value of attribute app_wait_activity
-Password character returned from value of UIASecureTextField
-
-__Parameters:__
-
- [Integer] length - the length of the password to generate
-
-__Returns:__
-
- [String] the returned string is of size length
-
--
-##### [get_page_class](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/helper.rb#L55) ios
+##### [sauce_username](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L176)
-> def get_page_class
+> def sauce_username
-Returns a string of class counts.
+Returns the value of attribute sauce_username
--
-##### [page_class](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/helper.rb#L81) ios
+##### [sauce_access_key](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L176)
-> def page_class
+> def sauce_access_key
+Returns the value of attribute sauce_access_key
-
--
-##### [get_page](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/helper.rb#L90) ios
+##### [port](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L176)
-> def get_page element=get_source
+> def port
-Returns a string of interesting elements. iOS only.
+Returns the value of attribute port
-__Parameters:__
-
- [Object] element - the element to search. omit to search everything
-
-__Returns:__
-
- [String]
-
--
-##### [page](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/helper.rb#L135) ios
+##### [debug](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L176)
-> def page
+> def debug
-Prints a string of interesting elements to the console.
+Returns the value of attribute debug
-__Returns:__
-
- [void]
-
--
-##### [source_window](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/helper.rb#L143) ios
+##### [initialize](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L208)
-> def source_window window_number=0
+> def initialize opts={}
-Gets the JSON source of window number
+Creates a new driver.
+:device is :android, :ios, or :selendroid
-__Parameters:__
+```ruby
+# Options include:
+:app_path, :app_name, :app_package, :app_activity,
+:app_wait_activity, :sauce_username, :sauce_access_key,
+:port, :os, :debug
- [Integer] window_number - the int index of the target window
+require 'rubygems'
+require 'appium_lib'
-__Returns:__
+# Start iOS driver
+app = { device: :ios, app_path: '/path/to/MyiOS.app'}
+Appium::Driver.new(app).start_driver
- [JSON]
+# 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'
+}
---
+Appium::Driver.new(apk).start_driver
+```
-##### [page_window](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/helper.rb#L150) ios
-
-> def page_window window_number=0
-
-Prints parsed page source to console.
-example: page_window 0
-
__Parameters:__
- [Integer] window_number - the int index of the target window
+ [Object] opts - A hash containing various options.
---
-
-##### [fast_duration](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/helper.rb#L157) ios
-
-> def fast_duration
-
-The fastest duration that can be used on iOS.
-
__Returns:__
- [Float]
+ [Driver]
--
-##### [alert_click](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/element/alert.rb#L14) ios
+##### [status](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L302)
-> def alert_click value
+> def status
-iOS only
-Tap the alert button identified by value.
+Returns the status payload
-Click the ok button:
- alert_click 'OK'
+```ruby
+{"status"=>0,
+ "value"=>
+ {"build"=>
+ {"version"=>"0.8.2",
+ "revision"=>"f2a2bc3782e4b0370d97a097d7e04913cf008995"}},
+ "sessionId"=>"8f4b34a7-a9a9-4ac5-b125-36258143446a"}
+```
-Click the first button:
- alert_click 0
+ Discover the Appium rev running on the server.
-__Parameters:__
+`status["value"]["build"]["revision"]`
+`f2a2bc3782e4b0370d97a097d7e04913cf008995`
- [Integer, String] value - either an integer index of the button or the button's name
-
__Returns:__
- [void]
+ [JSON]
--
-##### [alert_text](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/element/alert.rb#L21) ios
+##### [server_version](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L308)
-> def alert_text
+> def server_version
-Get the alert message text.
+Returns the server's version string
__Returns:__
[String]
--
-##### [alert_accept](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/element/alert.rb#L30) ios
+##### [absolute_app_path](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L349)
-> def alert_accept
+> def absolute_app_path
-Accept the alert.
+Converts environment variable APP_PATH to an absolute path.
__Returns:__
- [void]
+ [String] APP_PATH as an absolute path
--
-##### [alert_accept_text](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/element/alert.rb#L39) ios
+##### [server_url](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L365)
-> def alert_accept_text
+> def server_url
-Get the text of the alert's accept button.
-The last button is considered "accept."
+Get the server url for sauce or local based on env vars.
__Returns:__
- [String]
+ [String] the server url
--
-##### [alert_dismiss](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/element/alert.rb#L48) ios
+##### [restart](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L375)
-> def alert_dismiss
+> def restart
-Dismiss the alert.
+Restarts the driver
__Returns:__
- [void]
+ [Driver] the driver
--
-##### [alert_dismiss_text](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/element/alert.rb#L57) ios
+##### [driver](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L382)
-> def alert_dismiss_text
+> def driver
-Get the text of the alert's dismiss button.
-The first button is considered "dismiss."
+Returns the driver
__Returns:__
- [String]
+ [Driver] the driver
--
-##### [find](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/element/generic.rb#L61) ios
+##### [screenshot](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L392)
-> def find text
+> def screenshot png_save_path
-Return the first element matching text.
+Takes a png screenshot and saves to the target path.
+Example: screenshot '/tmp/hi.png'
+
__Parameters:__
- [String] text - the text to search for
+ [String] png_save_path - the full path to save the png
__Returns:__
- [Element] the first matching element
+ [void]
--
-##### [finds](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/element/generic.rb#L83) ios
+##### [driver_quit](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L398)
-> def finds text
+> def driver_quit
-Return all elements matching text.
+Quits the driver
-__Parameters:__
-
- [String] text - the text to search for
-
__Returns:__
- [Array<Element>] all matching elements
+ [void]
--
-##### [text](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/element/generic.rb#L97) ios
+##### [start_driver](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L406)
-> def text text
+> def start_driver
-Return the first element matching text.
+Creates a new global driver and quits the old one if it exists.
-__Parameters:__
-
- [String] text - the text to search for
-
__Returns:__
- [Element] the first matching element
+ [Selenium::WebDriver] the new global driver
--
-##### [texts](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/element/generic.rb#L105) ios
+##### [no_wait](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L430)
-> def texts text
+> def no_wait
-Return all elements matching text.
+Set implicit wait to zero.
-__Parameters:__
-
- [String] text - the text to search for
-
-__Returns:__
-
- [Array<Element>] all matching elements
-
--
-##### [name](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/element/generic.rb#L117) ios
+##### [set_wait](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L437)
-> def name name
+> def set_wait timeout=@default_wait
-Return the first element matching name.
-on Android name is content description
-on iOS name is the accessibility label or the text.
+Set implicit wait to timeout, defaults to 30.
__Parameters:__
- [String] name - the name to search for
+ [Integer] timeout - the timeout in seconds
__Returns:__
- [Element] the first matching element
+ [void]
--
-##### [names](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/element/generic.rb#L126) ios
+##### [exists](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L460)
-> def names name
+> def exists pre_check=0, post_check=@default_wait, &search_block
-Return all elements matching name.
-on Android name is content description
-on iOS name is the accessibility label or the text.
+Returns existence of element.
-__Parameters:__
+Example:
- [String] name - the name to search for
+exists { button('sign in') } ? puts('true') : puts('false')
-__Returns:__
+__Parameters:__
- [Array<Element>] all matching elements
+ [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
-##### [textfields](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/element/textfield.rb#L10) ios
+ [Block] search_block - the block to call
-> def textfields
-
-Get an array of textfield texts.
-
__Returns:__
- [Array<String>]
+ [Boolean]
--
-##### [e_textfields](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/element/textfield.rb#L16) ios
+##### [execute_script](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L482)
-> def e_textfields
+> def execute_script script, *args
-Get an array of textfield elements.
+The same as @driver.execute_script
-__Returns:__
+__Parameters:__
- [Array<Textfield>]
+ [String] script - the script to execute
---
+ [*args] args - the args to pass to the script
-##### [first_textfield](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/element/textfield.rb#L22) ios
-
-> def first_textfield
-
-Get the first textfield element.
-
__Returns:__
- [Textfield]
+ [Object]
--
-##### [last_textfield](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/element/textfield.rb#L29) ios
+##### [mobile](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L498)
-> def last_textfield
+> def mobile method, *args
-Get the last textfield element.
+Helper method for mobile gestures
-__Returns:__
+https://github.com/appium/appium/wiki/Automating-mobile-gestures
- [Textfield]
+driver.execute_script 'mobile: swipe', endX: 100, endY: 100, duration: 0.01
---
+becomes
-##### [textfield](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/element/textfield.rb#L37) ios
+mobile :swipe, endX: 100, endY: 100, duration: 0.01
-> def textfield text
-
-Get the first textfield that matches text.
-
__Parameters:__
- [String, Integer] text - the text to match exactly. If int then the textfield at that index is returned.
+ [String, Symbol] method - the method to execute
+ [*args] args - the args to pass to the method
+
__Returns:__
- [Textfield]
+ [Object]
--
-##### [textfield_include](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/element/textfield.rb#L51) ios
+##### [find_elements](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L509)
-> def textfield_include text
+> def find_elements *args
-Get the first textfield that includes text.
+Calls @driver.find_elements
__Parameters:__
- [String] text - the text the textfield must include
+ [*args] args - the args to use
__Returns:__
- [Textfield]
+ [Array<Element>] Array is empty when no elements are found.
--
-##### [textfield_exact](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/ios/element/textfield.rb#L64) ios
+##### [find_element](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L517)
-> def textfield_exact text
+> def find_element *args
-Get the first textfield that exactly matches text.
+Calls @driver.find_elements
__Parameters:__
- [String] text - the text the textfield must exactly match
+ [*args] args - the args to use
__Returns:__
- [Textfield]
+ [Element]
--
-##### [value](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/patch.rb#L32)
+##### [x](https://github.com/appium/ruby_lib/blob/ccf8e375283bd9038fcf6c1db576f7539065e6d0/lib/appium_lib/driver.rb#L524)
-> def value
+> def x
-Returns the value attribute
+Quit the driver and Pry.
+quit and exit are reserved by Pry.
-Fixes NoMethodError: undefined method `value' for Selenium::WebDriver::Element
-
---
-
-##### [name](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/patch.rb#L39)
-
-> def name
-
-Returns the name attribute
-
-Fixes NoMethodError: undefined method `name' for Selenium::WebDriver::Element
-
---
-
-##### [tag_name](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/patch.rb#L46)
-
-> def tag_name
-
-Returns the type attribute
-
-Fixes Selenium::WebDriver::Error::UnknownError: Not yet implemented
-
---
-
-##### [location_rel](https://github.com/appium/ruby_lib/blob/509e7b81f02c6b0c4cdcb07aca034c9dad260ff4/lib/appium_lib/common/patch.rb#L58)
-
-> 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 }
+ [void]
--