appium_lib 0.24.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +17 -8
  3. data/android_tests/Gemfile +1 -0
  4. data/android_tests/LICENSE-2.0.txt +202 -0
  5. data/android_tests/Rakefile +61 -0
  6. data/android_tests/api.apk +0 -0
  7. data/android_tests/appium.txt +3 -0
  8. data/android_tests/flaky.txt +1 -0
  9. data/android_tests/lib/android/specs/android/dynamic.rb +5 -0
  10. data/android_tests/lib/android/specs/android/element/alert.rb +41 -0
  11. data/android_tests/lib/android/specs/android/element/button.rb +55 -0
  12. data/android_tests/lib/android/specs/android/element/generic.rb +48 -0
  13. data/android_tests/lib/android/specs/android/element/text.rb +39 -0
  14. data/android_tests/lib/android/specs/android/element/textfield.rb +60 -0
  15. data/android_tests/lib/android/specs/android/helper.rb +80 -0
  16. data/android_tests/lib/android/specs/android/patch.rb +14 -0
  17. data/android_tests/lib/android/specs/common/device.rb +117 -0
  18. data/android_tests/lib/android/specs/common/element/window.rb +9 -0
  19. data/android_tests/lib/android/specs/common/helper.rb +112 -0
  20. data/android_tests/lib/android/specs/common/patch.rb +69 -0
  21. data/android_tests/lib/android/specs/common/version.rb +9 -0
  22. data/android_tests/lib/android/specs/driver.rb +174 -0
  23. data/android_tests/lib/format.rb +49 -0
  24. data/android_tests/lib/run.rb +72 -0
  25. data/android_tests/readme.md +27 -0
  26. data/appium_lib.gemspec +8 -5
  27. data/docs/android_docs.md +1052 -716
  28. data/docs/ios_docs.md +657 -834
  29. data/docs_gen/make_docs.rb +1 -3
  30. data/ios_tests/Gemfile +1 -0
  31. data/ios_tests/LICENSE-2.0.txt +202 -0
  32. data/ios_tests/Rakefile +47 -0
  33. data/ios_tests/UICatalog.app.zip +0 -0
  34. data/ios_tests/UICatalog.app/12-6AM.png +0 -0
  35. data/ios_tests/UICatalog.app/12-6PM.png +0 -0
  36. data/ios_tests/UICatalog.app/6-12AM.png +0 -0
  37. data/ios_tests/UICatalog.app/6-12PM.png +0 -0
  38. data/ios_tests/UICatalog.app/Default-568h@2x.png +0 -0
  39. data/ios_tests/UICatalog.app/Default@2x.png +0 -0
  40. data/ios_tests/UICatalog.app/Info.plist +0 -0
  41. data/ios_tests/UICatalog.app/PkgInfo +1 -0
  42. data/ios_tests/UICatalog.app/UIButton_custom.png +0 -0
  43. data/ios_tests/UICatalog.app/UICatalog +0 -0
  44. data/ios_tests/UICatalog.app/blueButton.png +0 -0
  45. data/ios_tests/UICatalog.app/bookmarkImage.png +0 -0
  46. data/ios_tests/UICatalog.app/bookmarkImageHighlighted.png +0 -0
  47. data/ios_tests/UICatalog.app/divider.png +0 -0
  48. data/ios_tests/UICatalog.app/en.lproj/AlertsViewController.nib +0 -0
  49. data/ios_tests/UICatalog.app/en.lproj/ButtonsViewController.nib +0 -0
  50. data/ios_tests/UICatalog.app/en.lproj/ControlsViewController.nib +0 -0
  51. data/ios_tests/UICatalog.app/en.lproj/ImagesViewController.nib +0 -0
  52. data/ios_tests/UICatalog.app/en.lproj/Localizable.strings +0 -0
  53. data/ios_tests/UICatalog.app/en.lproj/MainWindow.nib +0 -0
  54. data/ios_tests/UICatalog.app/en.lproj/PickerViewController.nib +0 -0
  55. data/ios_tests/UICatalog.app/en.lproj/SearchBarController.nib +0 -0
  56. data/ios_tests/UICatalog.app/en.lproj/SegmentViewController.nib +0 -0
  57. data/ios_tests/UICatalog.app/en.lproj/TextFieldController.nib +0 -0
  58. data/ios_tests/UICatalog.app/en.lproj/TextViewController.nib +0 -0
  59. data/ios_tests/UICatalog.app/en.lproj/ToolbarViewController.nib +0 -0
  60. data/ios_tests/UICatalog.app/en.lproj/TransitionViewController.nib +0 -0
  61. data/ios_tests/UICatalog.app/en.lproj/WebViewController.nib +0 -0
  62. data/ios_tests/UICatalog.app/orangeslide.png +0 -0
  63. data/ios_tests/UICatalog.app/scene1.jpg +0 -0
  64. data/ios_tests/UICatalog.app/scene2.jpg +0 -0
  65. data/ios_tests/UICatalog.app/scene3.jpg +0 -0
  66. data/ios_tests/UICatalog.app/scene4.jpg +0 -0
  67. data/ios_tests/UICatalog.app/scene5.jpg +0 -0
  68. data/ios_tests/UICatalog.app/searchBarBackground.png +0 -0
  69. data/ios_tests/UICatalog.app/segment_check.png +0 -0
  70. data/ios_tests/UICatalog.app/segment_search.png +0 -0
  71. data/ios_tests/UICatalog.app/segment_tools.png +0 -0
  72. data/ios_tests/UICatalog.app/segmentedBackground.png +0 -0
  73. data/ios_tests/UICatalog.app/slider_ball.png +0 -0
  74. data/ios_tests/UICatalog.app/toolbarBackground.png +0 -0
  75. data/ios_tests/UICatalog.app/whiteButton.png +0 -0
  76. data/ios_tests/UICatalog.app/yellowslide.png +0 -0
  77. data/ios_tests/appium.txt +3 -0
  78. data/ios_tests/flaky.txt +1 -0
  79. data/ios_tests/lib/format.rb +25 -0
  80. data/ios_tests/lib/ios/specs/common/element/window.rb +15 -0
  81. data/ios_tests/lib/ios/specs/common/helper.rb +204 -0
  82. data/ios_tests/lib/ios/specs/common/patch.rb +50 -0
  83. data/ios_tests/lib/ios/specs/common/version.rb +17 -0
  84. data/ios_tests/lib/ios/specs/device/device.rb +82 -0
  85. data/ios_tests/lib/ios/specs/device/multi_touch.rb +12 -0
  86. data/ios_tests/lib/ios/specs/device/touch_actions.rb +15 -0
  87. data/ios_tests/lib/ios/specs/driver.rb +203 -0
  88. data/ios_tests/lib/ios/specs/ios/element/alert.rb +48 -0
  89. data/ios_tests/lib/ios/specs/ios/element/button.rb +58 -0
  90. data/ios_tests/lib/ios/specs/ios/element/generic.rb +35 -0
  91. data/ios_tests/lib/ios/specs/ios/element/text.rb +54 -0
  92. data/ios_tests/lib/ios/specs/ios/element/textfield.rb +123 -0
  93. data/ios_tests/lib/ios/specs/ios/helper.rb +27 -0
  94. data/ios_tests/lib/ios/specs/ios/patch.rb +30 -0
  95. data/ios_tests/lib/run.rb +106 -0
  96. data/ios_tests/readme.md +30 -0
  97. data/ios_tests/upload/sauce_storage.rb +64 -0
  98. data/ios_tests/upload/upload.rb +6 -0
  99. data/lib/appium_lib.rb +4 -14
  100. data/lib/appium_lib/android/dynamic.rb +30 -32
  101. data/lib/appium_lib/android/element/alert.rb +34 -33
  102. data/lib/appium_lib/android/element/button.rb +91 -0
  103. data/lib/appium_lib/android/element/generic.rb +51 -146
  104. data/lib/appium_lib/android/element/text.rb +54 -0
  105. data/lib/appium_lib/android/element/textfield.rb +46 -41
  106. data/lib/appium_lib/android/helper.rb +248 -417
  107. data/lib/appium_lib/android/mobile_methods.rb +17 -0
  108. data/lib/appium_lib/android/patch.rb +9 -8
  109. data/lib/appium_lib/awesome_print/ostruct.rb +33 -0
  110. data/lib/appium_lib/common/element/window.rb +9 -8
  111. data/lib/appium_lib/common/helper.rb +182 -243
  112. data/lib/appium_lib/common/patch.rb +65 -79
  113. data/lib/appium_lib/common/version.rb +2 -3
  114. data/lib/appium_lib/device/device.rb +339 -0
  115. data/lib/appium_lib/device/multi_touch.rb +94 -0
  116. data/lib/appium_lib/device/touch_actions.rb +142 -0
  117. data/lib/appium_lib/driver.rb +217 -306
  118. data/lib/appium_lib/ios/element/alert.rb +16 -92
  119. data/lib/appium_lib/ios/element/button.rb +55 -0
  120. data/lib/appium_lib/ios/element/generic.rb +27 -160
  121. data/lib/appium_lib/ios/element/text.rb +54 -0
  122. data/lib/appium_lib/ios/element/textfield.rb +78 -65
  123. data/lib/appium_lib/ios/helper.rb +300 -190
  124. data/lib/appium_lib/ios/mobile_methods.rb +17 -0
  125. data/lib/appium_lib/ios/patch.rb +55 -41
  126. data/lib/appium_lib/logger.rb +13 -0
  127. data/lib/appium_lib/rails/duplicable.rb +116 -0
  128. data/readme.md +6 -1
  129. data/release_notes.md +118 -0
  130. metadata +170 -12
  131. data/lib/appium_lib/common/element/button.rb +0 -83
  132. data/lib/appium_lib/common/element/text.rb +0 -61
@@ -1,349 +1,375 @@
1
- ##### [s_texts](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/text.rb#L10)
1
+ ##### [load_appium_txt](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L71)
2
2
 
3
- > def s_texts text=nil
3
+ > def self.load_appium_txt opts={}
4
4
 
