appium_lib 8.1.0 → 8.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1047c021d9e6c8e73618d525540ee4632fa6d97
4
- data.tar.gz: a97ad37976b48c146609c5fbcef8ed60223c1a10
3
+ metadata.gz: 3654883834d498a7f5666fa706cd436a5f7c00dd
4
+ data.tar.gz: 05533eb431feafea2cbcba7f782e3dd23d6b0b1d
5
5
  SHA512:
6
- metadata.gz: d2b3f5ce8c771576e22c17d4c7f186776444bbc57ccf91b5de99cb6c7586aa4a3317b35c8a96238c7058af33837b7317837ee5ac7770d0b79b19fd0b31cd8cda
7
- data.tar.gz: b16f638919d409ae817ff3e601de26c9466df4c392b4fdd917529894c3c35f1aa5fc3a902d591b6f1b651906a30288b369cb8c05404b60198a437ee3e2ecc1ee
6
+ metadata.gz: a970ebc14a8caaa3274abb0580bd4220350eaec3a4471a631a5c03f4f206fe2dcee7b39b1533d007b5834126c8e784f1691b6d5eb4856e857497cfc9ae7ec734
7
+ data.tar.gz: 4ccdb62491dd8918d54c55ddf15cbe1aca7b6726cd3f9c2c275b916e098aeedded6671d8db7d5bfda5ae53ee6e1d93867d099df949cb3b7952ae592e9baa1fd7
data/Rakefile CHANGED
@@ -94,7 +94,7 @@ def tag_exists tag_name
94
94
  end
95
95
 
96
96
  # Inspired by Gollum's Rakefile
97
- desc 'Build and release a new gem to rubygems.org'
97
+ desc 'Generate release note and create a release branch'
98
98
  task :release => :gem do
99
99
  unless `git branch`.include? '* master'
100
100
  puts 'Master branch required to release.'
@@ -108,22 +108,28 @@ task :release => :gem do
108
108
  tag_name = "v#{version}"
109
109
  raise 'Tag already exists!' if tag_exists tag_name
110
110
 
111
- # Commit then pull before pushing.
112
111
  sh "git commit --allow-empty -am 'Release #{version}'"
113
112
  sh 'git pull'
114
113
  sh "git tag #{tag_name}"
114
+
115
+ branch_name = "release_#{version.gsub('.', '_')}"
116
+ sh "git checkout -b #{branch_name}"
117
+
115
118
  # update notes now that there's a new tag
116
119
  Rake::Task['notes'].execute
117
120
  Rake::Task['docs'].execute
118
121
  sh "git commit --allow-empty -am 'Update release notes'"
119
- sh 'git push origin master'
120
- sh "git push origin #{tag_name}"
121
- gem_build
122
- # sh "gem push #{repo_name}-#{version}.gem"
122
+
123
+ puts "Please git push #{branch_name} and send PR, merge it."
123
124
  end
124
125
 
125
- desc 'Build and release a new gem to rubygems.org (same as release)'
126
- task :publish => :release do
126
+ desc 'Build and release a new gem to rubygems.org'
127
+ task :publish do
128
+ tag_name = "v#{version}"
129
+ sh "git push origin #{tag_name}"
130
+
131
+ gem_build
132
+ sh "gem push #{repo_name}-#{version}.gem"
127
133
  end
128
134
 
129
135
  def gem_build
@@ -114,4 +114,25 @@ describe 'common/device' do
114
114
  data = pull_folder '/data/local/tmp'
115
115
  data.length.must_be :>, 100
116
116
  end
117
+
118
+ t 'ime_available_engines' do
119
+ ime_latin = 'com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME'
120
+
121
+ wait { find('app').click }
122
+ wait { find('Search').click }
123
+ wait { find('Invoke Search').click }
124
+
125
+ imes = ime_available_engines
126
+ imes.include?(ime_latin).must_equal true
127
+
128
+ wait { ime_activate(ime_latin) }
129
+ ime_active_engine.must_equal ime_latin
130
+ ime_activated.must_equal true
131
+
132
+ wait { ime_deactivate }
133
+ ime_active_engine.wont_equal ime_latin
134
+
135
+ wait { ime_activate(ime_latin) }
136
+ ime_active_engine.must_equal ime_latin
137
+ end
117
138
  end
@@ -6,9 +6,9 @@ describe 'driver' do
6
6
  ENV['UPLOAD_FILE'] && ENV['SAUCE_USERNAME']
7
7
  end
8
8
 
9
- t 'load_appium_txt' do
10
- appium_txt = File.expand_path(File.join(Dir.pwd, 'lib'))
11
- parsed = Appium.load_appium_txt file: appium_txt, verbose: true
9
+ t 'load_settings' do
10
+ appium_txt = File.join(Dir.pwd, 'appium.txt')
11
+ parsed = Appium.load_settings file: appium_txt, verbose: true
12
12
  apk_name = File.basename parsed[:caps][:app]
13
13
  assert_equal apk_name, 'api.apk'
14
14
  end
@@ -21,8 +21,8 @@ end
21
21
  a = OpenStruct.new x: 'ok'
22
22
  fail 'x issue' unless a.x == 'ok'
23
23
 
24
- appium_txt = File.expand_path(File.join(Dir.pwd, 'lib'))
25
- dir = appium_txt
24
+ dir = File.expand_path(File.join(Dir.pwd, 'lib'))
25
+ appium_txt = File.join(Dir.pwd, 'appium.txt')
26
26
  device = ARGV[0].downcase.strip
27
27
  devices = %w(android selendroid ios)
28
28
  fail 'Expected android, selendroid or ios as first argument' unless devices.include? device
@@ -30,7 +30,7 @@ fail 'Expected android, selendroid or ios as first argument' unless devices.incl
30
30
  one_test = ARGV[1]
31
31
  test_dir = "/#{device}/"
32
32
 
33
- caps = Appium.load_appium_txt file: appium_txt, verbose: true
33
+ caps = Appium.load_settings file: appium_txt, verbose: true
34
34
  caps = caps.merge(appium_lib: { debug: true, wait: 1 })
35
35
  caps[:app] = ENV['SAUCE_PATH'] if ENV['SAUCE_USERNAME'] && ENV['SAUCE_ACCESS_KEY']
36
36
 
data/contributing.md CHANGED
@@ -29,4 +29,6 @@ Android tests require running on physical hardware with Android 5.0 (API 21). Th
29
29
  ~/.gem/credentials; chmod 0600 ~/.gem/credentials
30
30
 
31
31
  1. Bump the version number `rake bump`
32
- 2. Publish with `rake release`
32
+ 2. Generate release note and create a branch with `rake release`
33
+ - Push and merge the branch to the master
34
+ 3. Build and publish gem with `rake publish`
data/docs/android_docs.md CHANGED
@@ -1,9 +1,8 @@
1
- ##### [load_appium_txt](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L70)
1
+ ##### [load_settings](https://github.com/appium/ruby_lib/blob/4535ec91f435255ae31b4c4fea9d96e5405d79f5/lib/appium_lib/driver.rb#L69)
2
2
 
3
- > def self.load_appium_txt(opts = {})
3
+ > def self.load_settings(opts = {})
4
4
 
5
5
  Load appium.txt (toml format)
6
- the basedir of this file + appium.txt is what's used
7
6
 