5
- Get an array of text texts if text is nil else
6
- Get all static textfields that include text.
5
+ Load appium.txt (toml format)
6
+ the basedir of this file + appium.txt is what's used
7
+
8
+ ```
9
+ [caps]
10
+ app = "path/to/app"
11
+
12
+ [appium_lib]
13
+ port = 8080
14
+ ```
15
+
16
+ :app is expanded
17
+ :require is expanded
18
+ all keys are converted to symbols
7
19
 
8
20
  __Parameters:__
9
21
 
10
-      [String] text - the text to find.
22
+      [Hash] opts - file: '/path/to/appium.txt', verbose: true
11
23
 
12
24
  __Returns:__
13
25
 
14
-      [Array]
26
+      [hash] the symbolized hash with updated :app and :require keys
15
27
 
16
28
  --
17
29
 
18
- ##### [s_texts_names](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/text.rb#L18)
30
+ ##### [symbolize_keys](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L141)
19
31
 
20
- > def s_texts_names
32
+ > def self.symbolize_keys hash
21
33
 
34
+ convert all keys (including nested) to symbols
22
35
 
36
+ based on deep_symbolize_keys & deep_transform_keys from rails
37
+ https://github.com/rails/docrails/blob/a3b1105ada3da64acfa3843b164b14b734456a50/activesupport/lib/active_support/core_ext/hash/keys.rb#L84
23
38
 
24
39
  --
25
40
 
26
- ##### [e_s_texts](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/text.rb#L24)
41
+ ##### [promote_singleton_appium_methods](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L151)
27
42
 
28
- > def e_s_texts
29
-
30
- Get an array of text elements.
43
+ > def self.promote_singleton_appium_methods main_module
31
44
 
32
- __Returns:__
33
45
 
34
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Text>]
35
46
 
36
47
  --
37
48
 
38
- ##### [first_s_text](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/text.rb#L30)
49
+ ##### [promote_appium_methods](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L180)
39
50
 
40
- > def first_s_text
51
+ > def self.promote_appium_methods class_array
41
52
 
42
- Get the first text element.
53
+ Promote appium methods to class instance methods
43
54
 
44
- __Returns:__
55
+ To promote methods to all classes:
45
56
 
46
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Text]
57
+ ```ruby
58
+ Appium.promote_appium_methods Object
59
+ ```
47
60
 
48
- --
61
+ __Parameters:__
49
62
 
50
- ##### [last_s_text](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/text.rb#L36)
63
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Class>] class_array - An array of classes
51
64
 
52
- > def last_s_text
65
+ --
53
66
 
54
- Get the last text element
67
+ ##### [global_webdriver_http_sleep](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L213)
55
68
 
56
- __Returns:__
69
+ > def global_webdriver_http_sleep
57
70
 
58
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Text]
71
+ The amount to sleep in seconds before every webdriver http call.
59
72
 
60
73
  --
61
74
 
62
- ##### [s_text](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/text.rb#L43)
75
+ ##### [global_webdriver_http_sleep=](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L213)
63
76
 
64
- > def s_text text
77
+ > def global_webdriver_http_sleep=(value)
65
78
 
66
- Get the first element that includes text.
79
+ The amount to sleep in seconds before every webdriver http call.
67
80
 
68
- __Parameters:__
81
+ --
69
82
 
70
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String, Integer] text - the text to find. If int then the text at that index is returned.
83
+ ##### [initialize](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L234)
71
84
 
72
- __Returns:__
85
+ > def initialize opts={}
73
86
 
74
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Text]
87
+ Creates a new driver
75
88
 
76
- --
89
+ ```ruby
90
+ require 'rubygems'
91
+ require 'appium_lib'
77
92
 
78
- ##### [s_text_exact](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/text.rb#L51)
93
+ # platformName takes a string or a symbol.
79
94
 
80
- > def s_text_exact text
95
+ # Start iOS driver
96
+ opts = { caps: { platformName: :ios, app: '/path/to/MyiOS.app' } }
97
+ Appium::Driver.new(opts).start_driver
81
98
 
82
- Get the first textfield that matches text.
99
+ # Start Android driver
100
+ opts = { caps: { platformName: :android, app: '/path/to/my.apk' } }
101
+ Appium::Driver.new(apk).start_driver
102
+ ```
83
103
 
84
104
  __Parameters:__
85
105
 
86
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text that the tag must match
106
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Object] opts - A hash containing various options.
87
107
 
88
108
  __Returns:__
89
109
 
90
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Text]
110
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Driver]
91
111
 
92
112
  --
93
113
 
94
- ##### [s_texts_exact](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/text.rb#L58)
114
+ ##### [driver_attributes](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L308)
95
115
 
96
- > def s_texts_exact text
116
+ > def driver_attributes
97
117
 
98
- Get all static textfields that matches text.
118
+ Returns a hash of the driver attributes
119
+
120
+ --
121
+
122
+ ##### [device_is_android?](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L328)
123
+
124
+ > def device_is_android?
99
125
 
100
- __Parameters:__
101
126
 
102
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text that the tag must match
103
127
 
104
128
  __Returns:__
105
129
 
106
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Text>]
130
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Boolean]
107
131
 
108
132
  --
109
133
 
110
- ##### [window_size](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/window.rb#L5)
134
+ ##### [appium_server_version](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L344)
111
135
 
112
- > def window_size
136
+ > def appium_server_version
113
137
 
114
- Get the window's size
138
+ Returns the server's version info
115
139
 
116
- --
140
+ ```ruby
141
+ {
142
+ "build" => {
143
+ "version" => "0.18.1",
144
+ "revision" => "d242ebcfd92046a974347ccc3a28f0e898595198"
145
+ }
146
+ }
147
+ ```
117
148
 
118
- ##### [button](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/button.rb#L8)
149
+ __Returns:__
119
150
 
120
- > def button text, number=0
151
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash]
121
152
 
122
- Find a button by text and optionally number.
153
+ --
123
154
 
124
- __Parameters:__
155
+ ##### [absolute_app_path](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L350)
125
156
 
126
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String, Integer] text - the text to exactly match. If int then the button at that index is returned.
157
+ > def self.absolute_app_path app_path
127
158
 
128
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] number - the occurrence of the button matching text. Defaults to the first button.
159
+ Converts app_path to an absolute path.
129
160
 
130
161
  __Returns:__
131
162
 
132
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Button] the button found with text and matching number
163
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] APP_PATH as an absolute path
133
164
 
134
165
  --
135
166
 
136
- ##### [buttons](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/button.rb#L19)
137
-
138
- > def buttons text=nil
167
+ ##### [server_url](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L374)
139
168
 
140
- Get an array of button texts or button elements if text is provided.
141
-
142
- __Parameters:__
169
+ > def server_url
143
170
 
144
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text to exactly match
171
+ Get the server url
145
172
 
146
173
  __Returns:__
147
174
 
148
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<String>, Array<Buttons>] either an array of button texts or an array of button elements if text is provided.
175
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] the server url
149
176
 
150
177
  --
151
178
 
152
- ##### [first_button](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/button.rb#L26)
179
+ ##### [restart](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L385)
153
180
 
154
- > def first_button
181
+ > def restart
155
182
 
156
- Get the first button element.
183
+ Restarts the driver
157
184
 
158
185
  __Returns:__
159
186
 
160
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Button]
187
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Driver] the driver
161
188
 
162
189
  --
163
190
 
164
- ##### [last_button](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/button.rb#L32)
191
+ ##### [driver](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L392)
165
192
 
166
- > def last_button
193
+ > def driver
167
194
 
168
- Get the last button element.
195
+ Returns the driver
169
196
 
170
197
  __Returns:__
171
198
 
172
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Button]
199
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Driver] the driver
173
200
 
174
201
  --
175
202
 
176
- ##### [button_exact](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/button.rb#L39)
203
+ ##### [screenshot](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L402)
204
+
205
+ > def screenshot png_save_path
177
206
 
178
- > def button_exact text
207
+ Takes a png screenshot and saves to the target path.
179
208
 
180
- Get the first button element that exactly matches text.
209
+ Example: screenshot '/tmp/hi.png'
181
210
 
182
211
  __Parameters:__
183
212
 
184
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text to match exactly
213
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] png_save_path - the full path to save the png
185
214
 
186
215
  __Returns:__
187
216
 
188
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Button]
217
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[nil]
189
218
 
190
219
  --
191
220
 
192
- ##### [buttons_exact](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/button.rb#L46)
221
+ ##### [driver_quit](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L409)
193
222
 
194
- > def buttons_exact text
195
-
196
- Get all button elements that exactly match text.
197
-
198
- __Parameters:__
223
+ > def driver_quit
199
224
 
200
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text to match exactly
225
+ Quits the driver
201
226
 
202
227
  __Returns:__
203
228
 
204
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Button>]
229
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
205
230
 
206
231
  --
207
232
 
208
- ##### [e_buttons](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/button.rb#L52)
233
+ ##### [start_driver](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L417)
209
234
 
210
- > def e_buttons
235
+ > def start_driver
211
236
 
212
- Get an array of button elements.
237
+ Creates a new global driver and quits the old one if it exists.
213
238
 
214
239
  __Returns:__
215
240
 
216
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Button>]
241
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Selenium::WebDriver] the new global driver
217
242
 
218
243
  --
219
244
 
220
- ##### [button_num](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/element/button.rb#L72)
245
+ ##### [no_wait](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L443)
246
+
247
+ > def no_wait
248
+
249
+ Set implicit wait and default_wait to zero.
221
250
 
222
- > def button_num text, number=1
251
+ --
223
252
 
224
- Expected to be called via button method.
253
+ ##### [set_wait](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L462)
225
254
 
226
- Get the button element exactly matching text and
227
- occurrence. number=2 means the 2nd occurrence.
255
+ > def set_wait timeout=nil
228
256
 
229
- find the second Sign In button
257
+ Set implicit wait and default_wait to timeout, defaults to 30.
258
+ if set_wait is called without a param then the second to last
259
+ wait will be used.
230
260
 
231
- b = e_button 'Sign In', 2
261
+ ```ruby`
262
+ set_wait 2
263
+ set_wait 3
264
+ set_wait # 2
232
265
 
233
- Button order will change in iOS vs Android
234
- so if there's no button found at number then
235
- return the first button.
266
+ ````
236
267
 
237
268
  __Parameters:__
238
269
 
239
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text to match
240
-
241
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] number - the button occurance to return. 1 = first button
270
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] timeout - the timeout in seconds
242
271
 
243
272
  __Returns:__
244
273
 
245
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Button] the button that matches text and number
274
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
246
275
 
247
276
  --
248
277
 
249
- ##### [find_eles_attr](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/helper.rb#L8) ios
250
-
251
- > def find_eles_attr tag_name, attribute
278
+ ##### [default_wait](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L480)
252
279
 
253
- iOS only. Android uses uiautomator instead of uiautomation.
254
- Get an array of attribute values from elements exactly matching tag name.
255
-
256
- __Parameters:__
257
-
258
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag_name - the tag name to find
280
+ > def default_wait
259
281
 
260
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] attribute - the attribute to collect
282
+ Returns the default client side wait.
283
+ This value is independent of what the server is using
261
284
 
262
285
  __Returns:__
263
286
 
264
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<String>] an array of strings containing the attribute from found elements of type tag_name.
287
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer]
265
288
 
266
289
  --
267
290
 
268
- ##### [find_2_eles_attr](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/helper.rb#L29) ios
291
+ ##### [exists](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L496)
292
+
293
+ > def exists pre_check=0, post_check=@default_wait, &search_block
294
+
295
+ Returns existence of element.
269
296
 
270
- > def find_2_eles_attr tag_name_1, tag_name_2, attribute
297
+ Example:
271
298
 
272
- iOS only. Android doesn't use find_2_eles_attr.
273
- Get an array of attribute values from elements exactly matching tag name.
299
+ exists { button('sign in') } ? puts('true') : puts('false')
274
300
 
275
301
  __Parameters:__
276
302
 
277
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag_name_1 - the 1st tag name to find
303
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] pre_check - the amount in seconds to set the
304
+ wait to before checking existance
278
305
 
279
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag_name_2 - the 2nd tag name to find
306
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] post_check - the amount in seconds to set the
307
+ wait to after checking existance
280
308
 
281
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] attribute - the attribute to collect
309
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Block] search_block - the block to call
282
310
 
283
311
  __Returns:__
284
312
 
285
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<String>] an array of strings containing the attribute from found elements of type tag_name.
313
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Boolean]
286
314
 
287
315
  --
288
316
 
289
- ##### [ios_password](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/helper.rb#L50) ios
290
-
291
- > def ios_password length=1
317
+ ##### [execute_script](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L520)
292
318
 
293
- iOS only. On Android uiautomator always returns an empty string for EditText password.
319
+ > def execute_script script, *args
294
320
 
295
- Password character returned from value of UIASecureTextField
321
+ The same as @driver.execute_script
296
322
 
297
323
  __Parameters:__
298
324
 
299
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] length - the length of the password to generate
325
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] script - the script to execute
326
+
327
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[*args] args - the args to pass to the script
300
328
 
301
329
  __Returns:__
302
330
 
303
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] the returned string is of size length
331
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Object]
304
332
 
305
333
  --
306
334
 
307
- ##### [get_page_class](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/helper.rb#L55) ios
308
-
309
- > def get_page_class
335
+ ##### [find_elements](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L528)
310
336
 
311
- Returns a string of class counts.
337
+ > def find_elements *args
312
338
 
313
- --
339
+ Calls @driver.find_elements
314
340
 
315
- ##### [page_class](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/helper.rb#L81) ios
341
+ __Parameters:__
316
342
 
317
- > def page_class
343
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[*args] args - the args to use
318
344
 
345
+ __Returns:__
319
346
 
347
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>] Array is empty when no elements are found.
320
348
 
321
349
  --
322
350
 
323
- ##### [get_page](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/helper.rb#L93) ios
324
-
325
- > def get_page element=source_window(0)
351
+ ##### [find_element](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L536)
326
352
 
327
- Returns a string of interesting elements. iOS only.
353
+ > def find_element *args
328
354
 
329
- Defaults to inspecting the 1st windows source only.
330
- use get_page(get_source) for all window sources
355
+ Calls @driver.find_elements
331
356
 
332
357
  __Parameters:__
333
358
 
334
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Object] element - the element to search. omit to search everything
359
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[*args] args - the args to use
335
360
 
336
361
  __Returns:__
337
362
 
338
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
363
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
339
364
 
340
365
  --
341
366
 
342
- ##### [page](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/helper.rb#L161) ios
367
+ ##### [x](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/driver.rb#L543)
343
368
 
344
- > def page window_number = -1
369
+ > def x
345
370
 
346
- Prints a string of interesting elements to the console.
371
+ Quit the driver and Pry.
372
+ quit and exit are reserved by Pry.
347
373
 
348
374
  __Returns:__
349
375
 
@@ -351,407 +377,474 @@ __Returns:__
351
377
 
352
378
  --
353
379
 
354
- ##### [source_window](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/helper.rb#L176) ios
380
+ ##### [NoArgMethods](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L7)
355
381
 
356
- > def source_window window_number=0
382
+ > NoArgMethods = {
357
383
 
358
- Gets the JSON source of window number
359
-
360
- __Parameters:__
361
384
 
362
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] window_number - the int index of the target window
363
385
 
364
- __Returns:__
386
+ --
365
387
 
366
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[JSON]
388
+ ##### [app_strings](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L23)
367
389
 
368
- --
390
+ > def app_strings
369
391
 
370
- ##### [page_window](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/helper.rb#L183) ios
392
+ Return the hash of all localization strings.
393
+ ```ruby
394
+ app_strings #=> "TransitionsTitle"=>"Transitions", "WebTitle"=>"Web"
395
+ ```
371
396
 
372
- > def page_window window_number=0
397
+ --
373
398
 
374
- Prints parsed page source to console.
375
- example: page_window 0
399
+ ##### [background_app](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L29)
376
400
 
377
- __Parameters:__
401
+ > def background_app
378
402
 
379
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] window_number - the int index of the target window
403
+ Backgrounds the app for a set number of seconds.
404
+ This is a blocking application
380
405
 
381
406
  --
382
407
 
383
- ##### [fast_duration](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/helper.rb#L190) ios
384
-
385
- > def fast_duration
408
+ ##### [current_activity](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L34)
386
409
 
387
- The fastest duration that can be used on iOS.
410
+ > def current_activity
388
411
 
389
- __Returns:__
390
412
 
391
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Float]
392
413
 
393
414
  --
394
415
 
395
- ##### [id](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/helper.rb#L197) ios
416
+ ##### [launch](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L36)
396
417
 
397
- > def id id
418
+ > def launch
398
419
 
399
- Find by id. Useful for selendroid
420
+ Start the simulator and applicaton configured with desired capabilities
400
421
 
401
- __Parameters:__
422
+ --
402
423
 
403
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] id - the id to search for
424
+ ##### [reset](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L39)
404
425
 
405
- __Returns:__
426
+ > def reset
406
427
 
407
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
428
+ Reset the device, relaunching the application.
408
429
 
409
430
  --
410
431
 
411
- ##### [ios_version](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/helper.rb#L205) ios
432
+ ##### [shake](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L42)
412
433
 
413
- > def ios_version
434
+ > def shake
414
435
 
415
- Return the iOS version as an array of integers
436
+ Cause the device to shake
416
437
 
417
- __Returns:__
438
+ --
418
439
 
419
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Integer>]
440
+ ##### [toggle_flight_mode](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L45)
420
441
 
421
- --
442
+ > def toggle_flight_mode
422
443
 
423
- ##### [alert_click](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/alert.rb#L14) ios
444
+ toggle flight mode on or off
424
445
 
425
- > def alert_click value
446
+ --
426
447
 
427
- iOS only
428
- Tap the alert button identified by value.
448
+ ##### [complex_find](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L48)
429
449
 
430
- Click the ok button:
431
- alert_click 'OK'
450
+ > def complex_find
432
451
 
433
- Click the first button:
434
- alert_click 0
452
+ Find an element by a complex array of criteria. Available criteria
453
+ are listed in [link here]. Criteria are formed by creating an array
454
+ of arrays, each containing a selector and that selector's value.
435
455
 
436
- __Parameters:__
456
+ ```ruby
457
+ complex_find [[[2, 'Sau'], [14, true]]] # => Find a clickable element
458
+ # whose names starts with 'Sau'
459
+ ```
437
460
 
438
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer, String] value - either an integer index of the button or the button's name
461
+ __Parameters:__
439
462
 
440
- __Returns:__
463
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Symbol] mod - If present, will be the 0th element in the selector array.
441
464
 
442
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
465
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Object>] selectors - The selectors to find elements with.
443
466
 
444
467
  --
445
468
 
446
- ##### [alert_text](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/alert.rb#L21) ios
469
+ ##### [hide_keyboard](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L60)
447
470
 
448
- > def alert_text
471
+ > def hide_keyboard
449
472
 
450
- Get the alert message text.
473
+ Hide the onscreen keyboard
451
474
 
452
- __Returns:__
475
+ __Parameters:__
453
476
 
454
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
477
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] close_key - the name of the key which closes the keyboard.
478
+ Defaults to 'Done'.
455
479
 
456
480
  --
457
481
 
458
- ##### [alert_accept](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/alert.rb#L30) ios
482
+ ##### [key_event](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L69)
459
483
 
460
- > def alert_accept
484
+ > def key_event
461
485
 
462
- Accept the alert.
486
+ Send a key event to the device.
463
487
 
464
- __Returns:__
488
+ __Parameters:__
465
489
 
466
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
490
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[integer] key - The key to send.
491
+
492
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] metastate - The state the metakeys should be in when sending the key.
467
493
 