8
7
  ```
9
8
  [caps]
@@ -27,2391 +26,31 @@ __Returns:__
27
26
 
28
27
  --
29
28
 
30
- ##### [symbolize_keys](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L136)
29
+ ##### [load_appium_txt](https://github.com/appium/ruby_lib/blob/4535ec91f435255ae31b4c4fea9d96e5405d79f5/lib/appium_lib/driver.rb#L102)
31
30
 
32
- > def self.symbolize_keys(hash)
31
+ > def self.load_settings(opts = {})
33
32
 
34
- convert all keys (including nested) to symbols
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
38
-
39
- --
40
-
41
- ##### [promote_singleton_appium_methods](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L157)
42
-
43
- > def self.promote_singleton_appium_methods(modules)
44
-
45
- This method is intended to work with page objects that share
46
- a common module. For example, Page::HomePage, Page::SignIn
47
- those could be promoted on with Appium.promote_singleton_appium_methods Page
48
-
49
- If you are promoting on an individual class then you should use
50
- Appium.promote_appium_methods instead. The singleton method is intended
51
- only for the shared module use case.
52
-
53
- if modules is a module instead of an array, then the constants of
54
- that module are promoted on.
55
- otherwise, the array of modules will be used as the promotion target.
56
-
57
- --
58
-
59
- ##### [promote_appium_methods](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L208)
60
-
61
- > def self.promote_appium_methods(class_array)
62
-
63
- Promote appium methods to class instance methods
64
-
65
- To promote methods to all classes:
66
-
67
- ```ruby
68
- Appium.promote_appium_methods Object
69
- ```
70
-
71
- It's better to promote on specific classes instead of Object
72
-
73
- ```ruby
74
- # promote on rspec
75
- Appium.promote_appium_methods RSpec::Core::ExampleGroup
76
- ```
77
-
78
- ```ruby
79
- # promote on minispec
80
- Appium.promote_appium_methods Minitest::Spec
81
- ```
82
-
83
- __Parameters:__
84
-
85
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Class>] class_array - An array of classes
86
-
87
- --
88
-
89
- ##### [global_webdriver_http_sleep](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L242)
90
-
91
- > def global_webdriver_http_sleep
92
-
93
- The amount to sleep in seconds before every webdriver http call.
94
-
95
- --
96
-
97
- ##### [global_webdriver_http_sleep=](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L242)
98
-
99
- > def global_webdriver_http_sleep=(value)
100
-
101
- The amount to sleep in seconds before every webdriver http call.
102
-
103
- --
104
-
105
- ##### [caps](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L244)
106
-
107
- > def caps
108
-
109
- Selenium webdriver capabilities
110
-
111
- --
112
-
113
- ##### [caps=](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L244)
114
-
115
- > def caps=(value)
116
-
117
- Selenium webdriver capabilities
118
-
119
- --
120
-
121
- ##### [custom_url](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L246)
122
-
123
- > def custom_url
124
-
125
- Custom URL for the selenium server
126
-
127
- --
128
-
129
- ##### [custom_url=](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L246)
130
-
131
- > def custom_url=(value)
132
-
133
- Custom URL for the selenium server
134
-
135
- --
136
-
137
- ##### [export_session](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L248)
138
-
139
- > def export_session
140
-
141
- Export session id to textfile in /tmp for 3rd party tools
142
-
143
- --
144
-
145
- ##### [export_session=](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L248)
146
-
147
- > def export_session=(value)
148
-
149
- Export session id to textfile in /tmp for 3rd party tools
150
-
151
- --
152
-
153
- ##### [default_wait](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L253)
154
-
155
- > def default_wait
156
-
157
- Default wait time for elements to appear
158
- Returns the default client side wait.
159
- This value is independent of what the server is using
160
-
161
- __Returns:__
162
-
163
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer]
164
-
165
- --
166
-
167
- ##### [default_wait=](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L253)
168
-
169
- > def default_wait=(value)
170
-
171
- Default wait time for elements to appear
172
- Returns the default client side wait.
173
- This value is independent of what the server is using
174
-
175
- __Returns:__
176
-
177
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer]
178
-
179
- --
180
-
181
- ##### [last_waits](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L255)
182
-
183
- > def last_waits
184
-
185
- Array of previous wait time values
186
-
187
- --
188
-
189
- ##### [last_waits=](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L255)
190
-
191
- > def last_waits=(value)
192
-
193
- Array of previous wait time values
194
-
195
- --
196
-
197
- ##### [sauce_username](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L257)
198
-
199
- > def sauce_username
200
-
201
- Username for use on Sauce Labs
202
-
203
- --
204
-
205
- ##### [sauce_username=](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L257)
206
-
207
- > def sauce_username=(value)
208
-
209
- Username for use on Sauce Labs
210
-
211
- --
212
-
213
- ##### [sauce_access_key](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L259)
214
-
215
- > def sauce_access_key
216
-
217
- Access Key for use on Sauce Labs
218
-
219
- --
220
-
221
- ##### [sauce_access_key=](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L259)
222
-
223
- > def sauce_access_key=(value)
224
-
225
- Access Key for use on Sauce Labs
226
-
227
- --
228
-
229
- ##### [appium_port](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L261)
230
-
231
- > def appium_port
232
-
233
- Appium's server port
234
-
235
- --
236
-
237
- ##### [appium_port=](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L261)
238
-
239
- > def appium_port=(value)
240
-
241
- Appium's server port
242
-
243
- --
244
-
245
- ##### [appium_device](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L263)
246
-
247
- > def appium_device
248
-
249
- Device type to request from the appium server
250
-
251
- --
252
-
253
- ##### [appium_device=](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L263)
254
-
255
- > def appium_device=(value)
256
-
257
- Device type to request from the appium server
258
-
259
- --
260
-
261
- ##### [appium_debug](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L265)
262
-
263
- > def appium_debug
264
-
265
- Boolean debug mode for the Appium Ruby bindings
266
-
267
- --
268
-
269
- ##### [appium_debug=](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L265)
270
-
271
- > def appium_debug=(value)
272
-
273
- Boolean debug mode for the Appium Ruby bindings
274
-
275
- --
276
-
277
- ##### [listener](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L267)
278
-
279
- > def listener
280
-
281
- instance of AbstractEventListener for logging support
282
-
283
- --
284
-
285
- ##### [listener=](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L267)
286
-
287
- > def listener=(value)
288
-
289
- instance of AbstractEventListener for logging support
290
-
291
- --
292
-
293
- ##### [driver](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L271)
294
-
295
- > def driver
296
-
297
- Returns the driver
298
-
299
- __Returns:__
300
-
301
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Driver] the driver
302
-
303
- --
304
-
305
- ##### [initialize](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L292)
306
-
307
- > def initialize(opts = {})
308
-
309
- Creates a new driver
310
-
311
- ```ruby
312
- require 'rubygems'
313
- require 'appium_lib'
314
-
315
- # platformName takes a string or a symbol.
316
-
317
- # Start iOS driver
318
- opts = { caps: { platformName: :ios, app: '/path/to/MyiOS.app' } }
319
- Appium::Driver.new(opts).start_driver
33
+ Load appium.txt (toml format)
320
34
 