468
494
  --
469
495
 
470
- ##### [alert_accept_text](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/alert.rb#L40) ios
496
+ ##### [push_file](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L74)
471
497
 
472
- > def alert_accept_text
498
+ > def push_file
473
499
 
474
- Get the text of the alert's accept button.
475
- The last button is considered "accept." on iOS 6
476
- The first button is considered "accept." on iOS 7
500
+ Place a file in a specific location on the device.
477
501
 
478
- __Returns:__
502
+ __Parameters:__
479
503
 
480
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
504
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] path - The absolute path on the device to store data at.
505
+
506
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] data - Raw file data to be sent to the device.
481
507
 
482
508
  --
483
509
 
484
- ##### [alert_dismiss](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/alert.rb#L64) ios
510
+ ##### [pull_file](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L79)
485
511
 
486
- > def alert_dismiss
512
+ > def pull_file
487
513
 
488
- Dismiss the alert.
514
+ Retrieve a file from the device. This can retrieve an absolute path or
515
+ a path relative to the installed app (iOS only).
516
+ ```ruby
517
+ pull_file '/local/data/some/path' #=> Get the file at that path
518
+ pull_file 'Shenanigans.app/some/file' #=> Get 'some/file' from the install location of Shenanigans.app
519
+ ```
489
520
 
490
- __Returns:__
521
+ __Parameters:__
491
522
 
492
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
523
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] path - Either an absolute path OR, for iOS devices, a path relative to the app, as described.
493
524
 
494
525
  --
495
526
 
496
- ##### [alert_dismiss_text](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/alert.rb#L74) ios
497
-
498
- > def alert_dismiss_text
527
+ ##### [extend_search_contexts](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L277)
499
528
 
500
- Get the text of the alert's dismiss button.
501
- The first button is considered "dismiss." on iOS 6
502
- The last button is considered "dismiss." on iOS 7
529
+ > def extend_search_contexts
503
530
 
504
- __Returns:__
505
531
 
506
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
507
532
 
508
533
  --
509
534
 
510
- ##### [find](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/generic.rb#L61) ios
535
+ ##### [accessiblity_id_find](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L277)
511
536
 
512
- > def find text
537
+ > def accessiblity_id_find
513
538
 
514
- Return the first element matching text.
539
+ find_element/s with their accessibility_id
515
540
 
516
- __Parameters:__
541
+ ```ruby
542
+ find_elements :accessibility_id, 'Animation'
543
+ ```
544
+
545
+ --
517
546
 
518
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text to search for
547
+ ##### [add_touch_actions](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L283)
548
+
549
+ > def add_touch_actions
519
550
 
520
- __Returns:__
521
551
 
522
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element] the first matching element
523
552
 
524
553
  --
525
554
 
526
- ##### [finds](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/generic.rb#L84) ios
555
+ ##### [current_context=](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L307)
527
556
 
528
- > def finds text
557
+ > def current_context=
529
558
 
530
- Return all elements matching text.
559
+ Change the context to the given context.
560
+ ```ruby
561
+ current_context= "NATIVE_APP"
562
+ ```
531
563
 
532
564
  __Parameters:__
533
565
 
534
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text to search for
566
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] The - context to change to
567
+
568
+ --
569
+
570
+ ##### [current_context](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L315)
571
+
572
+ > def current_context
573
+
574
+
535
575
 
536
576
  __Returns:__
537
577
 
538
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>] all matching elements
578
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] The context currently being used.
539
579
 
540
580
  --
541
581
 
542
- ##### [text](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/generic.rb#L99) ios
543
-
544
- > def text text
582
+ ##### [available_contexts](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L318)
545
583
 
546
- Return the first element matching text.
584
+ > def available_contexts
547
585
 
548
- __Parameters:__
549
586
 
550
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text to search for
551
587
 
552
588
  __Returns:__
553
589
 
554
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element] the first matching element
590
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<String>] All usable contexts, as an array of strings.
555
591
 
556
592
  --
557
593
 
558
- ##### [texts](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/generic.rb#L108) ios
594
+ ##### [within_context](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L328)
559
595
 
560
- > def texts text
596
+ > def within_context(context)
561
597
 
562
- Return all elements matching text.
598
+ Perform a block within the given context, then switch back to the starting context.
599
+ ```ruby
600
+ within_context('NATIVE_APP') do
601
+ find_element [:tag, "button"]
602
+ ```
563
603
 
564
604
  __Parameters:__
565
605
 
566
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text to search for
606
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] context - The context to switch to for the duration of the block.
567
607
 
568
- __Returns:__
608
+ --
569
609
 
570
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>] all matching elements
610
+ ##### [switch_to_default_context](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/device.rb#L335)
571
611
 
572
- --
612
+ > def switch_to_default_context
573
613
 
574
- ##### [name](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/generic.rb#L130) ios
614
+ Change to the default context. This is equivalent to `current_context= nil`.
575
615
 
576
- > def name name
616
+ --
577
617
 
578
- Return the first element matching name.
579
- on Android name is content description
580
- on iOS name is the accessibility label or the text.
618
+ ##### [pinch](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/multi_touch.rb#L30)
581
619
 
582
- ```ruby
583
- # find element with name or label containing example and access the name attribute.
584
- name('example').name
620
+ > def pinch(percentage=25, auto_perform=true)
585
621
 
586
- # find element with name or label containing example and access the label attribute.
587
- name('example').label
622
+ Convenience method for pinching the screen.
623
+ Places two fingers at the edges of the screen and brings them together.
624
+ ```ruby
625
+ action = pinch 75 #=> Pinch the screen from the top right and bottom left corners
626
+ action.perform #=> to 25% of its size.
588
627
  ```
589
628
 
590
629
  __Parameters:__
591
630
 
592
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] name - the name to search for
593
-
594
- __Returns:__
631
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[int] percentage - The percent size by which to shrink the screen when pinched.
595
632
 
596
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element] the first matching element
633
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[boolean] auto_perform - Whether to perform the action immediately (default true)
597
634
 
598
635
  --
599
636
 
600
- ##### [name_exact](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/generic.rb#L135) ios
637
+ ##### [zoom](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/multi_touch.rb#L58)
601
638
 
602
- > def name_exact name
639
+ > def zoom(percentage=200, auto_perform=true)
603
640
 
641
+ Convenience method for zooming the screen.
642
+ Places two fingers at the edges of the screen and brings them together.
643
+ ```ruby
644
+ action = zoom 200 #=> Zoom in the screen from the center until it doubles in size.
645
+ action.perform
646
+ ```
604
647
 
648
+ __Parameters:__
605
649
 
606
- --
650
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[int] percentage - The percent size by which to shrink the screen when pinched.
607
651
 
608
- ##### [names](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/generic.rb#L154) ios
652
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[boolean] auto_perform - Whether to perform the action immediately (default true)
609
653
 
610
- > def names name
654
+ --
611
655
 
612
- Return all elements matching name.
613
- on Android name is content description
614
- on iOS name is the accessibility label or the text.
656
+ ##### [initialize](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/multi_touch.rb#L79)
615
657
 
616
- __Parameters:__
658
+ > def initialize
617
659
 
618
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] name - the name to search for
660
+ Create a new multi-action
619
661
 
620
662
  __Returns:__
621
663
 
622
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>] all matching elements
664
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[MultiTouch] a new instance of MultiTouch
623
665
 
624
666
  --
625
667
 
626
- ##### [escape_single_quote](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/generic.rb#L162) ios
668
+ ##### [add](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/multi_touch.rb#L85)
669
+
670
+ > def add(chain)
627
671
 
628
- > def escape_single_quote text_to_escape
672
+ Add a touch_action to be performed
629
673
 
674
+ __Parameters:__
630
675
 
676
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[TouchAction] chain - The action to add to the chain
631
677
 
632
678
  --
633
679
 
634
- ##### [locate_single_textfield](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/textfield.rb#L8) ios
635
-
636
- > def locate_single_textfield js
680
+ ##### [perform](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/multi_touch.rb#L90)
637
681
 
638
- UIATextField & UIASecureTextField methods
682
+ > def perform
639
683
 
640
- Find textfield and then secure elements in one server call
641
- to match Android.
684
+ Ask Appium to perform the actions
642
685
 
643
686
  --
644
687
 
645
- ##### [textfields](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/textfield.rb#L18) ios
688
+ ##### [ACTIONS](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L12)
646
689
 
647
- > def textfields
690
+ > ACTIONS = [:move_to, :press_for_duration, :press, :release, :tap, :wait, :perform]
648
691
 
649
- Get an array of textfield texts.
650
- Does not respect implicit wait because we're using execute_script.
651
-
652
- __Returns:__
653
692
 
654
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<String>]
655
693
 
656
694
  --
657
695
 
658
- ##### [e_textfields](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/textfield.rb#L24) ios
696
+ ##### [COMPLEX_ACTIONS](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L13)
659
697
 
660
- > def e_textfields
698
+ > COMPLEX_ACTIONS = [:swipe]
661
699
 
662
- Get an array of textfield elements.
663
700
 
664
- __Returns:__
665
701
 
666
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Textfield>]
702
+ --
703
+
704
+ ##### [actions](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L27)
705
+
706
+ > def actions
707
+
708
+ Returns the value of attribute actions
667
709
 
668
710
  --
669
711
 
670
- ##### [first_textfield](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/textfield.rb#L30) ios
712
+ ##### [initialize](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L29)
713
+
714
+ > def initialize
671
715
 
672
- > def first_textfield
673
716
 
674
- Get the first textfield element.
675
717
 
676
718
  __Returns:__
677
719
 
678
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Textfield]
720
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[TouchAction] a new instance of TouchAction
679
721
 
680
722
  --
681
723
 
682
- ##### [last_textfield](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/textfield.rb#L36) ios
724
+ ##### [move_to](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L37)
683
725
 
684
- > def last_textfield
726
+ > def move_to(opts)
685
727
 
686
- Get the last textfield element.
728
+ Move to the given co-ordinates.
687
729
 
688
- __Returns:__
730
+ __Parameters:__
689
731
 
690
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Textfield]
732
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] opts - a customizable set of options
691
733
 
692
734
  --
693
735
 
694
- ##### [textfield](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/textfield.rb#L43) ios
736
+ ##### [press_for_duration](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L47)
695
737
 
696
- > def textfield text
738
+ > def press_for_duration(element, x, y, duration)
697
739
 
698
- Get the first textfield that matches text.
740
+ Press down for a specific duration.
699
741
 
700
742
  __Parameters:__
701
743
 
702
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String, Integer] text - the text to match exactly. If int then the textfield at that index is returned.
744
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[WebDriver::Element] element - the element to press.
703
745
 
704
- __Returns:__
746
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[integer] x - x co-ordinate to press on.
705
747
 
706
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Textfield]
748
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[integer] y - y co-ordinate to press on.
749
+
750
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[integer] duration - Number of seconds to press.
707
751
 
708
752
  --
709
753
 
710
- ##### [textfield_include](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/textfield.rb#L57) ios
754
+ ##### [press](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L58)
711
755
 
712
- > def textfield_include text
756
+ > def press(opts)
713
757
 
714
- Get the first textfield that includes text.
758
+ Press a finger onto the screen. Finger will stay down until you call
759
+ `release`.
715
760
 
716
761
  __Parameters:__
717
762
 
718
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text the textfield must include
719
-
720
- __Returns:__
721
-
722
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Textfield]
763
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] opts - a customizable set of options
723
764
 
724
765
  --
725
766
 
726
- ##### [textfield_exact](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/textfield.rb#L64) ios
767
+ ##### [release](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L69)
727
768
 
728
- > def textfield_exact text
769
+ > def release(opts=nil)
729
770
 
730
- Get the first textfield that exactly matches text.
771
+ Remove a finger from the screen.
731
772
 
732
773
  __Parameters:__
733
774
 
734
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text the textfield must exactly match
775
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] opts - a customizable set of options
735
776
 
736
- __Returns:__
777
+ --
778
+
779
+ ##### [tap](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L80)
780
+
781
+ > def tap(opts)
782
+
783
+ Touch a point on the screen
784
+
785
+ __Parameters:__
737
786
 
738
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Textfield]
787
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] opts - a customizable set of options
739
788
 
740
789
  --
741
790
 
742
- ##### [textfield_named](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/ios/element/textfield.rb#L70) ios
791
+ ##### [wait](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L88)
743
792
 
744
- > def textfield_named target_name
793
+ > def wait(seconds)
745
794
 
746
- Get the first textfield that exactly matches name
795
+ Pause for a number of seconds before the next action
796
+
797
+ __Parameters:__
798
+
799
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[integer] seconds - Number of seconds to pause for
800
+
801
+ --
802
+
803
+ ##### [swipe](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L99)
804
+
805
+ > def swipe(opts)
806
+
807
+ Convenience method to peform a swipe.
808
+
809
+ __Parameters:__
810
+
811
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] opts - a customizable set of options
812
+
813
+ --
814
+
815
+ ##### [perform](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L114)
816
+
817
+ > def perform
818
+
819
+ Ask the driver to perform all actions in this action chain.
820
+
821
+ --
822
+
823
+ ##### [cancel](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L120)
824
+
825
+ > def cancel
826
+
827
+ Does nothing, currently.
828
+
829
+ --
830
+
831
+ ##### [chain_method](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L128)
832
+
833
+ > def chain_method(method, args=nil)
834
+
835
+
836
+
837
+ --
838
+
839
+ ##### [args_with_ele_ref](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/device/touch_actions.rb#L137)
840
+
841
+ > def args_with_ele_ref(args)
747
842
 
748
- __Returns:__
749
843
 
750
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
751
844
 
752
845
  --
753
846
 
754
- ##### [wait](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L33)
847
+ ##### [wait](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L33)
755
848
 
756
849
  > def wait max_wait=30, interval=0.5, &block
757
850
 
@@ -778,7 +871,7 @@ __Returns:__
778
871
 
779
872
  --
780
873
 
781
- ##### [ignore](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L45)
874
+ ##### [ignore](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L49)
782
875
 
783
876
  > def ignore &block
784
877
 
@@ -786,11 +879,13 @@ Return block.call and ignore any exceptions.
786
879
 
787
880
  --
788
881
 
789
- ##### [wait_true](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L55)
882
+ ##### [wait_true](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L64)
790
883
 
791
884
  > def wait_true max_wait=30, interval=0.5, &block
792
885
 
793
- Check every 0.5 seconds to see if block.call returns true. nil is considered a failure.
886
+ Check every 0.5 seconds to see if block.call returns a truthy value.
887
+ Note this isn't a strict boolean true, any truthy value is accepted.
888
+ false and nil are considered failures.
794
889
  Give up after 30 seconds.
795
890
 
796
891
  __Parameters:__
@@ -807,7 +902,7 @@ __Returns:__
807
902
 
808
903
  --
809
904
 
810
- ##### [back](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L68)
905
+ ##### [back](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L81)
811
906
 
812
907
  > def back
813
908
 
@@ -819,7 +914,7 @@ __Returns:__
819
914
 
820
915
  --
821
916
 
822
- ##### [session_id](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L73)
917
+ ##### [session_id](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L86)
823
918
 
824
919
  > def session_id
825
920
 
@@ -827,7 +922,7 @@ For Sauce Labs reporting. Returns the current session id.
827
922
 
828
923
  --
829
924
 
830
- ##### [xpath](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L81)
925
+ ##### [xpath](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L94)
831
926
 
832
927
  > def xpath xpath_str
833
928
 
@@ -843,7 +938,7 @@ __Returns:__
843
938
 
844
939
  --
845
940
 
846
- ##### [xpaths](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L89)
941
+ ##### [xpaths](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L102)
847
942
 
848
943
  > def xpaths xpath_str
849
944
 
@@ -859,902 +954,630 @@ __Returns:__
859
954
 
860
955
  --
861
956
 
862
- ##### [ele_index](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L97)
863
-
864
- > def ele_index tag_name, index
957
+ ##### [source](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L108)
865
958
 
866
- Get the element of type tag_name at matching index.
867
-
868
- __Parameters:__
869
-
870
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag_name - the tag name to find
959
+ > def source
871
960
 
872
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] index - the index
961
+ Prints xml of the current page
873
962
 
874
963
  __Returns:__
875
964
 
876
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element] the found element of type tag_name
965
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
877
966
 
878
967
  --
879
968
 
880
- ##### [find_eles](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L106)
969
+ ##### [get_source](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L118)
881
970
 
882
- > def find_eles tag_name
883
-
884
- Get all elements exactly matching tag name
885
-
886
- __Parameters:__
971
+ > def get_source
887
972
 
888
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag_name - the tag name to find
973
+ Returns XML string for the current page
974
+ Same as driver.page_source
889
975
 
890
976
  __Returns:__
891
977
 
892
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>] the found elements of type tag_name
978
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
893
979
 
894
980
  --
895
981
 
896
- ##### [find_ele_by_text](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L114)
897
-
898
- > def find_ele_by_text tag, text
982
+ ##### [result](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L125)
899
983
 
900
- Get the first tag that exactly matches tag and text.
984
+ > def result
901
985
 
902
- __Parameters:__
903
-
904
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag - the tag name to match
905
-
906
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text to exactly match
907
-
908
- __Returns:__
909
-
910
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element] the element of type tag exactly matching text
986
+ Returns the value of attribute result
911
987
 
912
988
  --
913
989
 
914
- ##### [find_eles_by_text](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L122)
990
+ ##### [initialize](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L127)
915
991
 
916
- > def find_eles_by_text tag, text
992
+ > def initialize
917
993
 
918
- Get all tags that exactly match tag and text.
919
994
 
920
- __Parameters:__
921
-
922
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag - the tag name to match
923
-
924
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text to exactly match
925
995
 
926
996
  __Returns:__
927
997
 
928
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>] the elements of type tag exactly matching text
998
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[CountElements] a new instance of CountElements
929
999
 
930
1000
  --
931
1001
 
932
- ##### [find_ele_by_attr_include](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L131)
933
-
934
- > def find_ele_by_attr_include tag, attr, value
1002
+ ##### [reset](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L131)
935
1003
 
936
- Get the first tag by attribute that exactly matches value.
1004
+ > def reset
937
1005
 
938
- __Parameters:__
939
1006
 
940
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag - the tag name to match
941
1007
 
942
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] attr - the attribute to compare
1008
+ --
943
1009
 
944
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value of the attribute that the element must include
1010
+ ##### [start_element](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L136)
945
1011
 
946
- __Returns:__
1012
+ > def start_element name, attrs = []
947
1013
 
948
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element] the element of type tag who's attribute includes value
1014
+ http://nokogiri.org/Nokogiri/XML/SAX/Document.html
949
1015
 
950
1016
  --
951
1017
 
952
- ##### [find_eles_by_attr_include](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L140)
1018
+ ##### [formatted_result](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L140)
953
1019
 
954
- > def find_eles_by_attr_include tag, attr, value
1020
+ > def formatted_result
955
1021
 
956
- Get tags by attribute that include value.
957
1022
 
958
- __Parameters:__
959
-
960
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag - the tag name to match
961
1023
 
962
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] attr - the attribute to compare
1024
+ --
963
1025
 
964
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value of the attribute that the element must include
1026
+ ##### [get_page_class](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L151)
965
1027
 
966
- __Returns:__
1028
+ > def get_page_class
967
1029
 
968
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>] the elements of type tag who's attribute includes value
1030
+ Returns a string of class counts.
969
1031
 
970
1032
  --
971
1033
 
972
- ##### [find_ele_by_text_include](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L149)
1034
+ ##### [page_class](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L162)
973
1035
 
974
- > def find_ele_by_text_include tag, text
1036
+ > def page_class
975
1037
 
976
- Get the first tag that includes text.
977
- element.attribute(:text).include? text
1038
+ Count all classes on screen and print to stdout.
1039
+ Useful for appium_console.
978
1040
 
979
- __Parameters:__
1041
+ --
980
1042
 
981
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag - the tag name to match
1043
+ ##### [px_to_window_rel](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L172)
982
1044
 
983
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text the element must include
1045
+ > def px_to_window_rel opts={}
984
1046
 
985
- __Returns:__
1047
+ Converts pixel values to window relative values
986
1048
 
987
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element] the element of type tag that includes text
1049
+ ```ruby
1050
+ px_to_window_rel x: 50, y: 150
1051
+ ```
988
1052
 
989
1053
  --
990
1054
 
991
- ##### [find_eles_by_text_include](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L158)
1055
+ ##### [xml_keys](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L189)
992
1056
 
993
- > def find_eles_by_text_include tag, text
1057
+ > def xml_keys target
994
1058
 
995
- Get the tags that include text.
996
- element.attribute(:text).include? text
1059
+ Search strings.xml's values for target.
997
1060
 
998
1061
  __Parameters:__
999
1062
 
1000
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag - the tag name to match
1001
-
1002
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text the element must include
1063
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] target - the target to search for in strings.xml values
1003
1064
 
1004
1065
  __Returns:__
1005
1066
 
1006
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>] the elements of type tag that includes text
1067
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array]
1007
1068
 
1008
1069
  --
1009
1070
 
1010
- ##### [first_ele](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L165)
1071
+ ##### [xml_values](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L197)
1011
1072
 
1012
- > def first_ele tag_name
1073
+ > def xml_values target
1013
1074
 
1014
- Get the first tag that matches tag_name
1075
+ Search strings.xml's keys for target.
1015
1076
 
1016
1077
  __Parameters:__
1017
1078
 
1018
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag_name - the tag to match
1079
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] target - the target to search for in strings.xml keys
1019
1080
 
1020
1081
  __Returns:__
1021
1082
 
1022
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1083
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array]
1023
1084
 
1024
1085
  --
1025
1086
 
1026
- ##### [last_ele](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L173)
1087
+ ##### [resolve_id](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/helper.rb#L205)
1027
1088
 
1028
- > def last_ele tag_name
1089
+ > def resolve_id id
1029
1090
 
1030
- Get the last tag that matches tag_name
1091
+ Resolve id in strings.xml and return the value.
1031
1092
 
1032
1093
  __Parameters:__
1033
1094
 
1034
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag_name - the tag to match
1095
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] id - the id to resolve
1035
1096
 
1036
1097
  __Returns:__
1037
1098
 
1038
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1099
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
1039
1100
 
1040
1101
  --
1041
1102
 
1042
- ##### [source](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L179)
1043
-
1044
- > def source
1045
-
1046
- Prints a JSON view of the current page
1103
+ ##### [window_size](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/element/window.rb#L5)
1047
1104
 
1048
- __Returns:__
1105
+ > def window_size
1049
1106
 
1050
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
1107
+ Get the window's size
1051
1108
 
1052
1109
  --
1053
1110
 
1054
- ##### [get_source](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L185)
1055
-
1056
- > def get_source
1111
+ ##### [UIAStaticText](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/text.rb#L4) ios
1057
1112
 
1058
- Gets a JSON view of the current page
1113
+ > UIAStaticText = 'UIAStaticText'
1059
1114
 
1060
- __Returns:__
1061
1115
 
1062
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[JSON]
1063
1116
 
1064
1117
  --
1065
1118
 
1066
- ##### [find_name](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L194)
1119
+ ##### [s_text](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/text.rb#L10) ios
1067
1120
 
1068
- > def find_name name
1121
+ > def s_text value
1069
1122
 
1070
- Returns the first element that exactly matches name
1123
+ Find the first UIAStaticText that contains value or by index.
1124
+ If int then the UIAStaticText at that index is returned.
1071
1125
 
1072
1126
  __Parameters:__
1073
1127
 
1074
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] name - the name to exactly match
1128
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String, Integer] value - the value to find.
1075
1129
 
1076
1130
  __Returns:__
1077
1131
 
1078
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1132
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[UIAStaticText]
1079
1133
 
1080
1134
  --
1081
1135
 
1082
- ##### [find_names](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L202)
1136
+ ##### [s_texts](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/text.rb#L18) ios
1083
1137
 
1084
- > def find_names name
1138
+ > def s_texts value
1085
1139
 
1086
- Returns all elements that exactly match name
1140
+ Find all UIAStaticText containing value.
1087
1141
 
1088
1142
  __Parameters:__
1089
1143
 
1090
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] name - the name to exactly match
1144
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
1091
1145
 
1092
1146
  __Returns:__
1093
1147
 
1094
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>]
1148
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<UIAStaticText>]
1095
1149
 
1096
1150
  --
1097
1151
 
1098
- ##### [tag](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L210)
1099
-
1100
- > def tag tag_name
1152
+ ##### [first_s_text](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/text.rb#L24) ios
1101
1153
 
1102
- Returns the first element matching tag_name
1103
-
1104
- __Parameters:__
1154
+ > def first_s_text
1105
1155
 
1106
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag_name - the tag_name to search for
1156
+ Find the first UIAStaticText.
1107
1157
 
1108
1158
  __Returns:__
1109
1159
 
1110
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1160
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[UIAStaticText]
1111
1161
 
1112
1162
  --
1113
1163
 
1114
- ##### [tags](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L218)
1115
-
1116
- > def tags tag_name
1117
-
1118
- Returns all elements matching tag_name
1164
+ ##### [last_s_text](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/text.rb#L30) ios
1119
1165
 
1120
- __Parameters:__
1166
+ > def last_s_text
1121
1167
 
1122
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag_name - the tag_name to search for
1168
+ Find the last UIAStaticText.
1123
1169
 
1124
1170
  __Returns:__
1125
1171
 
1126
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1127
-
1128
- --
1129
-
1130
- ##### [px_to_window_rel](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L228)
1131
-
1132
- > def px_to_window_rel opts={}
1133
-
1134
- Converts pixel values to window relative values
1135
-
1136
- ```ruby
1137
- px_to_window_rel x: 50, y: 150
1138
- ```
1139
-
1140
- --
1141
-
1142
- ##### [lazy_load_strings](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L238)
1143
-
1144
- > def lazy_load_strings
1145
-
1146
-
1172
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[UIAStaticText]
1147
1173
 
1148
1174
  --
1149
1175
 
1150
- ##### [xml_keys](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L245)
1176
+ ##### [s_text_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/text.rb#L37) ios
1151
1177
 
1152
- > def xml_keys target
1178
+ > def s_text_exact value
1153
1179
 
1154
- Search strings.xml's values for target.
1180
+ Find the first UIAStaticText that exactly matches value.
1155
1181
 
1156
1182
  __Parameters:__
1157
1183
 
1158
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] target - the target to search for in strings.xml values
1184
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to match exactly
1159
1185
 
1160
1186
  __Returns:__
1161
1187
 
1162
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array]
1188
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[UIAStaticText]
1163
1189
 
1164
1190
  --
1165
1191
 
1166
- ##### [xml_values](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L253)
1192
+ ##### [s_texts_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/text.rb#L44) ios
1167
1193
 
1168
- > def xml_values target
1194
+ > def s_texts_exact value
1169
1195
 
1170
- Search strings.xml's keys for target.
1196
+ Find all UIAStaticTexts that exactly match value.
1171
1197
 
1172
1198
  __Parameters:__
1173
1199
 
1174
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] target - the target to search for in strings.xml keys
1200
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to match exactly
1175
1201
 
1176
1202
  __Returns:__
1177
1203
 
1178
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array]
1204
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<UIAStaticText>]
1179
1205
 
1180
1206
  --
1181
1207
 
1182
- ##### [resolve_id](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L261)
1183
-
1184
- > def resolve_id id
1185
-
1186
- Resolve id in strings.xml and return the value.
1208
+ ##### [e_s_texts](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/text.rb#L50) ios
1187
1209
 
1188
- __Parameters:__
1210
+ > def e_s_texts
1189
1211
 
1190
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] id - the id to resolve
1212
+ Find all UIAStaticTexts.
1191
1213
 
1192
1214
  __Returns:__
1193
1215
 
1194
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
1216
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<UIAStaticText>]
1195
1217
 
1196
1218
  --
1197
1219
 
1198
- ##### [raise_no_element_error](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/helper.rb#L267)
1199
-
1200
- > def raise_no_element_error
1201
-
1202
- Used to error when finding a single element fails.
1203
-
1204
- --
1205
-
1206
- ##### [value](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/patch.rb#L32)
1207
-
1208
- > def value
1209
-
1210
- Returns the value attribute
1211
-
1212
- Fixes NoMethodError: undefined method `value' for Selenium::WebDriver::Element
1213
-
1214
- --
1220
+ ##### [alert_accept](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/alert.rb#L5) ios
1215
1221
 