321
- # Start Android driver
322
- opts = { caps: { platformName: :android, app: '/path/to/my.apk' } }
323
- Appium::Driver.new(opts).start_driver
324
35
  ```
36
+ [caps]
37
+ app = "path/to/app"
325
38
 
326
- __Parameters:__
327
-
328
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Object] opts - A hash containing various options.
329
-
330
- __Returns:__
331
-
332
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Driver]
333
-
334
- --
335
-
336
- ##### [driver_attributes](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L360)
337
-
338
- > def driver_attributes
339
-
340
- Returns a hash of the driver attributes
341
-
342
- --
343
-
344
- ##### [device_is_android?](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L381)
345
-
346
- > def device_is_android?
347
-
348
-
349
-
350
- __Returns:__
351
-
352
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Boolean]
353
-
354
- --
355
-
356
- ##### [appium_server_version](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L397)
357
-
358
- > def appium_server_version
359
-
360
- Returns the server's version info
361
-
362
- ```ruby
363
- {
364
- "build" => {
365
- "version" => "0.18.1",
366
- "revision" => "d242ebcfd92046a974347ccc3a28f0e898595198"
367
- }
368
- }
39
+ [appium_lib]
40
+ port = 8080
369
41
  ```
370
42
 
371
- __Returns:__
372
-
373
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash]
374
-
375
- --
376
-
377
- ##### [absolute_app_path](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L409)
378
-
379
- > def self.absolute_app_path(opts)
380
-
381
- Converts app_path to an absolute path.
382
-
383
- opts is the full options hash (caps and appium_lib). If server_url is set
384
- then the app path is used as is.
385
-
386
- if app isn't set then an error is raised.
387
-
388
- __Returns:__
389
-
390
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] APP_PATH as an absolute path
391
-
392
- --
393
-
394
- ##### [server_url](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L442)
395
-
396
- > def server_url
397
-
398
- Get the server url
399
-
400
- __Returns:__
401
-
402
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] the server url
403
-
404
- --
405
-
406
- ##### [restart](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L453)
407
-
408
- > def restart
409
-
410
- Restarts the driver
411
-
412
- __Returns:__
413
-
414
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Driver] the driver
415
-
416
- --
417
-
418
- ##### [screenshot](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L464)
419
-
420
- > def screenshot(png_save_path)
421
-
422
- Takes a png screenshot and saves to the target path.
423
-
424
- Example: screenshot '/tmp/hi.png'
43
+ :app is expanded
44
+ :require is expanded
45
+ all keys are converted to symbols
425
46
 
426
47
  __Parameters:__
427
48
 
428
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] png_save_path - the full path to save the png
429
-
430
- __Returns:__
431
-
432
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[nil]
433
-
434
- --
435
-
436
- ##### [driver_quit](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L471)
437
-
438
- > def driver_quit
439
-
440
- Quits the driver
441
-
442
- __Returns:__
443
-
444
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
445
-
446
- --
447
-
448
- ##### [start_driver](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L480)
449
-
450
- > def start_driver
451
-
452
- Creates a new global driver and quits the old one if it exists.
49
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] opts - file: '/path/to/appium.txt', verbose: true
453
50
 
454
51
  __Returns:__
455
52
 
456
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Selenium::WebDriver] the new global driver
457
-
458
- --
459
-
460
- ##### [no_wait](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L513)
461
-
462
- > def no_wait
463
-
464
- Set implicit wait and default_wait to zero.
465
-
466
- --
467
-
468
- ##### [set_wait](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L532)
469
-
470
- > def set_wait(timeout = nil)
471
-
472
- Set implicit wait and default_wait to timeout, defaults to 30.
473
- if set_wait is called without a param then the second to last
474
- wait will be used.
475
-
476
- ```ruby`
477
- set_wait 2
478
- set_wait 3
479
- set_wait # 2
480
-
481
- ````
482
-
483
- __Parameters:__
484
-
485
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] timeout - the timeout in seconds
486
-
487
- __Returns:__
488
-
489
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
490
-
491
- --
492
-
493
- ##### [exists](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L559)
494
-
495
- > def exists(pre_check = 0, post_check = @default_wait, &search_block)
496
-
497
- Returns existence of element.
498
-
499
- Example:
500
-
501
- exists { button('sign in') } ? puts('true') : puts('false')
502
-
503
- __Parameters:__
504
-
505
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] pre_check - the amount in seconds to set the
506
- wait to before checking existance
507
-
508
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] post_check - the amount in seconds to set the
509
- wait to after checking existance
510
-
511
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Block] search_block - the block to call
512
-
513
- __Returns:__
514
-
515
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Boolean]
516
-
517
- --
518
-
519
- ##### [execute_script](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L583)
520
-
521
- > def execute_script(script, *args)
522
-
523
- The same as @driver.execute_script
524
-
525
- __Parameters:__
526
-
527
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] script - the script to execute
528
-
529
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[*args] args - the args to pass to the script
530
-
531
- __Returns:__
532
-
533
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Object]
534
-
535
- --
536
-
537
- ##### [find_elements](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L591)
538
-
539
- > def find_elements(*args)
540
-
541
- Calls @driver.find_elements
542
-
543
- __Parameters:__
544
-
545
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[*args] args - the args to use
546
-
547
- __Returns:__
548
-
549
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>] Array is empty when no elements are found.
550
-
551
- --
552
-
553
- ##### [find_element](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L599)
554
-
555
- > def find_element(*args)
556
-
557
- Calls @driver.find_elements
558
-
559
- __Parameters:__
560
-
561
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[*args] args - the args to use
562
-
563
- __Returns:__
564
-
565
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
566
-
567
- --
568
-
569
- ##### [set_location](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L612)
570
-
571
- > def set_location(opts = {})
572
-
573
- Calls @driver.set_location
574
-
575
- __Parameters:__
576
-
577
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] opts - consisting of:
578
-
579
- __Returns:__
580
-
581
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Selenium::WebDriver::Location] the location constructed by the selenium webdriver
582
-
583
- --
584
-
585
- ##### [x](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/driver.rb#L622)
586
-
587
- > def x
588
-
589
- Quit the driver and Pry.
590
- quit and exit are reserved by Pry.
591
-
592
- __Returns:__
593
-
594
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
595
-
596
- --
597
-
598
- ##### [logger=](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/logger.rb#L13)
599
-
600
- > def logger=(value)
601
-
602
- Sets the attribute logger
603
-
604
- __Parameters:__
605
-
606
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value - the value to set the attribute logger to.
607
-
608
- --
609
-
610
- ##### [logger](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/logger.rb#L17)
611
-
612
- > def logger
613
-
614
-
615
-
616
- --
617
-
618
- ##### [NoArgMethods](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L7)
619
-
620
- > NoArgMethods = {
621
-
622
-
623
-
624
- --
625
-
626
- ##### [app_strings](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L25)
627
-
628
- > def app_strings
629
-
630
- Return the hash of all localization strings.
631
- ```ruby
632
- app_strings #=> "TransitionsTitle"=>"Transitions", "WebTitle"=>"Web"
633
- ```
634
-
635
- --
636
-
637
- ##### [background_app](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L31)
638
-
639
- > def background_app
640
-
641
- Backgrounds the app for a set number of seconds.
642
- This is a blocking application
643
-
644
- --
645
-
646
- ##### [current_activity](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L36)
647
-
648
- > def current_activity
649
-
650
-
651
-
652
- --
653
-
654
- ##### [launch_app](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L38)
655
-
656
- > def launch_app
657
-
658
- Start the simulator and application configured with desired capabilities
659
-
660
- --
661
-
662
- ##### [reset](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L41)
663
-
664
- > def reset
665
-
666
- Reset the device, relaunching the application.
667
-
668
- --
669
-
670
- ##### [shake](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L44)
671
-
672
- > def shake
673
-
674
- Cause the device to shake
675
-
676
- --
677
-
678
- ##### [toggle_flight_mode](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L47)
679
-
680
- > def toggle_flight_mode
681
-
682
- Toggle flight mode on or off
683
-
684
- --
685
-
686
- ##### [device_locked?](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L50)
687
-
688
- > def device_locked?
689
-
690
-
691
-
692
- --
693
-
694
- ##### [hide_keyboard](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L52)
695
-
696
- > def hide_keyboard
697
-
698
- Hide the onscreen keyboard
699
-
700
- __Parameters:__
701
-
702
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] close_key - the name of the key which closes the keyboard.
703
- Defaults to 'Done'.
704
-
705
- --
706
-
707
- ##### [press_keycode](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L61)
708
-
709
- > def press_keycode
710
-
711
- Press keycode on the device.
712
- http://developer.android.com/reference/android/view/KeyEvent.html
713
-
714
- __Parameters:__
715
-
716
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[integer] key - The key to press.
717
-
718
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] metastate - The state the metakeys should be in when pressing the key.
719
-
720
- --
721
-
722
- ##### [long_press_keycode](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L67)
723
-
724
- > def long_press_keycode
725
-
726
- Long press keycode on the device.
727
- http://developer.android.com/reference/android/view/KeyEvent.html
728
-
729
- __Parameters:__
730
-
731
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[integer] key - The key to long press.
732
-
733
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] metastate - The state the metakeys should be in when long pressing the key.
734
-
735
- --
736
-
737
- ##### [push_file](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L73)
738
-
739
- > def push_file
740
-
741
- Place a file in a specific location on the device.
742
-
743
- __Parameters:__
744
-
745
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] path - The absolute path on the device to store data at.
746
-
747
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] data - Raw file data to be sent to the device.
748
-
749
- --
750
-
751
- ##### [pull_file](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L78)
752
-
753
- > def pull_file
754
-
755
- Retrieve a file from the device. This can retrieve an absolute path or
756
- a path relative to the installed app (iOS only).
757
- ```ruby
758
- pull_file '/local/data/some/path' #=> Get the file at that path
759
- pull_file 'Shenanigans.app/some/file' #=> Get 'some/file' from the install location of Shenanigans.app
760
- ```
761
-
762
- __Parameters:__
763
-
764
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] path - Either an absolute path OR, for iOS devices, a path relative to the app, as described.
765
-
766
- --
767
-
768
- ##### [pull_folder](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L88)
769
-
770
- > def pull_folder
771
-
772
- Retrieve a folder from the device.
773
- ```ruby
774
- pull_folder '/data/local/tmp' #=> Get the folder at that path
775
- ```
776
-
777
- __Parameters:__
778
-
779
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] path - absolute path to the folder
780
-
781
- --
782
-
783
- ##### [touch_id](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L96)
784
-
785
- > def touch_id
786
-
787
- iOS only; Simulate Touch ID with either valid (match == true) or invalid (match == false) fingerprint.
788
- ```ruby
789
- touch_id true #=> Simulate valid fingerprint
790
- touch_id false #=> Simulate invalid fingerprint
791
- ```
792
-
793
- __Parameters:__
794
-
795
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Boolean] match - fingerprint validity
796
- Defaults to true.
797
-
798
- --
799
-
800
- ##### [end_coverage](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L105)
801
-
802
- > def end_coverage
803
-
804
- Android only; Ends the test coverage and writes the results to the given path on device.
805
-
806
- __Parameters:__
807
-
808
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] path - Path on the device to write too.
809
-
810
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] intent - Intent to broadcast when ending coverage.
811
-
812
- --
813
-
814
- ##### [get_settings](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L110)
815
-
816
- > def get_settings
817
-
818
- Get appium Settings for current test session
819
-
820
- --
821
-
822
- ##### [extend_search_contexts](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L370)
823
-
824
- > def extend_search_contexts
825
-
826
-
827
-
828
- --
829
-
830
- ##### [find_element](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L370)
831
-
832
- > def find_element
833
-
834
-
835
-
836
- --
837
-
838
- ##### [find_elements](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L370)
839
-
840
- > def find_elements
841
-
842
- find_element/s with their accessibility_id
843
-
844
- ```ruby
845
- find_elements :accessibility_id, 'Animation'
846
- ```
847
-
848
- --
849
-
850
- ##### [add_touch_actions](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L376)
851
-
852
- > def add_touch_actions
853
-
854
-
855
-
856
- --
857
-
858
- ##### [set_context](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L400)
859
-
860
- > def set_context
861
-
862
- Change the context to the given context.
863
- ```ruby
864
- set_context "NATIVE_APP"
865
- ```
866
-
867
- __Parameters:__
868
-
869
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] The - context to change to
870
-
871
- --
872
-
873
- ##### [current_context](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L408)
874
-
875
- > def current_context
876
-
877
-
878
-
879
- __Returns:__
880
-
881
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] The context currently being used.
882
-
883
- --
884
-
885
- ##### [available_contexts](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L411)
886
-
887
- > def available_contexts
888
-
889
-
890
-
891
- __Returns:__
892
-
893
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<String>] All usable contexts, as an array of strings.
894
-
895
- --
896
-
897
- ##### [within_context](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L421)
898
-
899
- > def within_context(context)
900
-
901
- Perform a block within the given context, then switch back to the starting context.
902
- ```ruby
903
- within_context('NATIVE_APP') do
904
- find_element [:tag, "button"]
905
- ```
906
-
907
- __Parameters:__
908
-
909
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] context - The context to switch to for the duration of the block.
910
-
911
- --
912
-
913
- ##### [switch_to_default_context](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/device.rb#L429)
914
-
915
- > def switch_to_default_context
916
-
917
- Change to the default context. This is equivalent to `set_context nil`.
918
-
919
- --
920
-
921
- ##### [pinch](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/multi_touch.rb#L28)
922
-
923
- > def pinch(percentage = 25, auto_perform = true)
924
-
925
- Convenience method for pinching the screen.
926
- Places two fingers at the edges of the screen and brings them together.
927
- ```ruby
928
- action = pinch 75 #=> Pinch the screen from the top right and bottom left corners
929
- action.perform #=> to 25% of its size.
930
- ```
931
-
932
- __Parameters:__
933
-
934
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[int] percentage - The percent size by which to shrink the screen when pinched.
935
-
936
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[boolean] auto_perform - Whether to perform the action immediately (default true)
937
-
938
- --
939
-
940
- ##### [zoom](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/multi_touch.rb#L56)
941
-
942
- > def zoom(percentage = 200, auto_perform = true)
943
-
944
- Convenience method for zooming the screen.
945
- Places two fingers at the edges of the screen and brings them together.
946
- ```ruby
947
- action = zoom 200 #=> Zoom in the screen from the center until it doubles in size.
948
- action.perform
949
- ```
950
-
951
- __Parameters:__
952
-
953
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[int] percentage - The percent size by which to shrink the screen when pinched.
954
-
955
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[boolean] auto_perform - Whether to perform the action immediately (default true)
956
-
957
- --
958
-
959
- ##### [initialize](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/multi_touch.rb#L77)
960
-
961
- > def initialize
962
-
963
- Create a new multi-action
964
-
965
- __Returns:__
966
-
967
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[MultiTouch] a new instance of MultiTouch
968
-
969
- --
970
-
971
- ##### [add](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/multi_touch.rb#L83)
972
-
973
- > def add(chain)
974
-
975
- Add a touch_action to be performed
976
-
977
- __Parameters:__
978
-
979
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[TouchAction] chain - The action to add to the chain
980
-
981
- --
982
-
983
- ##### [perform](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/multi_touch.rb#L88)
984
-
985
- > def perform
986
-
987
- Ask Appium to perform the actions
988
-
989
- --
990
-
991
- ##### [ACTIONS](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/touch_actions.rb#L11)
992
-
993
- > ACTIONS = [:move_to, :long_press, :double_tap, :two_finger_tap, :press, :release, :tap, :wait, :perform]
994
-
995
-
996
-
997
- --
998
-
999
- ##### [COMPLEX_ACTIONS](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/touch_actions.rb#L12)
1000
-
1001
- > COMPLEX_ACTIONS = [:swipe]
1002
-
1003
-
1004
-
1005
- --
1006
-
1007
- ##### [actions](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/touch_actions.rb#L26)
1008
-
1009
- > def actions
1010
-
1011
- Returns the value of attribute actions
1012
-
1013
- --
1014
-
1015
- ##### [initialize](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/touch_actions.rb#L28)
1016
-
1017
- > def initialize
1018
-
1019
-
1020
-
1021
- __Returns:__
1022
-
1023
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[TouchAction] a new instance of TouchAction
1024
-
1025
- --
1026
-
1027
- ##### [move_to](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/touch_actions.rb#L36)
1028
-
1029
- > def move_to(opts)
1030
-
1031
- Move to the given co-ordinates.
1032
-
1033
- __Parameters:__
1034
-
1035
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] opts - a customizable set of options
1036
-
1037
- --
1038
-
1039
- ##### [long_press](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/touch_actions.rb#L46)
1040
-
1041
- > def long_press(opts)
1042
-
1043
- Press down for a specific duration.
1044
-
1045
- __Parameters:__
1046
-
1047
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] element - a customizable set of options
1048
-
1049
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] x - a customizable set of options
1050
-
1051
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] y - a customizable set of options
1052
-
1053
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] duration - a customizable set of options
1054
-
1055
- --
1056
-
1057
- ##### [press](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/touch_actions.rb#L58)
1058
-
1059
- > def press(opts)
1060
-
1061
- Press a finger onto the screen. Finger will stay down until you call
1062
- `release`.
1063
-
1064
- __Parameters:__
1065
-
1066
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] opts - a customizable set of options
1067
-
1068
- --
1069
-
1070
- ##### [release](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/touch_actions.rb#L69)
1071
-
1072
- > def release(opts = nil)
1073
-
1074
- Remove a finger from the screen.
1075
-
1076
- __Parameters:__
1077
-
1078
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] opts - a customizable set of options
1079
-
1080
- --
1081
-
1082
- ##### [tap](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/touch_actions.rb#L80)
1083
-
1084
- > def tap(opts)
1085
-
1086
- Touch a point on the screen
1087
-
1088
- __Parameters:__
1089
-
1090
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] opts - a customizable set of options
1091
-
1092
- --
1093
-
1094
- ##### [double_tap](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/touch_actions.rb#L93)
1095
-
1096
- > def double_tap(opts)
1097
-
1098
- Double tap an element on the screen
1099
-
1100
- __Parameters:__
1101
-
1102
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] opts - a customizable set of options
1103
-
1104
- --
1105
-
1106
- ##### [two_finger_tap](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/touch_actions.rb#L104)
1107
-
1108
- > def two_finger_tap(opts)
1109
-
1110
- Two finger tap an element on the screen
1111
-
1112
- __Parameters:__
1113
-
1114
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] opts - a customizable set of options
1115
-
1116
- --
1117
-
1118
- ##### [wait](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/touch_actions.rb#L112)
1119
-
1120
- > def wait(milliseconds)
1121
-
1122
- Pause for a number of milliseconds before the next action
1123
-
1124
- __Parameters:__
1125
-
1126
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[integer] milliseconds - Number of milliseconds to pause for
1127
-
1128
- --
1129
-
1130
- ##### [swipe](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/touch_actions.rb#L127)
1131
-
1132
- > def swipe(opts)
1133
-
1134
- Convenience method to peform a swipe.
1135
-
1136
- Note that iOS 7 simulators have broken swipe.
1137
-
1138
- __Parameters:__
1139
-
1140
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] opts - a customizable set of options
1141
-
1142
- --
1143
-
1144
- ##### [perform](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/touch_actions.rb#L155)
1145
-
1146
- > def perform
1147
-
1148
- Ask the driver to perform all actions in this action chain.
1149
-
1150
- --
1151
-
1152
- ##### [cancel](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/touch_actions.rb#L161)
1153
-
1154
- > def cancel
1155
-
1156
- Does nothing, currently.
1157
-
1158
- --
1159
-
1160
- ##### [chain_method](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/touch_actions.rb#L169)
1161
-
1162
- > def chain_method(method, args = nil)
1163
-
1164
-
1165
-
1166
- --
1167
-
1168
- ##### [args_with_ele_ref](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/device/touch_actions.rb#L178)
1169
-
1170
- > def args_with_ele_ref(args)
1171
-
1172
-
1173
-
1174
- --
1175
-
1176
- ##### [_generic_wait](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/wait.rb#L9)
1177
-
1178
- > def _generic_wait(opts = {}, &block)
1179
-
1180
- Wait code from the selenium Ruby gem
1181
- https://github.com/SeleniumHQ/selenium/blob/cf501dda3f0ed12233de51ce8170c0e8090f0c20/rb/lib/selenium/webdriver/common/wait.rb
1182
-
1183
- --
1184
-
1185
- ##### [_process_wait_opts](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/wait.rb#L54)
1186
-
1187
- > def _process_wait_opts(opts)
1188
-
1189
- process opts before calling _generic_wait
1190
-
1191
- --
1192
-
1193
- ##### [wait_true](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/wait.rb#L75)
1194
-
1195
- > def wait_true(opts = {}, &block)
1196
-
1197
- Check every interval seconds to see if block.call returns a truthy value.
1198
- Note this isn't a strict boolean true, any truthy value is accepted.
1199
- false and nil are considered failures.
1200
- Give up after timeout seconds.
1201
-
1202
- Wait code from the selenium Ruby gem
1203
- https://github.com/SeleniumHQ/selenium/blob/cf501dda3f0ed12233de51ce8170c0e8090f0c20/rb/lib/selenium/webdriver/common/wait.rb
1204
-
1205
- If only a number is provided then it's treated as the timeout value.
1206
-
1207
- __Parameters:__
1208
-
1209
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] opts - Options
1210
-
1211
- --
1212
-
1213
- ##### [wait](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/wait.rb#L93)
1214
-
1215
- > def wait(opts = {}, &block)
1216
-
1217
- Check every interval seconds to see if block.call doesn't raise an exception.
1218
- Give up after timeout seconds.
1219
-
1220
- Wait code from the selenium Ruby gem
1221
- https://github.com/SeleniumHQ/selenium/blob/cf501dda3f0ed12233de51ce8170c0e8090f0c20/rb/lib/selenium/webdriver/common/wait.rb
1222
-
1223
- If only a number is provided then it's treated as the timeout value.
1224
-
1225
- __Parameters:__
1226
-
1227
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] opts - Options
1228
-
1229
- --
1230
-
1231
- ##### [ignore](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L24)
1232
-
1233
- > def ignore(&block)
1234
-
1235
- Return block.call and ignore any exceptions.
1236
-
1237
- --
1238
-
1239
- ##### [back](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L31)
1240
-
1241
- > def back
1242
-
1243
- Navigate back.
1244
-
1245
- __Returns:__
1246
-
1247
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
1248
-
1249
- --
1250
-
1251
- ##### [session_id](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L36)
1252
-
1253
- > def session_id
1254
-
1255
- For Sauce Labs reporting. Returns the current session id.
1256
-
1257
- --
1258
-
1259
- ##### [xpath](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L44)
1260
-
1261
- > def xpath(xpath_str)
1262
-
1263
- Returns the first element that matches the provided xpath.
1264
-
1265
- __Parameters:__
1266
-
1267
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] xpath_str - the XPath string
1268
-
1269
- __Returns:__
1270
-
1271
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1272
-
1273
- --
1274
-
1275
- ##### [xpaths](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L52)
1276
-
1277
- > def xpaths(xpath_str)
1278
-
1279
- Returns all elements that match the provided xpath.
1280
-
1281
- __Parameters:__
1282
-
1283
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] xpath_str - the XPath string
1284
-
1285
- __Returns:__
1286
-
1287
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>]
1288
-
1289
- --
1290
-
1291
- ##### [_print_source](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L56)
1292
-
1293
- > def _print_source(source)
1294
-
1295
-
1296
-
1297
- --
1298
-
1299
- ##### [result](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L69)
1300
-
1301
- > def result
1302
-
1303
- Returns the value of attribute result
1304
-
1305
- --
1306
-
1307
- ##### [initialize](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L71)
1308
-
1309
- > def initialize
1310
-
1311
-
1312
-
1313
- __Returns:__
1314
-
1315
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[CountElements] a new instance of CountElements
1316
-
1317
- --
1318
-
1319
- ##### [reset](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L75)
1320
-
1321
- > def reset
1322
-
1323
-
1324
-
1325
- --
1326
-
1327
- ##### [start_element](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L80)
1328
-
1329
- > def start_element(name, attrs = [])
1330
-
1331
- http://nokogiri.org/Nokogiri/XML/SAX/Document.html
1332
-
1333
- --
1334
-
1335
- ##### [formatted_result](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L86)
1336
-
1337
- > def formatted_result
1338
-
1339
-
1340
-
1341
- --
1342
-
1343
- ##### [get_page_class](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L97)
1344
-
1345
- > def get_page_class
1346
-
1347
- Returns a string of class counts of visible elements.
1348
-
1349
- --
1350
-
1351
- ##### [page_class](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L108)
1352
-
1353
- > def page_class
1354
-
1355
- Count all classes on screen and print to stdout.
1356
- Useful for appium_console.
1357
-
1358
- --
1359
-
1360
- ##### [px_to_window_rel](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L118)
1361
-
1362
- > def px_to_window_rel(opts = {})
1363
-
1364
- Converts pixel values to window relative values
1365
-
1366
- ```ruby
1367
- px_to_window_rel x: 50, y: 150
1368
- ```
1369
-
1370
- --
1371
-
1372
- ##### [xml_keys](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L137)
1373
-
1374
- > def xml_keys(target)
1375
-
1376
- Search strings.xml's values for target.
1377
-
1378
- __Parameters:__
1379
-
1380
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] target - the target to search for in strings.xml values
1381
-
1382
- __Returns:__
1383
-
1384
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array]
1385
-
1386
- --
1387
-
1388
- ##### [xml_values](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L145)
1389
-
1390
- > def xml_values(target)
1391
-
1392
- Search strings.xml's keys for target.
1393
-
1394
- __Parameters:__
1395
-
1396
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] target - the target to search for in strings.xml keys
1397
-
1398
- __Returns:__
1399
-
1400
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array]
1401
-
1402
- --
1403
-
1404
- ##### [resolve_id](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L153)
1405
-
1406
- > def resolve_id(id)
1407
-
1408
- Resolve id in strings.xml and return the value.
1409
-
1410
- __Parameters:__
1411
-
1412
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] id - the id to resolve
1413
-
1414
- __Returns:__
1415
-
1416
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
1417
-
1418
- --
1419
-
1420
- ##### [filter](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L159)
1421
-
1422
- > def filter
1423
-
1424
- Returns the value of attribute filter
1425
-
1426
- --
1427
-
1428
- ##### [filter=](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L162)
1429
-
1430
- > def filter=(value)
1431
-
1432
- convert to string to support symbols
1433
-
1434
- --
1435
-
1436
- ##### [initialize](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L168)
1437
-
1438
- > def initialize
1439
-
1440
-
1441
-
1442
- __Returns:__
1443
-
1444
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[HTMLElements] a new instance of HTMLElements
1445
-
1446
- --
1447
-
1448
- ##### [reset](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L173)
1449
-
1450
- > def reset
1451
-
1452
-
1453
-
1454
- --
1455
-
1456
- ##### [result](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L179)
1457
-
1458
- > def result
1459
-
1460
-
1461
-
1462
- --
1463
-
1464
- ##### [start_element](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L195)
1465
-
1466
- > def start_element(name, attrs = [])
1467
-
1468
-
1469
-
1470
- --
1471
-
1472
- ##### [end_element](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L204)
1473
-
1474
- > def end_element(name)
1475
-
1476
-
1477
-
1478
- --
1479
-
1480
- ##### [characters](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L210)
1481
-
1482
- > def characters(chars)
1483
-
1484
-
1485
-
1486
- --
1487
-
1488
- ##### [_no_such_element](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/helper.rb#L217)
1489
-
1490
- > def _no_such_element
1491
-
1492
-
1493
-
1494
- --
1495
-
1496
- ##### [window_size](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/element/window.rb#L5)
1497
-
1498
- > def window_size
1499
-
1500
- Get the window's size
1501
-
1502
- --
1503
-
1504
- ##### [result](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L6) android
1505
-
1506
- > def result
1507
-
1508
- Returns the value of attribute result
1509
-
1510
- --
1511
-
1512
- ##### [keys](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L6) android
1513
-
1514
- > def keys
1515
-
1516
- Returns the value of attribute keys
1517
-
1518
- --
1519
-
1520
- ##### [instance](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L6) android
1521
-
1522
- > def instance
1523
-
1524
- Returns the value of attribute instance
1525
-
1526
- --
1527
-
1528
- ##### [filter](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L6) android
1529
-
1530
- > def filter
1531
-
1532
- Returns the value of attribute filter
1533
-
1534
- --
1535
-
1536
- ##### [filter=](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L9) android
1537
-
1538
- > def filter=(value)
1539
-
1540
- convert to string to support symbols
1541
-
1542
- --
1543
-
1544
- ##### [initialize](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L15) android
1545
-
1546
- > def initialize
1547
-
1548
-
1549
-
1550
- __Returns:__
1551
-
1552
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[AndroidElements] a new instance of AndroidElements
1553
-
1554
- --
1555
-
1556
- ##### [reset](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L21) android
1557
-
1558
- > def reset
1559
-
1560
-
1561
-
1562
- --
1563
-
1564
- ##### [start_element](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L28) android
1565
-
1566
- > def start_element(name, attrs = [])
1567
-
1568
- http://nokogiri.org/Nokogiri/XML/SAX/Document.html
1569
-
1570
- --
1571
-
1572
- ##### [_fix_android_native_source](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L88) android
1573
-
1574
- > def _fix_android_native_source(source)
1575
-
1576
- Fix uiautomator's xml dump.
1577
- https://github.com/appium/appium/issues/2822
1578
- https://code.google.com/p/android/issues/detail?id=74143
1579
-
1580
- --
1581
-
1582
- ##### [source](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L116) android
1583
-
1584
- > def source
1585
-
1586
- Prints xml of the current page
1587
-
1588
- __Returns:__
1589
-
1590
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
1591
-
1592
- --
1593
-
1594
- ##### [get_android_inspect](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L126) android
1595
-
1596
- > def get_android_inspect(class_name = false)
1597
-
1598
- Android only.
1599
- Returns a string containing interesting elements.
1600
- The text, content description, and id are returned.
1601
- if false (default) then all classes will be inspected
1602
-
1603
- __Parameters:__
1604
-
1605
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class name to filter on.
1606
-
1607
- __Returns:__
1608
-
1609
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
1610
-
1611
- --
1612
-
1613
- ##### [page](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L152) android
1614
-
1615
- > def page(opts = {})
1616
-
1617
- Intended for use with console.
1618
- Inspects and prints the current page.
1619
- Will return XHTML for Web contexts because of a quirk with Nokogiri.
1620
- if nil (default) then all classes will be inspected
1621
-
1622
- __Parameters:__
1623
-
1624
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] class - a customizable set of options
1625
-
1626
- __Returns:__
1627
-
1628
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
1629
-
1630
- --
1631
-
1632
- ##### [current_app](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L164) android
1633
-
1634
- > def current_app
1635
-
1636
- example line:
1637
- "mFocusedApp=AppWindowToken{b1420058 token=Token{b128add0
1638
- ActivityRecord{b1264d10 u0 com.example.android.apis/.ApiDemos t23}}}"
1639
-
1640
- --
1641
-
1642
- ##### [id](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L188) android
1643
-
1644
- > def id(id)
1645
-
1646
- Find the first matching element by id
1647
-
1648
- __Parameters:__
1649
-
1650
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] id - the id to search for
1651
-
1652
- __Returns:__
1653
-
1654
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1655
-
1656
- --
1657
-
1658
- ##### [ids](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L196) android
1659
-
1660
- > def ids(id)
1661
-
1662
- Find all matching elements by id
1663
-
1664
- __Parameters:__
1665
-
1666
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] id - the id to search for
1667
-
1668
- __Returns:__
1669
-
1670
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1671
-
1672
- --
1673
-
1674
- ##### [ele_index](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L205) android
1675
-
1676
- > def ele_index(class_name, index)
1677
-
1678
- Find the element of type class_name at matching index.
1679
-
1680
- __Parameters:__
1681
-
1682
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class name to find
1683
-
1684
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] index - the index
1685
-
1686
- __Returns:__
1687
-
1688
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element] the found element of type class_name
1689
-
1690
- --
1691
-
1692
- ##### [first_ele](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L223) android
1693
-
1694
- > def first_ele(class_name)
1695
-
1696
- Find the first element that matches class_name
1697
-
1698
- __Parameters:__
1699
-
1700
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the tag to match
1701
-
1702
- __Returns:__
1703
-
1704
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1705
-
1706
- --
1707
-
1708
- ##### [last_ele](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L230) android
1709
-
1710
- > def last_ele(class_name)
1711
-
1712
- Find the last element that matches class_name
1713
-
1714
- __Parameters:__
1715
-
1716
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the tag to match
1717
-
1718
- __Returns:__
1719
-
1720
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1721
-
1722
- --
1723
-
1724
- ##### [tag](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L238) android
1725
-
1726
- > def tag(class_name)
1727
-
1728
- Find the first element of type class_name
1729
-
1730
- __Parameters:__
1731
-
1732
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class_name to search for
1733
-
1734
- __Returns:__
1735
-
1736
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1737
-
1738
- --
1739
-
1740
- ##### [tags](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L246) android
1741
-
1742
- > def tags(class_name)
1743
-
1744
- Find all elements of type class_name
1745
-
1746
- __Parameters:__
1747
-
1748
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class_name to search for
1749
-
1750
- __Returns:__
1751
-
1752
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1753
-
1754
- --
1755
-
1756
- ##### [string_visible_contains](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L288) android
1757
-
1758
- > def string_visible_contains(class_name, value)
1759
-
1760
- Returns a string that matches the first element that contains value
1761
-
1762
- example: complex_find_contains 'UIATextField', 'sign in'
1763
-
1764
- __Parameters:__
1765
-
1766
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class name for the element
1767
-
1768
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
1769
-
1770
- __Returns:__
1771
-
1772
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
1773
-
1774
- --
1775
-
1776
- ##### [complex_find_contains](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L308) android
1777
-
1778
- > def complex_find_contains(element, value)
1779
-
1780
- Find the first element that contains value
1781
-
1782
- __Parameters:__
1783
-
1784
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] element - the class name for the element
1785
-
1786
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
1787
-
1788
- __Returns:__
1789
-
1790
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1791
-
1792
- --
1793
-
1794
- ##### [complex_finds_contains](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L316) android
1795
-
1796
- > def complex_finds_contains(element, value)
1797
-
1798
- Find all elements containing value
1799
-
1800
- __Parameters:__
1801
-
1802
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] element - the class name for the element
1803
-
1804
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
1805
-
1806
- __Returns:__
1807
-
1808
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>]
1809
-
1810
- --
1811
-
1812
- ##### [complex_find_exact](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L345) android
1813
-
1814
- > def complex_find_exact(class_name, value)
1815
-
1816
- Find the first element exactly matching value
1817
-
1818
- __Parameters:__
1819
-
1820
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class name for the element
1821
-
1822
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
1823
-
1824
- __Returns:__
1825
-
1826
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1827
-
1828
- --
1829
-
1830
- ##### [complex_finds_exact](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L353) android
1831
-
1832
- > def complex_finds_exact(class_name, value)
1833
-
1834
- Find all elements exactly matching value
1835
-
1836
- __Parameters:__
1837
-
1838
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class name for the element
1839
-
1840
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
1841
-
1842
- __Returns:__
1843
-
1844
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1845
-
1846
- --
1847
-
1848
- ##### [get_source](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/helper.rb#L361) android
1849
-
1850
- > def get_source
1851
-
1852
- Returns XML string for the current page
1853
- Fixes uiautomator's $ in node names.
1854
- `android.app.ActionBar$Tab` becomes `android.app.ActionBar.Tab`
1855
-
1856
- __Returns:__
1857
-
1858
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
1859
-
1860
- --
1861
-
1862
- ##### [TextView](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/text.rb#L4) android
1863
-
1864
- > TextView = 'android.widget.TextView'
1865
-
1866
-
1867
-
1868
- --
1869
-
1870
- ##### [text](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/text.rb#L10) android
1871
-
1872
- > def text(value)
1873
-
1874
- Find the first TextView that contains value or by index.
1875
- If int then the TextView at that index is returned.
1876
-
1877
- __Parameters:__
1878
-
1879
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String, Integer] value - the value to find.
1880
-
1881
- __Returns:__
1882
-
1883
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[TextView]
1884
-
1885
- --
1886
-
1887
- ##### [texts](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/text.rb#L19) android
1888
-
1889
- > def texts(value = false)
1890
-
1891
- Find all TextViews containing value.
1892
- If value is omitted, all texts are returned.
1893
-
1894
- __Parameters:__
1895
-
1896
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
1897
-
1898
- __Returns:__
1899
-
1900
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<TextView>]
1901
-
1902
- --
1903
-
1904
- ##### [first_text](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/text.rb#L26) android
1905
-
1906
- > def first_text
1907
-
1908
- Find the first TextView.
1909
-
1910
- __Returns:__
1911
-
1912
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[TextView]
1913
-
1914
- --
1915
-
1916
- ##### [last_text](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/text.rb#L32) android
1917
-
1918
- > def last_text
1919
-
1920
- Find the last TextView.
1921
-
1922
- __Returns:__
1923
-
1924
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[TextView]
1925
-
1926
- --
1927
-
1928
- ##### [text_exact](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/text.rb#L39) android
1929
-
1930
- > def text_exact(value)
1931
-
1932
- Find the first TextView that exactly matches value.
1933
-
1934
- __Parameters:__
1935
-
1936
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to match exactly
1937
-
1938
- __Returns:__
1939
-
1940
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[TextView]
1941
-
1942
- --
1943
-
1944
- ##### [texts_exact](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/text.rb#L46) android
1945
-
1946
- > def texts_exact(value)
1947
-
1948
- Find all TextViews that exactly match value.
1949
-
1950
- __Parameters:__
1951
-
1952
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to match exactly
1953
-
1954
- __Returns:__
1955
-
1956
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<TextView>]
1957
-
1958
- --
1959
-
1960
- ##### [_nodeset_to_uiselector](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/client_xpath.rb#L5) android
1961
-
1962
- > def _nodeset_to_uiselector(opts = {})
1963
-
1964
-
1965
-
1966
- --
1967
-
1968
- ##### [_client_xpath](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/client_xpath.rb#L20) android
1969
-
1970
- > def _client_xpath(opts = {})
1971
-
1972
-
1973
-
1974
- --
1975
-
1976
- ##### [client_xpath](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/client_xpath.rb#L36) android
1977
-
1978
- > def client_xpath(xpath)
1979
-
1980
-
1981
-
1982
- --
1983
-
1984
- ##### [client_xpaths](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/client_xpath.rb#L40) android
1985
-
1986
- > def client_xpaths(xpath)
1987
-
1988
-
1989
-
1990
- --
1991
-
1992
- ##### [alert_click](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/alert.rb#L6) android
1993
-
1994
- > def alert_click(value)
1995
-
1996
- Click the first alert button that contains value or by index.
1997
-
1998
- __Parameters:__
1999
-
2000
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer, String] value - either an integer index of the button or the button's name
2001
-
2002
- __Returns:__
2003
-
2004
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
2005
-
2006
- --
2007
-
2008
- ##### [alert_accept](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/alert.rb#L13) android
2009
-
2010
- > def alert_accept
2011
-
2012
- Accept the alert.
2013
- The last button is considered "accept."
2014
-
2015
- __Returns:__
2016
-
2017
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
2018
-
2019
- --
2020
-
2021
- ##### [alert_accept_text](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/alert.rb#L20) android
2022
-
2023
- > def alert_accept_text
2024
-
2025
- Get the text of the alert's accept button.
2026
- The last button is considered "accept."
2027
-
2028
- __Returns:__
2029
-
2030
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
2031
-
2032
- --
2033
-
2034
- ##### [alert_dismiss](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/alert.rb#L27) android
2035
-
2036
- > def alert_dismiss
2037
-
2038
- Dismiss the alert.
2039
- The first button is considered "dismiss."
2040
-
2041
- __Returns:__
2042
-
2043
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
2044
-
2045
- --
2046
-
2047
- ##### [alert_dismiss_text](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/alert.rb#L34) android
2048
-
2049
- > def alert_dismiss_text
2050
-
2051
- Get the text of the alert's dismiss button.
2052
- The first button is considered "dismiss."
2053
-
2054
- __Returns:__
2055
-
2056
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
2057
-
2058
- --
2059
-
2060
- ##### [Button](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/button.rb#L4) android
2061
-
2062
- > Button = 'android.widget.Button'
2063
-
2064
-
2065
-
2066
- --
2067
-
2068
- ##### [ImageButton](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/button.rb#L5) android
2069
-
2070
- > ImageButton = 'android.widget.ImageButton'
2071
-
2072
-
2073
-
2074
- --
2075
-
2076
- ##### [button](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/button.rb#L43) android
2077
-
2078
- > def button(value)
2079
-
2080
- Find the first button that contains value or by index.
2081
- If int then the button at that index is returned.
2082
-
2083
- __Parameters:__
2084
-
2085
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String, Integer] value - the value to exactly match.
2086
-
2087
- __Returns:__
2088
-
2089
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Button]
2090
-
2091
- --
2092
-
2093
- ##### [buttons](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/button.rb#L60) android
2094
-
2095
- > def buttons(value = false)
2096
-
2097
- Find all buttons containing value.
2098
- If value is omitted, all buttons are returned.
2099
-
2100
- __Parameters:__
2101
-
2102
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
2103
-
2104
- __Returns:__
2105
-
2106
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Button>]
2107
-
2108
- --
2109
-
2110
- ##### [first_button](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/button.rb#L67) android
2111
-
2112
- > def first_button
2113
-
2114
- Find the first button.
2115
-
2116
- __Returns:__
2117
-
2118
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Button]
2119
-
2120
- --
2121
-
2122
- ##### [last_button](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/button.rb#L73) android
2123
-
2124
- > def last_button
2125
-
2126
- Find the last button.
2127
-
2128
- __Returns:__
2129
-
2130
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Button]
2131
-
2132
- --
2133
-
2134
- ##### [button_exact](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/button.rb#L89) android
2135
-
2136
- > def button_exact(value)
2137
-
2138
- Find the first button that exactly matches value.
2139
-
2140
- __Parameters:__
2141
-
2142
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to match exactly
2143
-
2144
- __Returns:__
2145
-
2146
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Button]
2147
-
2148
- --
2149
-
2150
- ##### [buttons_exact](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/button.rb#L96) android
2151
-
2152
- > def buttons_exact(value)
2153
-
2154
- Find all buttons that exactly match value.
2155
-
2156
- __Parameters:__
2157
-
2158
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to match exactly
2159
-
2160
- __Returns:__
2161
-
2162
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Button>]
2163
-
2164
- --
2165
-
2166
- ##### [uiautomator_find](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/mobile_methods.rb#L10) android
2167
-
2168
- > def uiautomator_find
2169
-
2170
- find_element/s can be used with a [UISelector](http://developer.android.com/tools/help/uiautomator/UiSelector.html).
2171
-
2172
- ```ruby
2173
- find_elements :uiautomator, 'new UiSelector().clickable(true)'
2174
- ```
2175
-
2176
- --
2177
-
2178
- ##### [find](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/generic.rb#L6) android
2179
-
2180
- > def find(value)
2181
-
2182
- Find the first element containing value
2183
-
2184
- __Parameters:__
2185
-
2186
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
2187
-
2188
- __Returns:__
2189
-
2190
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
2191
-
2192
- --
2193
-
2194
- ##### [finds](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/generic.rb#L13) android
2195
-
2196
- > def finds(value)
2197
-
2198
- Find all elements containing value
2199
-
2200
- __Parameters:__
2201
-
2202
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
2203
-
2204
- __Returns:__
2205
-
2206
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>]
2207
-
2208
- --
2209
-
2210
- ##### [find_exact](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/generic.rb#L20) android
2211
-
2212
- > def find_exact(value)
2213
-
2214
- Find the first element exactly matching value
2215
-
2216
- __Parameters:__
2217
-
2218
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
2219
-
2220
- __Returns:__
2221
-
2222
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
2223
-
2224
- --
2225
-
2226
- ##### [finds_exact](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/generic.rb#L27) android
2227
-
2228
- > def finds_exact(value)
2229
-
2230
- Find all elements exactly matching value
2231
-
2232
- __Parameters:__
2233
-
2234
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
2235
-
2236
- __Returns:__
2237
-
2238
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>]
2239
-
2240
- --
2241
-
2242
- ##### [scroll_to](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/generic.rb#L39) android
2243
-
2244
- > def scroll_to(text)
2245
-
2246
- Scroll to the first element containing target text or description.
2247
-
2248
- __Parameters:__
2249
-
2250
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text to search for in the text value and content description
2251
-
2252
- __Returns:__
2253
-
2254
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element] the element scrolled to
2255
-
2256
- --
2257
-
2258
- ##### [scroll_to_exact](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/generic.rb#L51) android
2259
-
2260
- > def scroll_to_exact(text)
2261
-
2262
- Scroll to the first element with the exact target text or description.
2263
-
2264
- __Parameters:__
2265
-
2266
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text to search for in the text value and content description
2267
-
2268
- __Returns:__
2269
-
2270
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element] the element scrolled to
2271
-
2272
- --
2273
-
2274
- ##### [EditText](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/textfield.rb#L3) android
2275
-
2276
- > EditText = 'android.widget.EditText'
2277
-
2278
-
2279
-
2280
- --
2281
-
2282
- ##### [textfield](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/textfield.rb#L9) android
2283
-
2284
- > def textfield(value)
2285
-
2286
- Find the first EditText that contains value or by index.
2287
- If int then the EditText at that index is returned.
2288
-
2289
- __Parameters:__
2290
-
2291
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String, Integer] value - the text to match exactly.
2292
-
2293
- __Returns:__
2294
-
2295
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[EditText]
2296
-
2297
- --
2298
-
2299
- ##### [textfields](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/textfield.rb#L18) android
2300
-
2301
- > def textfields(value = false)
2302
-
2303
- Find all EditTexts containing value.
2304
- If value is omitted, all EditTexts are returned.
2305
-
2306
- __Parameters:__
2307
-
2308
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
2309
-
2310
- __Returns:__
2311
-
2312
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<EditText>]
2313
-
2314
- --
2315
-
2316
- ##### [first_textfield](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/textfield.rb#L25) android
2317
-
2318
- > def first_textfield
2319
-
2320
- Find the first EditText.
2321
-
2322
- __Returns:__
2323
-
2324
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[EditText]
2325
-
2326
- --
2327
-
2328
- ##### [last_textfield](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/textfield.rb#L31) android
2329
-
2330
- > def last_textfield
2331
-
2332
- Find the last EditText.
2333
-
2334
- __Returns:__
2335
-
2336
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[EditText]
2337
-
2338
- --
2339
-
2340
- ##### [textfield_exact](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/textfield.rb#L38) android
2341
-
2342
- > def textfield_exact(value)
2343
-
2344
- Find the first EditText that exactly matches value.
2345
-
2346
- __Parameters:__
2347
-
2348
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to match exactly
2349
-
2350
- __Returns:__
2351
-
2352
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[EditText]
2353
-
2354
- --
2355
-
2356
- ##### [textfields_exact](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/android/element/textfield.rb#L45) android
2357
-
2358
- > def textfields_exact(value)
2359
-
2360
- Find all EditTexts that exactly match value.
2361
-
2362
- __Parameters:__
2363
-
2364
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to match exactly
2365
-
2366
- __Returns:__
2367
-
2368
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<EditText>]
2369
-
2370
- --
2371
-
2372
- ##### [value](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/patch.rb#L12)
2373
-
2374
- > def value
2375
-
2376
- Returns the value attribute
2377
-
2378
- Fixes NoMethodError: undefined method `value' for Selenium::WebDriver::Element
2379
-
2380
- --
2381
-
2382
- ##### [name](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/patch.rb#L19)
2383
-
2384
- > def name
2385
-
2386
- Returns the name attribute
2387
-
2388
- Fixes NoMethodError: undefined method `name' for Selenium::WebDriver::Element
2389
-
2390
- --
2391
-
2392
- ##### [location_rel](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/patch.rb#L31)
2393
-
2394
- > def location_rel
2395
-
2396
- For use with mobile tap.
2397
-
2398
- ```ruby
2399
- execute_script 'mobile: tap', :x => 0.0, :y => 0.98
2400
- ```
2401
-
2402
- https://github.com/appium/appium/wiki/Automating-mobile-gestures
2403
-
2404
- __Returns:__
2405
-
2406
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[OpenStruct] the relative x, y in a struct. ex: { x: 0.50, y: 0.20 }
2407
-
2408
- --
2409
-
2410
- ##### [DEFAULT_HEADERS](https://github.com/appium/ruby_lib/blob/95d3a6535472559590c4d043e887d15acc445a1a/lib/appium_lib/common/patch.rb#L147)
2411
-
2412
- > DEFAULT_HEADERS = { 'Accept' => CONTENT_TYPE, 'User-Agent' => "appium/ruby_lib/#{::Appium::VERSION}" }
2413
-
2414
-
53
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[hash] the symbolized hash with updated :app and :require keys
2415
54
 
2416
55
  --
2417
56