1216
- ##### [name](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/patch.rb#L39)
1222
+ > def alert_accept
1217
1223
 
1218
- > def name
1224
+ Accept the alert.
1219
1225
 
1220
- Returns the name attribute
1226
+ __Returns:__
1221
1227
 
1222
- Fixes NoMethodError: undefined method `name' for Selenium::WebDriver::Element
1228
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
1223
1229
 
1224
1230
  --
1225
1231
 
1226
- ##### [location_rel](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/common/patch.rb#L51)
1227
-
1228
- > def location_rel
1232
+ ##### [alert_dismiss](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/alert.rb#L13) ios
1229
1233
 
1230
- For use with mobile tap.
1231
-
1232
- ```ruby
1233
- execute_script 'mobile: tap', :x => 0.0, :y => 0.98
1234
- ```
1234
+ > def alert_dismiss
1235
1235
 
1236
- https://github.com/appium/appium/wiki/Automating-mobile-gestures
1236
+ Dismiss the alert.
1237
1237
 
1238
1238
  __Returns:__
1239
1239
 
1240
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[OpenStruct] the relative x, y in a struct. ex: { x: 0.50, y: 0.20 }
1240
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
1241
1241
 
1242
1242
  --
1243
1243
 
1244
- ##### [CORE](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L16)
1244
+ ##### [uiautomation_find](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/mobile_methods.rb#L10) ios
1245
1245
 
1246
- > CORE = [ :array, :hash, :class, :file, :dir, :bigdecimal, :rational, :struct, :openstruct, :method, :unboundmethod ]
1246
+ > def uiautomation_find
1247
1247
 
1248
+ 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).
1248
1249
 
1250
+ ```ruby
1251
+ find_elements :uiautomation, 'elements()
1252
+ ```
1249
1253
 
1250
1254
  --
1251
1255
 
1252
- ##### [awesome_openstruct](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L18)
1256
+ ##### [UIAButton](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/button.rb#L4) ios
1253
1257
 
1254
- > def awesome_openstruct target
1258
+ > UIAButton = 'UIAButton'
1255
1259
 
1256
1260
 
1257
1261
 
1258
1262
  --
1259
1263
 
1260
- ##### [load_appium_txt](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L27)
1264
+ ##### [button](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/button.rb#L10) ios
1261
1265
 
1262
- > def load_appium_txt opts
1266
+ > def button value
1263
1267
 
1264
- Load appium.txt (toml format) into system ENV
1265
- the basedir of this file + appium.txt is what's used
1268
+ Find the first UIAButton that contains value or by index.
1269
+ If int then the UIAButton at that index is returned.
1266
1270
 
1267
1271
  __Parameters:__
1268
1272
 
1269
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] opts - file: '/path/to/appium.txt', verbose: true
1273
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String, Integer] value - the value to exactly match.
1270
1274
 
1271
1275
  __Returns:__
1272
1276
 
1273
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<String>] the require files. nil if require doesn't exist
1277
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[UIAButton]
1274
1278
 
1275
1279
  --
1276
1280
 
1277
- ##### [promote_singleton_appium_methods](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L145)
1278
-
1279
- > def self.promote_singleton_appium_methods main_module
1280
-
1281
-
1282
-
1283
- --
1284
-
1285
- ##### [promote_appium_methods](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L175)
1286
-
1287
- > def self.promote_appium_methods class_array
1288
-
1289
- Promote appium methods to class instance methods
1281
+ ##### [buttons](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/button.rb#L19) ios
1290
1282
 
1291
- To promote methods to all classes:
1283
+ > def buttons value
1292
1284
 
1293
- ```ruby
1294
- Appium.promote_appium_methods Object
1295
- ```
1285
+ Find all UIAButtons containing value
1296
1286
 
1297
1287
  __Parameters:__
1298
1288
 
1299
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Class>] class_array - An array of classes
1300
-
1301
- --
1302
-
1303
- ##### [default_wait](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L550)
1304
-
1305
- > def default_wait
1306
-
1307
- Returns the default client side wait.
1308
- This value is independent of what the server is using
1289
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
1309
1290
 
1310
1291
  __Returns:__
1311
1292
 
1312
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer]
1313
-
1314
- --
1315
-
1316
- ##### [app_path](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
1317
-
1318
- > def app_path
1319
-
1320
- Returns the value of attribute app_path
1321
-
1322
- --
1323
-
1324
- ##### [app_name](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
1325
-
1326
- > def app_name
1327
-
1328
- Returns the value of attribute app_name
1293
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<UIAButton>]
1329
1294
 
1330
1295
  --
1331
1296
 
1332
- ##### [device](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
1297
+ ##### [first_button](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/button.rb#L25) ios
1333
1298
 
1334
- > def device
1335
-
1336
- Returns the value of attribute device
1337
-
1338
- --
1299
+ > def first_button
1339
1300
 
1340
- ##### [app_package](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
1301
+ Find the first UIAButton.
1341
1302
 
1342
- > def app_package
1303
+ __Returns:__
1343
1304
 
1344
- Returns the value of attribute app_package
1305
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[UIAButton]
1345
1306
 
1346
1307
  --
1347
1308
 
1348
- ##### [app_activity](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
1349
-
1350
- > def app_activity
1351
-
1352
- Returns the value of attribute app_activity
1309
+ ##### [last_button](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/button.rb#L31) ios
1353
1310
 
1354
- --
1311
+ > def last_button
1355
1312
 
1356
- ##### [app_wait_activity](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
1313
+ Find the last UIAButton.
1357
1314
 
1358
- > def app_wait_activity
1315
+ __Returns:__
1359
1316
 
1360
- Returns the value of attribute app_wait_activity
1317
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[UIAButton]
1361
1318
 
1362
1319
  --
1363
1320
 
1364
- ##### [sauce_username](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
1321
+ ##### [button_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/button.rb#L38) ios
1365
1322
 
1366
- > def sauce_username
1323
+ > def button_exact value
1367
1324
 
1368
- Returns the value of attribute sauce_username
1325
+ Find the first UIAButton that exactly matches value.
1369
1326
 
1370
- --
1327
+ __Parameters:__
1371
1328
 
1372
- ##### [sauce_access_key](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
1329
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to match exactly
1373
1330
 
1374
- > def sauce_access_key
1331
+ __Returns:__
1375
1332
 
1376
- Returns the value of attribute sauce_access_key
1333
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[UIAButton]
1377
1334
 
1378
1335
  --
1379
1336
 
1380
- ##### [port](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
1337
+ ##### [buttons_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/button.rb#L45) ios
1381
1338
 
1382
- > def port
1339
+ > def buttons_exact value
1383
1340
 
1384
- Returns the value of attribute port
1341
+ Find all UIAButtons that exactly match value.
1385
1342
 
1386
- --
1343
+ __Parameters:__
1387
1344
 
1388
- ##### [debug](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
1345
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to match exactly
1389
1346
 
1390
- > def debug
1347
+ __Returns:__
1391
1348
 
1392
- Returns the value of attribute debug
1349
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<UIAButton>]
1393
1350
 
1394
1351
  --
1395
1352
 
1396
- ##### [export_session](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
1397
-
1398
- > def export_session
1353
+ ##### [e_buttons](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/button.rb#L51) ios
1399
1354
 
1400
- Returns the value of attribute export_session
1401
-
1402
- --
1355
+ > def e_buttons
1403
1356
 
1404
- ##### [device_cap](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
1357
+ Find all UIAButtons.
1405
1358
 
1406
- > def device_cap
1359
+ __Returns:__
1407
1360
 
1408
- Returns the value of attribute device_cap
1361
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<UIAButton>]
1409
1362
 
1410
1363
  --
1411
1364
 
1412
- ##### [compress_xml](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
1365
+ ##### [find](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/generic.rb#L7) ios
1413
1366
 
1414
- > def compress_xml
1367
+ > def find value
1415
1368
 
1416
- Returns the value of attribute compress_xml
1369
+ Find the first element containing value
1417
1370
 
1418
- --
1371
+ __Parameters:__
1419
1372
 
1420
- ##### [custom_url](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L204)
1373
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
1421
1374
 
1422
- > def custom_url
1375
+ __Returns:__
1423
1376
 
1424
- Returns the value of attribute custom_url
1377
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1425
1378
 
1426
1379
  --
1427
1380
 
1428
- ##### [global_webdriver_http_sleep](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L210)
1381
+ ##### [finds](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/generic.rb#L14) ios
1429
1382
 
1430
- > def global_webdriver_http_sleep
1383
+ > def finds value
1431
1384
 
1432
- The amount to sleep in seconds before every webdriver http call.
1385
+ Find all elements containing value
1433
1386
 
1434
- --
1387
+ __Parameters:__
1435
1388
 
1436
- ##### [global_webdriver_http_sleep=](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L210)
1389
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
1437
1390
 
1438
- > def global_webdriver_http_sleep=(value)
1391
+ __Returns:__
1439
1392
 
1440
- The amount to sleep in seconds before every webdriver http call.
1393
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>]
1441
1394
 
1442
1395
  --
1443
1396
 
1444
- ##### [initialize](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L240)
1445
-
1446
- > def initialize opts={}
1447
-
1448
- Creates a new driver.
1449
- :device is :android, :ios, or :selendroid
1450
-
1451
- ```ruby
1452
- # Options include:
1453
- :app_path, :app_name, :app_package, :app_activity,
1454
- :app_wait_activity, :sauce_username, :sauce_access_key,
1455
- :port, :os, :debug
1456
-
1457
- require 'rubygems'
1458
- require 'appium_lib'
1397
+ ##### [find_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/generic.rb#L21) ios
1459
1398
 
1460
- # Start iOS driver
1461
- app = { device: :ios, app_path: '/path/to/MyiOS.app'}
1462
- Appium::Driver.new(app).start_driver
1399
+ > def find_exact value
1463
1400
 
1464
- # Start Android driver
1465
- apk = { device: :android
1466
- app_path: '/path/to/the.apk',
1467
- app_package: 'com.example.pkg',
1468
- app_activity: 'act.Start',
1469
- app_wait_activity: 'act.Start'
1470
- }
1471
-
1472
- Appium::Driver.new(apk).start_driver
1473
- ```
1401
+ Find the first element exactly matching value
1474
1402
 
1475
1403
  __Parameters:__
1476
1404
 
1477
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Object] opts - A hash containing various options.
1405
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
1478
1406
 
1479
1407
  __Returns:__
1480
1408
 
1481
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Driver]
1409
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1482
1410
 
1483
1411
  --
1484
1412
 
1485
- ##### [status](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L363)
1486
-
1487
- > def status
1488
-
1489
- Returns the status payload
1413
+ ##### [finds_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/generic.rb#L28) ios
1490
1414
 
1491
- ```ruby
1492
- {"status"=>0,
1493
- "value"=>
1494
- {"build"=>
1495
- {"version"=>"0.8.2",
1496
- "revision"=>"f2a2bc3782e4b0370d97a097d7e04913cf008995"}},
1497
- "sessionId"=>"8f4b34a7-a9a9-4ac5-b125-36258143446a"}
1498
- ```
1415
+ > def finds_exact value
1499
1416
 
1500
- Discover the Appium rev running on the server.
1417
+ Find all elements exactly matching value
1501
1418
 
1502
- `status["value"]["build"]["revision"]`
1503
- `f2a2bc3782e4b0370d97a097d7e04913cf008995`
1504
-
1505
- __Returns:__
1506
-
1507
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[JSON]
1508
-
1509
- --
1510
-
1511
- ##### [server_version](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L369)
1512
-
1513
- > def server_version
1419
+ __Parameters:__
1514
1420
 
1515
- Returns the server's version string
1421
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
1516
1422
 
1517
1423
  __Returns:__
1518
1424
 
1519
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
1425
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>]
1520
1426
 
1521
1427
  --
1522
1428
 
1523
- ##### [absolute_app_path](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L412)
1524
-
1525
- > def self.absolute_app_path app_path
1429
+ ##### [UIATextField](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/textfield.rb#L3) ios
1526
1430
 
1527
- Converts environment variable APP_PATH to an absolute path.
1431
+ > UIATextField = 'UIATextField'
1528
1432
 
1529
- __Returns:__
1530
1433
 
1531
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] APP_PATH as an absolute path
1532
1434
 
1533
1435
  --
1534
1436
 
1535
- ##### [server_url](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L436)
1437
+ ##### [UIASecureTextField](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/textfield.rb#L4) ios
1536
1438
 
1537
- > def server_url
1439
+ > UIASecureTextField = 'UIASecureTextField'
1538
1440
 
1539
- Get the server url for sauce or local based on env vars.
1540
1441
 
1541
- __Returns:__
1542
-
1543
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] the server url
1544
1442
 
1545
1443
  --
1546
1444
 
1547
- ##### [restart](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L447)
1548
-
1549
- > def restart
1550
-
1551
- Restarts the driver
1552
-
1553
- __Returns:__
1554
-
1555
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Driver] the driver
1445
+ ##### [textfield](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/textfield.rb#L38) ios
1556
1446
 
1557
- --
1447
+ > def textfield value
1558
1448
 
1559
- ##### [driver](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L454)
1449
+ Find the first TextField that contains value or by index.
1450
+ If int then the TextField at that index is returned.
1560
1451
 
1561
- > def driver
1452
+ __Parameters:__
1562
1453
 
1563
- Returns the driver
1454
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String, Integer] value - the text to match exactly.
1564
1455
 
1565
1456
  __Returns:__
1566
1457
 
1567
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Driver] the driver
1458
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[TextField]
1568
1459
 
1569
1460
  --
1570
1461
 
1571
- ##### [screenshot](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L464)
1462
+ ##### [textfields](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/textfield.rb#L54) ios
1572
1463
 
1573
- > def screenshot png_save_path
1574
-
1575
- Takes a png screenshot and saves to the target path.
1464
+ > def textfields value
1576
1465
 
1577
- Example: screenshot '/tmp/hi.png'
1466
+ Find all TextFields containing value.
1578
1467
 
1579
1468
  __Parameters:__
1580
1469
 
1581
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] png_save_path - the full path to save the png
1470
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
1582
1471
 
1583
1472
  __Returns:__
1584
1473
 
1585
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[nil]
1474
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<TextField>]
1586
1475
 
1587
1476
  --
1588
1477
 
1589
- ##### [driver_quit](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L471)
1478
+ ##### [first_textfield](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/textfield.rb#L60) ios
1590
1479
 
1591
- > def driver_quit
1480
+ > def first_textfield
1592
1481
 
1593
- Quits the driver
1482
+ Find the first TextField.
1594
1483
 
1595
1484
  __Returns:__
1596
1485
 
1597
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
1486
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[TextField]
1598
1487
 
1599
1488
  --
1600
1489
 
1601
- ##### [start_driver](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L479)
1490
+ ##### [last_textfield](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/textfield.rb#L66) ios
1602
1491
 
1603
- > def start_driver
1492
+ > def last_textfield
1604
1493
 
1605
- Creates a new global driver and quits the old one if it exists.
1494
+ Find the last TextField.
1606
1495
 
1607
1496
  __Returns:__
1608
1497
 
1609
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Selenium::WebDriver] the new global driver
1610
-
1611
- --
1612
-
1613
- ##### [no_wait](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L513)
1614
-
1615
- > def no_wait
1616
-
1617
- Set implicit wait and default_wait to zero.
1498
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[TextField]
1618
1499
 
1619
1500
  --
1620
1501
 
1621
- ##### [set_wait](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L532)
1622
-
1623
- > def set_wait timeout=nil
1502
+ ##### [textfield_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/textfield.rb#L73) ios
1624
1503
 
1625
- Set implicit wait and default_wait to timeout, defaults to 30.
1626
- if set_wait is called without a param then the second to last
1627
- wait will be used.
1504
+ > def textfield_exact value
1628
1505
 
1629
- ```ruby`
1630
- set_wait 2
1631
- set_wait 3
1632
- set_wait # 2
1633
-
1634
- ````
1506
+ Find the first TextField that exactly matches value.
1635
1507
 
1636
1508
  __Parameters:__
1637
1509
 
1638
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] timeout - the timeout in seconds
1510
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to match exactly
1639
1511
 
1640
1512
  __Returns:__
1641
1513
 
1642
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
1514
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[TextField]
1643
1515
 
1644
1516
  --
1645
1517
 
1646
- ##### [exists](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L566)
1518
+ ##### [textfields_exact](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/textfield.rb#L80) ios
1647
1519
 
1648
- > def exists pre_check=0, post_check=@default_wait, &search_block
1520
+ > def textfields_exact value
1649
1521
 
1650
- Returns existence of element.
1651
-
1652
- Example:
1653
-
1654
- exists { button('sign in') } ? puts('true') : puts('false')
1522
+ Find all TextFields that exactly match value.
1655
1523
 
1656
1524
  __Parameters:__
1657
1525
 
1658
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] pre_check - the amount in seconds to set the
1659
- wait to before checking existance
1660
-
1661
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] post_check - the amount in seconds to set the
1662
- wait to after checking existance
1663
-
1664
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Block] search_block - the block to call
1526
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to match exactly
1665
1527
 
1666
1528
  __Returns:__
1667
1529
 
1668
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Boolean]
1530
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<TextField>]
1669
1531
 
1670
1532
  --
1671
1533
 
1672
- ##### [execute_script](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L590)
1673
-
1674
- > def execute_script script, *args
1675
-
1676
- The same as @driver.execute_script
1534
+ ##### [e_textfields](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/ios/element/textfield.rb#L86) ios
1677
1535
 
1678
- __Parameters:__
1679
-
1680
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] script - the script to execute
1536
+ > def e_textfields
1681
1537
 
1682
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[*args] args - the args to pass to the script
1538
+ Find all TextFields.
1683
1539
 
1684
1540
  __Returns:__
1685
1541
 
1686
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Object]
1542
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<TextField>]
1687
1543
 
1688
1544
  --
1689
1545
 
1690
- ##### [mobile](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L606)
1546
+ ##### [value](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/patch.rb#L10)
1691
1547
 
1692
- > def mobile method, *args
1693
-
1694
- Helper method for mobile gestures
1695
-
1696
- https://github.com/appium/appium/wiki/Automating-mobile-gestures
1697
-
1698
- driver.execute_script 'mobile: swipe', endX: 100, endY: 100, duration: 0.01
1699
-
1700
- becomes
1701
-
1702
- mobile :swipe, endX: 100, endY: 100, duration: 0.01
1703
-
1704
- __Parameters:__
1705
-
1706
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String, Symbol] method - the method to execute
1707
-
1708
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[*args] args - the args to pass to the method
1548
+ > def value
1709
1549
 
1710
- __Returns:__
1550
+ Returns the value attribute
1711
1551
 
1712
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Object]
1552
+ Fixes NoMethodError: undefined method `value' for Selenium::WebDriver::Element
1713
1553
 
1714
1554
  --
1715
1555
 
1716
- ##### [find_elements](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L617)
1717
-
1718
- > def find_elements *args
1556
+ ##### [name](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/patch.rb#L17)
1719
1557
 
1720
- Calls @driver.find_elements
1721
-
1722
- __Parameters:__
1723
-
1724
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[*args] args - the args to use
1558
+ > def name
1725
1559
 
1726
- __Returns:__
1560
+ Returns the name attribute
1727
1561
 
1728
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>] Array is empty when no elements are found.
1562
+ Fixes NoMethodError: undefined method `name' for Selenium::WebDriver::Element
1729
1563
 
1730
1564
  --
1731
1565
 
1732
- ##### [find_element](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L625)
1733
-
1734
- > def find_element *args
1735
-
1736
- Calls @driver.find_elements
1737
-
1738
- __Parameters:__
1739
-
1740
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[*args] args - the args to use
1741
-
1742
- __Returns:__
1743
-
1744
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1566
+ ##### [location_rel](https://github.com/appium/ruby_lib/blob/5a3ecbb4147693ce3c2c6b693e64074022d03511/lib/appium_lib/common/patch.rb#L29)
1745
1567
 
1746
- --
1568
+ > def location_rel
1747
1569
 
1748
- ##### [x](https://github.com/appium/ruby_lib/blob/a07da28de1e7133c77070859c2c35d7bd2635684/lib/appium_lib/driver.rb#L632)
1570
+ For use with mobile tap.
1749
1571
 
1750
- > def x
1572
+ ```ruby
1573
+ execute_script 'mobile: tap', :x => 0.0, :y => 0.98
1574
+ ```
1751
1575
 
1752
- Quit the driver and Pry.
1753
- quit and exit are reserved by Pry.
1576
+ https://github.com/appium/appium/wiki/Automating-mobile-gestures
1754
1577
 
1755
1578
  __Returns:__
1756
1579
 
1757
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
1580
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[OpenStruct] the relative x, y in a struct. ex: { x: 0.50, y: 0.20 }
1758
1581
 
1759
1582
  --
1760
1583