appium_lib 14.0.0 → 15.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/docs/android_docs.md DELETED
@@ -1,2679 +0,0 @@
1
- ##### [load_settings](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/appium.rb#L60) common
2
-
3
- > def load_settings(opts = {})
4
-
5
- Load arbitrary text ([toml format](https://github.com/toml-lang/toml))
6
- The toml is parsed by https://github.com/fbernier/tomlrb .
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
19
-
20
- __Parameters:__
21
-
22
-      [Hash] opts - file: '/path/to/appium.txt', verbose: true
23
-
24
- __Returns:__
25
-
26
-      [hash] the symbolized hash with updated :app and :require keys
27
-
28
- --
29
-
30
- ##### [load_appium_txt](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/appium.rb#L108) common
31
-
32
- > def load_settings(opts = {})
33
-
34
- Load arbitrary text ([toml format](https://github.com/toml-lang/toml))
35
- The toml is parsed by https://github.com/fbernier/tomlrb .
36
-
37
- ```
38
- [caps]
39
- app = "path/to/app"
40
-
41
- [appium_lib]
42
- port = 8080
43
- ```
44
-
45
- :app is expanded
46
- :require is expanded
47
- all keys are converted to symbols
48
-
49
- __Parameters:__
50
-
51
-      [Hash] opts - file: '/path/to/appium.txt', verbose: true
52
-
53
- __Returns:__
54
-
55
-      [hash] the symbolized hash with updated :app and :require keys
56
-
57
- --
58
-
59
- ##### [expand_required_files](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/appium.rb#L113) common
60
-
61
- > def expand_required_files(base_dir, file_paths)
62
-
63
-
64
-
65
- __Parameters:__
66
-
67
-      [String] base_dir - parent directory of loaded appium.txt (toml)
68
-
69
-      [String] file_paths -
70
-
71
- __Returns:__
72
-
73
-      [Array] list of require files as an array, nil if require doesn't exist
74
-
75
- --
76
-
77
- ##### [promote_singleton_appium_methods](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/appium.rb#L155) common
78
-
79
- > def promote_singleton_appium_methods(modules, driver = $driver)
80
-
81
- This method is intended to work with page objects that share
82
- a common module. For example, Page::HomePage, Page::SignIn
83
- those could be promoted on with Appium.promote_singleton_appium_methods Page
84
-
85
- If you are promoting on an individual class then you should use
86
- Appium.promote_appium_methods instead. The singleton method is intended
87
- only for the shared module use case.
88
-
89
- if modules is a module instead of an array, then the constants of
90
- that module are promoted on.
91
- otherwise, the array of modules will be used as the promotion target.
92
-
93
- __Parameters:__
94
-
95
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Module>] modules - An array of modules
96
-
97
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Driver] driver - A driver to extend for
98
-
99
- --
100
-
101
- ##### [promote_appium_methods](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/appium.rb#L209) common
102
-
103
- > def promote_appium_methods(class_array, driver = $driver)
104
-
105
- Promote appium methods to class instance methods
106
-
107
- To promote methods to all classes:
108
-
109
- It's better to promote on specific classes instead of Object
110
-
111
- __Parameters:__
112
-
113
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Class>] class_array - An array of classes
114
-
115
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Driver] driver - A driver to extend for
116
-
117
- --
118
-
119
- ##### [global_webdriver_http_sleep](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L49) common
120
-
121
- > def global_webdriver_http_sleep
122
-
123
- The amount to sleep in seconds before every webdriver http call.
124
-
125
- --
126
-
127
- ##### [global_webdriver_http_sleep=](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L49) common
128
-
129
- > def global_webdriver_http_sleep=(value)
130
-
131
- The amount to sleep in seconds before every webdriver http call.
132
-
133
- --
134
-
135
- ##### [sauce](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L52) common
136
-
137
- > def sauce
138
-
139
- SauceLab's settings
140
-
141
- --
142
-
143
- ##### [sauce_username](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L55) common
144
-
145
- > def sauce_username
146
-
147
- Username for use on Sauce Labs. Set `false` to disable Sauce, even when SAUCE_USERNAME is in ENV.
148
- same as @sauce.username
149
-
150
- --
151
-
152
- ##### [sauce_access_key](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L58) common
153
-
154
- > def sauce_access_key
155
-
156
- Access Key for use on Sauce Labs. Set `false` to disable Sauce, even when SAUCE_ACCESS_KEY is in ENV.
157
- same as @sauce.access_key
158
-
159
- --
160
-
161
- ##### [sauce_endpoint](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L61) common
162
-
163
- > def sauce_endpoint
164
-
165
- Override the Sauce Appium endpoint to allow e.g. TestObject tests
166
- same as @sauce.endpoint
167
-
168
- --
169
-
170
- ##### [caps](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L65) common
171
-
172
- > def caps
173
-
174
- from Core
175
- read http://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Driver
176
-
177
- --
178
-
179
- ##### [custom_url](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L66) common
180
-
181
- > def custom_url
182
-
183
- Returns the value of attribute custom_url.
184
-
185
- --
186
-
187
- ##### [default_wait](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L67) common
188
-
189
- > def default_wait
190
-
191
- Returns the value of attribute default_wait.
192
-
193
- --
194
-
195
- ##### [appium_port](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L68) common
196
-
197
- > def appium_port
198
-
199
- Returns the value of attribute appium_port.
200
-
201
- --
202
-
203
- ##### [appium_device](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L69) common
204
-
205
- > def appium_device
206
-
207
- Returns the value of attribute appium_device.
208
-
209
- --
210
-
211
- ##### [automation_name](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L70) common
212
-
213
- > def automation_name
214
-
215
- Returns the value of attribute automation_name.
216
-
217
- --
218
-
219
- ##### [listener](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L71) common
220
-
221
- > def listener
222
-
223
- Returns the value of attribute listener.
224
-
225
- --
226
-
227
- ##### [http_client](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L72) common
228
-
229
- > def http_client
230
-
231
- Returns the value of attribute http_client.
232
-
233
- --
234
-
235
- ##### [appium_wait_timeout](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L73) common
236
-
237
- > def appium_wait_timeout
238
-
239
- Returns the value of attribute appium_wait_timeout.
240
-
241
- --
242
-
243
- ##### [appium_wait_interval](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L74) common
244
-
245
- > def appium_wait_interval
246
-
247
- Returns the value of attribute appium_wait_interval.
248
-
249
- --
250
-
251
- ##### [appium_server_status](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L77) common
252
-
253
- > def appium_server_status
254
-
255
- Appium's server version
256
-
257
- --
258
-
259
- ##### [appium_debug](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L79) common
260
-
261
- > def appium_debug
262
-
263
- Boolean debug mode for the Appium Ruby bindings
264
-
265
- --
266
-
267
- ##### [driver](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L82) common
268
-
269
- > def driver
270
-
271
- Returns the driver
272
-
273
- __Returns:__
274
-
275
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Driver] the driver
276
-
277
- --
278
-
279
- ##### [core](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L84) common
280
-
281
- > def core
282
-
283
- Instance of Appium::Core::Driver
284
-
285
- --
286
-
287
- ##### [initialize](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L153) common
288
-
289
- > def initialize(opts = {}, global_driver = false)
290
-
291
- Creates a new driver. The driver is defined as global scope by default.
292
- We can avoid defining global driver.
293
-
294
- __Parameters:__
295
-
296
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Object] opts - A hash containing various options.
297
-
298
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Bool] global_driver - A bool require global driver before initialize.
299
-
300
- __Returns:__
301
-
302
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Driver]
303
-
304
- --
305
-
306
- ##### [driver_attributes](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L273) common
307
-
308
- > def driver_attributes
309
-
310
- Returns a hash of the driver attributes
311
-
312
- --
313
-
314
- ##### [device_is_android?](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L291) common
315
-
316
- > def device_is_android?
317
-
318
-
319
-
320
- __Returns:__
321
-
322
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Boolean]
323
-
324
- --
325
-
326
- ##### [device_is_ios?](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L295) common
327
-
328
- > def device_is_ios?
329
-
330
-
331
-
332
- __Returns:__
333
-
334
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Boolean]
335
-
336
- --
337
-
338
- ##### [device_is_windows?](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L299) common
339
-
340
- > def device_is_windows?
341
-
342
-
343
-
344
- __Returns:__
345
-
346
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Boolean]
347
-
348
- --
349
-
350
- ##### [automation_name_is_uiautomator2?](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L305) common
351
-
352
- > def automation_name_is_uiautomator2?
353
-
354
- Return true if automationName is 'uiautomator2'
355
-
356
- __Returns:__
357
-
358
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Boolean]
359
-
360
- --
361
-
362
- ##### [automation_name_is_espresso?](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L311) common
363
-
364
- > def automation_name_is_espresso?
365
-
366
- Return true if automationName is 'Espresso'
367
-
368
- __Returns:__
369
-
370
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Boolean]
371
-
372
- --
373
-
374
- ##### [automation_name_is_xcuitest?](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L317) common
375
-
376
- > def automation_name_is_xcuitest?
377
-
378
- Return true if automationName is 'XCUITest'
379
-
380
- __Returns:__
381
-
382
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Boolean]
383
-
384
- --
385
-
386
- ##### [action](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L331) common
387
-
388
- > def action
389
-
390
- An entry point to chain W3C actions
391
- Read https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Base/Bridge/W3C#action-instance_method
392
-
393
- __Returns:__
394
-
395
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[TouchAction|Selenium::WebDriver::PointerActions]
396
-
397
- --
398
-
399
- ##### [appium_server_version](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L346) common
400
-
401
- > def appium_server_version
402
-
403
- Returns the server's version info
404
-
405
- __Returns:__
406
-
407
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash]
408
-
409
- --
410
-
411
- ##### [remote_status](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L354) common
412
-
413
- > def appium_server_version
414
-
415
- Returns the server's version info
416
-
417
- __Returns:__
418
-
419
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash]
420
-
421
- --
422
-
423
- ##### [platform_version](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L358) common
424
-
425
- > def platform_version
426
-
427
- Return the platform version as an array of integers
428
-
429
- __Returns:__
430
-
431
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Integer>]
432
-
433
- --
434
-
435
- ##### [appium_client_version](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L374) common
436
-
437
- > def appium_client_version
438
-
439
- Returns the client's version info
440
-
441
- __Returns:__
442
-
443
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash]
444
-
445
- --
446
-
447
- ##### [absolute_app_path](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L386) common
448
-
449
- > def absolute_app_path(opts)
450
-
451
- [Deprecated] Converts app_path to an absolute path.
452
-
453
- opts is the full options hash (caps and appium_lib). If server_url is set
454
- then the app path is used as is.
455
-
456
- if app isn't set then an error is raised.
457
-
458
- __Returns:__
459
-
460
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] APP_PATH as an absolute path
461
-
462
- --
463
-
464
- ##### [server_url](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L411) common
465
-
466
- > def server_url
467
-
468
- Get the server url
469
-
470
- __Returns:__
471
-
472
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] the server url
473
-
474
- --
475
-
476
- ##### [restart](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L420) common
477
-
478
- > def restart
479
-
480
- Restarts the driver
481
-
482
- __Returns:__
483
-
484
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Driver] the driver
485
-
486
- --
487
-
488
- ##### [screenshot](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L433) common
489
-
490
- > def screenshot(png_save_path)
491
-
492
- Takes a png screenshot and saves to the target path.
493
-
494
- __Parameters:__
495
-
496
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] png_save_path - the full path to save the png
497
-
498
- __Returns:__
499
-
500
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[File]
501
-
502
- --
503
-
504
- ##### [element_screenshot](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L447) common
505
-
506
- > def element_screenshot(element, png_save_path)
507
-
508
- Takes a png screenshot of particular element's area
509
-
510
- __Parameters:__
511
-
512
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] element - Element take a screenshot
513
-
514
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] png_save_path - the full path to save the png
515
-
516
- __Returns:__
517
-
518
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[File]
519
-
520
- --
521
-
522
- ##### [driver_quit](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L454) common
523
-
524
- > def driver_quit
525
-
526
- Quits the driver
527
-
528
- __Returns:__
529
-
530
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
531
-
532
- --
533
-
534
- ##### [quit_driver](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L460) common
535
-
536
- > def driver_quit
537
-
538
- Quits the driver
539
-
540
- __Returns:__
541
-
542
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
543
-
544
- --
545
-
546
- ##### [window_size](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L471) common
547
-
548
- > def window_size
549
-
550
- Get the device window's size.
551
-
552
- __Returns:__
553
-
554
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Selenium::WebDriver::Dimension]
555
-
556
- --
557
-
558
- ##### [window_rect](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L486) common
559
-
560
- > def window_rect
561
-
562
- Get the device window's rect.
563
-
564
- __Returns:__
565
-
566
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Selenium::WebDriver::Rectangle]
567
-
568
- --
569
-
570
- ##### [start_driver](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L519) common
571
-
572
- > def start_driver(http_client_ops = { http_client: ::Appium::Http::Default.new, open_timeout: 999_999, read_timeout: 999_999 })
573
-
574
- Creates a new global driver and quits the old one if it exists.
575
- You can customise http_client as the following
576
-
577
- Read http://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device to understand more what the driver
578
- can call instance methods.
579
-
580
- __Parameters:__
581
-
582
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] http_client_ops - a customizable set of options
583
-
584
- __Returns:__
585
-
586
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Selenium::WebDriver] the new global driver
587
-
588
- --
589
-
590
- ##### [set_implicit_wait](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L546) common
591
-
592
- > def set_implicit_wait(wait)
593
-
594
- To ignore error for Espresso Driver
595
-
596
- --
597
-
598
- ##### [no_wait](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L557) common
599
-
600
- > def no_wait
601
-
602
- Set implicit wait to zero.
603
-
604
- --
605
-
606
- ##### [set_wait](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L571) common
607
-
608
- > def set_wait(timeout = nil)
609
-
610
- Set implicit wait. Default to @default_wait.
611
-
612
- __Parameters:__
613
-
614
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] timeout - the timeout in seconds
615
-
616
- __Returns:__
617
-
618
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
619
-
620
- --
621
-
622
- ##### [exists](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L588) common
623
-
624
- > def exists(pre_check = 0, post_check = @default_wait)
625
-
626
- Returns existence of element.
627
-
628
- Example:
629
-
630
- exists { button('sign in') } ? puts('true') : puts('false')
631
-
632
- __Parameters:__
633
-
634
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] pre_check - The amount in seconds to set the
635
- wait to before checking existence
636
-
637
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] post_check - The amount in seconds to set the
638
- wait to after checking existence
639
-
640
- __Returns:__
641
-
642
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Boolean]
643
-
644
- --
645
-
646
- ##### [execute_script](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L612) common
647
-
648
- > def execute_script(script, *args)
649
-
650
- The same as @driver.execute_script
651
-
652
- __Parameters:__
653
-
654
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] script - The script to execute
655
-
656
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[*args] args - The args to pass to the script
657
-
658
- __Returns:__
659
-
660
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Object]
661
-
662
- --
663
-
664
- ##### [execute_async_script](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L620) common
665
-
666
- > def execute_async_script(script, *args)
667
-
668
- Wrap calling selenium webdrier APIs via ruby_core
669
-
670
- Get the window handles of open browser windows
671
-
672
- --
673
-
674
- ##### [execute_driver](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L652) common
675
-
676
- > def execute_driver(script: '', type: 'webdriverio', timeout_ms: nil)
677
-
678
- Run a set of script against the current session, allowing execution of many commands in one Appium request.
679
- Supports {https://webdriver.io/docs/api.html WebdriverIO} API so far.
680
- Please read {http://appium.io/docs/en/commands/session/execute-driver command API} for more details
681
- about acceptable scripts and the output.
682
-
683
- __Parameters:__
684
-
685
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] script - The string consisting of the script itself
686
-
687
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] type - The name of the script type.
688
- Defaults to 'webdriverio'. Depends on server implementation which type is supported.
689
-
690
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] timeout_ms - The number of `ms` Appium should wait for the script to finish
691
- before killing it due to timeout.
692
-
693
- __Returns:__
694
-
695
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Appium::Core::Base::Device::ExecuteDriver::Result] The script result parsed by
696
- Appium::Core::Base::Device::ExecuteDriver::Result.
697
-
698
- --
699
-
700
- ##### [window_handles](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L656) common
701
-
702
- > def window_handles
703
-
704
-
705
-
706
- --
707
-
708
- ##### [window_handle](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L661) common
709
-
710
- > def window_handle
711
-
712
- Get the current window handle
713
-
714
- --
715
-
716
- ##### [navigate](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L665) common
717
-
718
- > def navigate
719
-
720
-
721
-
722
- --
723
-
724
- ##### [manage](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L669) common
725
-
726
- > def manage
727
-
728
-
729
-
730
- --
731
-
732
- ##### [get](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L673) common
733
-
734
- > def get(url)
735
-
736
-
737
-
738
- --
739
-
740
- ##### [current_url](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L677) common
741
-
742
- > def current_url
743
-
744
-
745
-
746
- --
747
-
748
- ##### [title](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L681) common
749
-
750
- > def title
751
-
752
-
753
-
754
- --
755
-
756
- ##### [switch_to](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L687) common
757
-
758
- > def switch_to
759
-
760
-
761
-
762
- __Returns:__
763
-
764
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[TargetLocator]
765
-
766
- --
767
-
768
- ##### [find_elements](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L714) common
769
-
770
- > def find_elements(*args)
771
-
772
- Calls @driver.find_elements_with_appium
773
-
774
- If you call `Appium.promote_appium_methods`, you can call `find_elements` directly.
775
-
776
- If you call `Appium.promote_appium_methods`, you can call `find_elements` directly.
777
-
778
- __Parameters:__
779
-
780
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[*args] args - The args to use
781
-
782
- __Returns:__
783
-
784
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>] Array is empty when no elements are found.
785
-
786
- --
787
-
788
- ##### [find_element](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L730) common
789
-
790
- > def find_element(*args)
791
-
792
- Calls @driver.find_element
793
-
794
- If you call `Appium.promote_appium_methods`, you can call `find_element` directly.
795
-
796
- __Parameters:__
797
-
798
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[*args] args - The args to use
799
-
800
- __Returns:__
801
-
802
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
803
-
804
- --
805
-
806
- ##### [find_element_by_image](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L745) common
807
-
808
- > def find_element_by_image(png_img_path)
809
-
810
- Return ImageElement if current view has a partial image
811
-
812
- __Parameters:__
813
-
814
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] png_img_path - A path to a partial image you'd like to find
815
-
816
- __Returns:__
817
-
818
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[::Appium::Core::ImageElement]
819
-
820
- --
821
-
822
- ##### [find_elements_by_image](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L760) common
823
-
824
- > def find_elements_by_image(png_img_paths)
825
-
826
- Return ImageElement if current view has partial images
827
-
828
- __Parameters:__
829
-
830
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[String]] png_img_paths - Paths to a partial image you'd like to find
831
-
832
- __Returns:__
833
-
834
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[::Appium::Core::ImageElement]]
835
-
836
- --
837
-
838
- ##### [set_location](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L773) common
839
-
840
- > def set_location(opts = {})
841
-
842
- Calls @driver.set_location
843
-
844
- __Parameters:__
845
-
846
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] opts - consisting of:
847
-
848
- __Returns:__
849
-
850
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Selenium::WebDriver::Location] the location constructed by the selenium webdriver
851
-
852
- --
853
-
854
- ##### [log_event](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L797) common
855
-
856
- > def log_event(vendor:, event:)
857
-
858
- Logs a custom event. The event is available via {::Appium::Core::Events#get} or
859
- <code>driver.session_capabilities['events']</code> with <code>eventTimings</code> capabilities.
860
-
861
- __Parameters:__
862
-
863
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] vendor - The vendor prefix for the event
864
-
865
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] event - The name of event
866
-
867
- __Returns:__
868
-
869
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[nil]
870
-
871
- --
872
-
873
- ##### [log_event=](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L801) common
874
-
875
- > def log_event=(log_event)
876
-
877
-
878
-
879
- --
880
-
881
- ##### [log_events](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L820) common
882
-
883
- > def log_events(type = nil)
884
-
885
- Returns events with filtering with 'type'. Defaults to all available events.
886
-
887
- __Parameters:__
888
-
889
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] type - The type of events to get
890
-
891
- __Returns:__
892
-
893
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash]
894
-
895
- --
896
-
897
- ##### [x](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/driver.rb#L827) common
898
-
899
- > def x
900
-
901
- Quit the driver and Pry.
902
- quit and exit are reserved by Pry.
903
-
904
- __Returns:__
905
-
906
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
907
-
908
- --
909
-
910
- ##### [username](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/sauce_labs.rb#L18) common
911
-
912
- > def username
913
-
914
- Username for use on Sauce Labs. Set `false` to disable Sauce, even when SAUCE_USERNAME is in ENV.
915
-
916
- --
917
-
918
- ##### [access_key](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/sauce_labs.rb#L20) common
919
-
920
- > def access_key
921
-
922
- Access Key for use on Sauce Labs. Set `false` to disable Sauce, even when SAUCE_ACCESS_KEY is in ENV.
923
-
924
- --
925
-
926
- ##### [endpoint](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/sauce_labs.rb#L22) common
927
-
928
- > def endpoint
929
-
930
- Override the Sauce Appium endpoint to allow e.g. TestObject tests. Default is 'ondemand.saucelabs.com:443/wd/hub'.
931
-
932
- --
933
-
934
- ##### [initialize](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/sauce_labs.rb#L47) common
935
-
936
- > def initialize(appium_lib_opts)
937
-
938
- Create a SauceLabs instance to manage sauce labs related attributes.
939
-
940
- __Parameters:__
941
-
942
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] appium_lib_opts - Appium library parameter
943
-
944
- __Returns:__
945
-
946
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Appium::SauceLabs]
947
-
948
- --
949
-
950
- ##### [sauce_server_url?](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/sauce_labs.rb#L67) common
951
-
952
- > def sauce_server_url?
953
-
954
- Return true if an instance of Appium::SauceLabs has sauce_username and sauce_access_key.
955
-
956
- __Returns:__
957
-
958
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Boolean]
959
-
960
- --
961
-
962
- ##### [server_url](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/sauce_labs.rb#L80) common
963
-
964
- > def server_url
965
-
966
- Return a particular server url to access to. Default is the local address.
967
-
968
- __Returns:__
969
-
970
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
971
-
972
- --
973
-
974
- ##### [get_log](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/log.rb#L25) common
975
-
976
- > def get_log(type)
977
-
978
-
979
-
980
- __Parameters:__
981
-
982
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String|Hash] type - You can get particular type's logs.
983
-
984
- __Returns:__
985
-
986
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[Selenium::WebDriver::LogEntry]] A list of logs data.
987
-
988
- --
989
-
990
- ##### [get_available_log_types](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/log.rb#L37) common
991
-
992
- > def get_available_log_types
993
-
994
- Get a list of available log types
995
-
996
- __Returns:__
997
-
998
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[String]] A list of available log types.
999
-
1000
- --
1001
-
1002
- ##### [wait_true](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/wait.rb#L44) common
1003
-
1004
- > def wait_true(opts = {})
1005
-
1006
- Check every interval seconds to see if yield returns a truthy value.
1007
- Note this isn't a strict boolean true, any truthy value is accepted.
1008
- false and nil are considered failures.
1009
- Give up after timeout seconds.
1010
-
1011
- Wait code from the selenium Ruby gem
1012
- https://github.com/SeleniumHQ/selenium/blob/cf501dda3f0ed12233de51ce8170c0e8090f0c20/rb/lib/selenium/webdriver/common/wait.rb
1013
-
1014
- If only a number is provided then it's treated as the timeout value.
1015
-
1016
- __Parameters:__
1017
-
1018
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash|Numeric] opts - Options. If the value is _Numeric_, the value is set as `{ timeout: value }`
1019
-
1020
- --
1021
-
1022
- ##### [wait](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/wait.rb#L73) common
1023
-
1024
- > def wait(opts = {})
1025
-
1026
- Check every interval seconds to see if yield doesn't raise an exception.
1027
- Give up after timeout seconds.
1028
-
1029
- Wait code from the selenium Ruby gem
1030
- https://github.com/SeleniumHQ/selenium/blob/cf501dda3f0ed12233de51ce8170c0e8090f0c20/rb/lib/selenium/webdriver/common/wait.rb
1031
-
1032
- If only a number is provided then it's treated as the timeout value.
1033
-
1034
- __Parameters:__
1035
-
1036
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash|Numeric] opts - Options. If the value is _Numeric_, the value is set as `{ timeout: value }`
1037
-
1038
- --
1039
-
1040
- ##### [add_touch_actions](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/device.rb#L26) common
1041
-
1042
- > def add_touch_actions
1043
-
1044
-
1045
-
1046
- --
1047
-
1048
- ##### [delegate_from_appium_driver](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/device.rb#L38) common
1049
-
1050
- > def delegate_from_appium_driver(method, delegation_target)
1051
-
1052
-
1053
-
1054
- --
1055
-
1056
- ##### [ignore](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L30) common
1057
-
1058
- > def ignore
1059
-
1060
- Return yield and ignore any exceptions.
1061
-
1062
- --
1063
-
1064
- ##### [back](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L38) common
1065
-
1066
- > def back
1067
-
1068
- Navigate back.
1069
-
1070
- __Returns:__
1071
-
1072
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
1073
-
1074
- --
1075
-
1076
- ##### [session_id](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L49) common
1077
-
1078
- > def session_id
1079
-
1080
- For Sauce Labs reporting. Returns the current session id.
1081
-
1082
- __Returns:__
1083
-
1084
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
1085
-
1086
- --
1087
-
1088
- ##### [xpath](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L57) common
1089
-
1090
- > def xpath(xpath_str)
1091
-
1092
- Returns the first element that matches the provided xpath.
1093
-
1094
- __Parameters:__
1095
-
1096
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] xpath_str - the XPath string
1097
-
1098
- __Returns:__
1099
-
1100
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1101
-
1102
- --
1103
-
1104
- ##### [xpaths](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L65) common
1105
-
1106
- > def xpaths(xpath_str)
1107
-
1108
- Returns all elements that match the provided xpath.
1109
-
1110
- __Parameters:__
1111
-
1112
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] xpath_str - the XPath string
1113
-
1114
- __Returns:__
1115
-
1116
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>]
1117
-
1118
- --
1119
-
1120
- ##### [result](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L75) common
1121
-
1122
- > def result
1123
-
1124
- Returns the value of attribute result.
1125
-
1126
- --
1127
-
1128
- ##### [initialize](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L77) common
1129
-
1130
- > def initialize(platform)
1131
-
1132
- rubocop:disable Lint/MissingSuper
1133
-
1134
- __Returns:__
1135
-
1136
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[CountElements] a new instance of CountElements
1137
-
1138
- --
1139
-
1140
- ##### [reset](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L82) common
1141
-
1142
- > def reset
1143
-
1144
-
1145
-
1146
- --
1147
-
1148
- ##### [start_element](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L87) common
1149
-
1150
- > def start_element(name, attrs = [])
1151
-
1152
- http://nokogiri.org/Nokogiri/XML/SAX/Document.html
1153
-
1154
- --
1155
-
1156
- ##### [formatted_result](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L98) common
1157
-
1158
- > def formatted_result
1159
-
1160
-
1161
-
1162
- --
1163
-
1164
- ##### [get_page_class](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L116) common
1165
-
1166
- > def get_page_class
1167
-
1168
- Returns a string of class counts of visible elements.
1169
-
1170
- __Returns:__
1171
-
1172
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
1173
-
1174
- --
1175
-
1176
- ##### [page_class](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L141) common
1177
-
1178
- > def page_class
1179
-
1180
- Count all classes on screen and print to stdout.
1181
- Useful for appium_console.
1182
-
1183
- __Returns:__
1184
-
1185
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[nil]
1186
-
1187
- --
1188
-
1189
- ##### [source](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L148) common
1190
-
1191
- > def source
1192
-
1193
- Prints xml of the current page
1194
-
1195
- __Returns:__
1196
-
1197
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
1198
-
1199
- --
1200
-
1201
- ##### [get_source](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L155) common
1202
-
1203
- > def get_source
1204
-
1205
- Returns XML string for the current page
1206
- Same as driver.page_source
1207
-
1208
- __Returns:__
1209
-
1210
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
1211
-
1212
- --
1213
-
1214
- ##### [px_to_window_rel](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L165) common
1215
-
1216
- > def px_to_window_rel(opts = {}, driver = $driver)
1217
-
1218
- Converts pixel values to window relative values
1219
-
1220
- --
1221
-
1222
- ##### [xml_keys](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L184) common
1223
-
1224
- > def xml_keys(target)
1225
-
1226
- Search strings.xml's values for target.
1227
-
1228
- __Parameters:__
1229
-
1230
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] target - the target to search for in strings.xml values
1231
-
1232
- __Returns:__
1233
-
1234
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array]
1235
-
1236
- --
1237
-
1238
- ##### [xml_values](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L192) common
1239
-
1240
- > def xml_values(target)
1241
-
1242
- Search strings.xml's keys for target.
1243
-
1244
- __Parameters:__
1245
-
1246
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] target - the target to search for in strings.xml keys
1247
-
1248
- __Returns:__
1249
-
1250
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array]
1251
-
1252
- --
1253
-
1254
- ##### [resolve_id](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L200) common
1255
-
1256
- > def resolve_id(id)
1257
-
1258
- Resolve id in strings.xml and return the value.
1259
-
1260
- __Parameters:__
1261
-
1262
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] id - the id to resolve
1263
-
1264
- __Returns:__
1265
-
1266
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
1267
-
1268
- --
1269
-
1270
- ##### [filter](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L207) common
1271
-
1272
- > def filter
1273
-
1274
- Returns the value of attribute filter.
1275
-
1276
- --
1277
-
1278
- ##### [filter=](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L210) common
1279
-
1280
- > def filter=(value)
1281
-
1282
- convert to string to support symbols
1283
-
1284
- --
1285
-
1286
- ##### [initialize](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L217) common
1287
-
1288
- > def initialize
1289
-
1290
- rubocop:disable Lint/MissingSuper
1291
-
1292
- __Returns:__
1293
-
1294
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[HTMLElements] a new instance of HTMLElements
1295
-
1296
- --
1297
-
1298
- ##### [reset](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L222) common
1299
-
1300
- > def reset
1301
-
1302
-
1303
-
1304
- --
1305
-
1306
- ##### [result](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L228) common
1307
-
1308
- > def result
1309
-
1310
-
1311
-
1312
- --
1313
-
1314
- ##### [start_element](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L242) common
1315
-
1316
- > def start_element(name, attrs = [])
1317
-
1318
-
1319
-
1320
- --
1321
-
1322
- ##### [end_element](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L252) common
1323
-
1324
- > def end_element(name)
1325
-
1326
-
1327
-
1328
- --
1329
-
1330
- ##### [characters](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/helper.rb#L259) common
1331
-
1332
- > def characters(chars)
1333
-
1334
-
1335
-
1336
- --
1337
-
1338
- ##### [pinch](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/multi_touch.rb#L65) common
1339
-
1340
- > def pinch(percentage = 25, auto_perform = true, driver = $driver)
1341
-
1342
- Convenience method for pinching the screen.
1343
- Places two fingers at the edges of the screen and brings them together.
1344
- Without auto_perform
1345
-
1346
- With driver
1347
-
1348
- __Parameters:__
1349
-
1350
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[int] percentage - The percent size by which to shrink the screen when pinched.
1351
-
1352
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[boolean] auto_perform - Whether to perform the action immediately (default true)
1353
-
1354
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Driver] driver - Set a driver to conduct the action. DEfault is global driver($driver)
1355
-
1356
- --
1357
-
1358
- ##### [zoom](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/multi_touch.rb#L108) common
1359
-
1360
- > def zoom(percentage = 200, auto_perform = true, driver = $driver)
1361
-
1362
- Convenience method for zooming the screen.
1363
- Places two fingers at the edges of the screen and brings them together.
1364
- Without auto_perform
1365
-
1366
- With driver
1367
-
1368
- __Parameters:__
1369
-
1370
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[int] percentage - The percent size by which to shrink the screen when pinched.
1371
-
1372
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[boolean] auto_perform - Whether to perform the action immediately (default true)
1373
-
1374
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Driver] driver - Set a driver to conduct the action. DEfault is global driver($driver)
1375
-
1376
- --
1377
-
1378
- ##### [initialize](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/multi_touch.rb#L194) common
1379
-
1380
- > def initialize(driver = $driver)
1381
-
1382
- self
1383
-
1384
- __Returns:__
1385
-
1386
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[MultiTouch] a new instance of MultiTouch
1387
-
1388
- --
1389
-
1390
- ##### [initialize](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/touch_actions.rb#L62) common
1391
-
1392
- > def initialize(driver = $driver)
1393
-
1394
-
1395
-
1396
- __Returns:__
1397
-
1398
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[TouchAction] a new instance of TouchAction
1399
-
1400
- --
1401
-
1402
- ##### [swipe](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/touch_actions.rb#L66) common
1403
-
1404
- > def swipe(opts)
1405
-
1406
-
1407
-
1408
- --
1409
-
1410
- ##### [initialize](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/command/ws_logcat.rb#L19) common
1411
-
1412
- > def initialize(url:, output_file: 'logcat.log')
1413
-
1414
-
1415
-
1416
- __Returns:__
1417
-
1418
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[WsLogcat] a new instance of WsLogcat
1419
-
1420
- --
1421
-
1422
- ##### [handle_message_data](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/common/command/ws_logcat.rb#L24) common
1423
-
1424
- > def handle_message_data(data)
1425
-
1426
-
1427
-
1428
- --
1429
-
1430
- ##### [for](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/android.rb#L33) android
1431
-
1432
- > def for(target)
1433
-
1434
-
1435
-
1436
- --
1437
-
1438
- ##### [text](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/text.rb#L25) android
1439
-
1440
- > def text(value)
1441
-
1442
- Find the first TextView that contains value or by index.
1443
- If int then the TextView at that index is returned.
1444
-
1445
- __Parameters:__
1446
-
1447
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String, Integer] value - the value to find.
1448
-
1449
- __Returns:__
1450
-
1451
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[TextView]
1452
-
1453
- --
1454
-
1455
- ##### [texts](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/text.rb#L35) android
1456
-
1457
- > def texts(value = false)
1458
-
1459
- Find all TextViews containing value.
1460
- If value is omitted, all texts are returned.
1461
-
1462
- __Parameters:__
1463
-
1464
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
1465
-
1466
- __Returns:__
1467
-
1468
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<TEXT_VIEW>]
1469
-
1470
- --
1471
-
1472
- ##### [first_text](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/text.rb#L43) android
1473
-
1474
- > def first_text
1475
-
1476
- Find the first TextView.
1477
-
1478
- __Returns:__
1479
-
1480
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[TEXT_VIEW]
1481
-
1482
- --
1483
-
1484
- ##### [last_text](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/text.rb#L49) android
1485
-
1486
- > def last_text
1487
-
1488
- Find the last TextView.
1489
-
1490
- __Returns:__
1491
-
1492
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[TEXT_VIEW]
1493
-
1494
- --
1495
-
1496
- ##### [text_exact](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/text.rb#L56) android
1497
-
1498
- > def text_exact(value)
1499
-
1500
- Find the first TextView that exactly matches value.
1501
-
1502
- __Parameters:__
1503
-
1504
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to match exactly
1505
-
1506
- __Returns:__
1507
-
1508
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[TEXT_VIEW]
1509
-
1510
- --
1511
-
1512
- ##### [texts_exact](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/text.rb#L63) android
1513
-
1514
- > def texts_exact(value)
1515
-
1516
- Find all TextViews that exactly match value.
1517
-
1518
- __Parameters:__
1519
-
1520
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to match exactly
1521
-
1522
- __Returns:__
1523
-
1524
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<TEXT_VIEW>]
1525
-
1526
- --
1527
-
1528
- ##### [result](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/helper.rb#L20) android
1529
-
1530
- > def result
1531
-
1532
- Returns the value of attribute result.
1533
-
1534
- --
1535
-
1536
- ##### [keys](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/helper.rb#L20) android
1537
-
1538
- > def keys
1539
-
1540
- Returns the value of attribute keys.
1541
-
1542
- --
1543
-
1544
- ##### [filter](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/helper.rb#L20) android
1545
-
1546
- > def filter
1547
-
1548
- Returns the value of attribute filter.
1549
-
1550
- --
1551
-
1552
- ##### [filter=](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/helper.rb#L23) android
1553
-
1554
- > def filter=(value)
1555
-
1556
- convert to string to support symbols
1557
-
1558
- --
1559
-
1560
- ##### [initialize](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/helper.rb#L30) android
1561
-
1562
- > def initialize
1563
-
1564
- rubocop:disable Lint/MissingSuper
1565
-
1566
- __Returns:__
1567
-
1568
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[AndroidElements] a new instance of AndroidElements
1569
-
1570
- --
1571
-
1572
- ##### [reset](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/helper.rb#L35) android
1573
-
1574
- > def reset
1575
-
1576
-
1577
-
1578
- --
1579
-
1580
- ##### [start_element](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/helper.rb#L41) android
1581
-
1582
- > def start_element(name, attrs = [], driver = $driver)
1583
-
1584
- http://nokogiri.org/Nokogiri/XML/SAX/Document.html
1585
-
1586
- --
1587
-
1588
- ##### [get_android_inspect](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/helper.rb#L95) android
1589
-
1590
- > def get_android_inspect(class_name = false)
1591
-
1592
- Android only.
1593
- Returns a string containing interesting elements.
1594
- The text, content description, and id are returned.
1595
- if false (default) then all classes will be inspected
1596
-
1597
- __Parameters:__
1598
-
1599
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class name to filter on.
1600
-
1601
- __Returns:__
1602
-
1603
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
1604
-
1605
- --
1606
-
1607
- ##### [page](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/helper.rb#L121) android
1608
-
1609
- > def page(opts = {})
1610
-
1611
- Intended for use with console.
1612
- Inspects and prints the current page.
1613
- Will return XHTML for Web contexts because of a quirk with Nokogiri.
1614
- if nil (default) then all classes will be inspected
1615
-
1616
- __Parameters:__
1617
-
1618
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] class - a customizable set of options
1619
-
1620
- __Returns:__
1621
-
1622
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
1623
-
1624
- --
1625
-
1626
- ##### [id](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/helper.rb#L130) android
1627
-
1628
- > def id(id)
1629
-
1630
- Find the first matching element by id
1631
-
1632
- __Parameters:__
1633
-
1634
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] id - the id to search for
1635
-
1636
- __Returns:__
1637
-
1638
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1639
-
1640
- --
1641
-
1642
- ##### [ids](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/helper.rb#L138) android
1643
-
1644
- > def ids(id)
1645
-
1646
- Find all matching elements 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
- ##### [ele_index](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/helper.rb#L147) android
1659
-
1660
- > def ele_index(class_name, index)
1661
-
1662
- Find the element of type class_name at matching index.
1663
-
1664
- __Parameters:__
1665
-
1666
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class name to find
1667
-
1668
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] index - the index
1669
-
1670
- __Returns:__
1671
-
1672
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element] the found element of type class_name
1673
-
1674
- --
1675
-
1676
- ##### [first_ele](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/helper.rb#L166) android
1677
-
1678
- > def first_ele(class_name)
1679
-
1680
- Find the first element that matches class_name
1681
-
1682
- __Parameters:__
1683
-
1684
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the tag to match
1685
-
1686
- __Returns:__
1687
-
1688
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1689
-
1690
- --
1691
-
1692
- ##### [last_ele](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/helper.rb#L173) android
1693
-
1694
- > def last_ele(class_name)
1695
-
1696
- Find the last 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
- ##### [tag](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/helper.rb#L181) android
1709
-
1710
- > def tag(class_name)
1711
-
1712
- Find the first element of type class_name
1713
-
1714
- __Parameters:__
1715
-
1716
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class_name to search for
1717
-
1718
- __Returns:__
1719
-
1720
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1721
-
1722
- --
1723
-
1724
- ##### [tags](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/helper.rb#L189) android
1725
-
1726
- > def tags(class_name)
1727
-
1728
- Find all elements 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
- ##### [string_visible_contains_xpath](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/helper.rb#L232) android
1741
-
1742
- > def string_visible_contains_xpath(class_name, value)
1743
-
1744
- Returns a string that matches the first element that contains value
1745
- For automationName is uiautomator2
1746
- example: string_visible_contains_xpath 'UIATextField', 'sign in'
1747
- note for XPath: https://github.com/appium/ruby_lib/pull/561
1748
-
1749
- __Parameters:__
1750
-
1751
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class name for the element
1752
-
1753
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
1754
-
1755
- __Returns:__
1756
-
1757
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
1758
-
1759
- --
1760
-
1761
- ##### [string_visible_contains](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/helper.rb#L252) android
1762
-
1763
- > def string_visible_contains(class_name, value)
1764
-
1765
- Returns a string that matches the first element that contains value
1766
- For automationName is Appium
1767
- example: string_visible_contains 'UIATextField', 'sign in'
1768
- note for XPath: https://github.com/appium/ruby_lib/pull/561
1769
-
1770
- __Parameters:__
1771
-
1772
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class name for the element
1773
-
1774
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
1775
-
1776
- __Returns:__
1777
-
1778
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
1779
-
1780
- --
1781
-
1782
- ##### [complex_find_contains](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/helper.rb#L270) android
1783
-
1784
- > def complex_find_contains(class_name, value)
1785
-
1786
- Find the first element that contains value
1787
-
1788
- __Parameters:__
1789
-
1790
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class name for the element
1791
-
1792
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
1793
-
1794
- __Returns:__
1795
-
1796
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1797
-
1798
- --
1799
-
1800
- ##### [complex_finds_contains](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/helper.rb#L278) android
1801
-
1802
- > def complex_finds_contains(class_name, value)
1803
-
1804
- Find all elements containing value
1805
-
1806
- __Parameters:__
1807
-
1808
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class name for the element
1809
-
1810
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
1811
-
1812
- __Returns:__
1813
-
1814
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>]
1815
-
1816
- --
1817
-
1818
- ##### [complex_find_exact](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/helper.rb#L320) android
1819
-
1820
- > def complex_find_exact(class_name, value)
1821
-
1822
- Find the first element exactly matching value
1823
-
1824
- __Parameters:__
1825
-
1826
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class name for the element
1827
-
1828
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
1829
-
1830
- __Returns:__
1831
-
1832
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1833
-
1834
- --
1835
-
1836
- ##### [complex_finds_exact](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/helper.rb#L328) android
1837
-
1838
- > def complex_finds_exact(class_name, value)
1839
-
1840
- Find all elements exactly matching value
1841
-
1842
- __Parameters:__
1843
-
1844
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class name for the element
1845
-
1846
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
1847
-
1848
- __Returns:__
1849
-
1850
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1851
-
1852
- --
1853
-
1854
- ##### [alert_click](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/alert.rb#L20) android
1855
-
1856
- > def alert_click(value)
1857
-
1858
- Click the first alert button that contains value or by index.
1859
-
1860
- __Parameters:__
1861
-
1862
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer, String] value - either an integer index of the button or the button's name
1863
-
1864
- __Returns:__
1865
-
1866
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
1867
-
1868
- --
1869
-
1870
- ##### [alert_accept](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/alert.rb#L27) android
1871
-
1872
- > def alert_accept
1873
-
1874
- Accept the alert.
1875
- The last button is considered "accept."
1876
-
1877
- __Returns:__
1878
-
1879
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
1880
-
1881
- --
1882
-
1883
- ##### [alert_accept_text](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/alert.rb#L34) android
1884
-
1885
- > def alert_accept_text
1886
-
1887
- Get the text of the alert's accept button.
1888
- The last button is considered "accept."
1889
-
1890
- __Returns:__
1891
-
1892
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
1893
-
1894
- --
1895
-
1896
- ##### [alert_dismiss](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/alert.rb#L41) android
1897
-
1898
- > def alert_dismiss
1899
-
1900
- Dismiss the alert.
1901
- The first button is considered "dismiss."
1902
-
1903
- __Returns:__
1904
-
1905
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
1906
-
1907
- --
1908
-
1909
- ##### [alert_dismiss_text](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/alert.rb#L48) android
1910
-
1911
- > def alert_dismiss_text
1912
-
1913
- Get the text of the alert's dismiss button.
1914
- The first button is considered "dismiss."
1915
-
1916
- __Returns:__
1917
-
1918
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
1919
-
1920
- --
1921
-
1922
- ##### [button](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/button.rb#L27) android
1923
-
1924
- > def button(value)
1925
-
1926
- Find the first button that contains value or by index.
1927
- If int then the button at that index is returned.
1928
-
1929
- __Parameters:__
1930
-
1931
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String, Integer] value - the value to exactly match.
1932
-
1933
- __Returns:__
1934
-
1935
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[BUTTON]
1936
-
1937
- --
1938
-
1939
- ##### [buttons](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/button.rb#L45) android
1940
-
1941
- > def buttons(value = false)
1942
-
1943
- Find all buttons containing value.
1944
- If value is omitted, all buttons are returned.
1945
-
1946
- __Parameters:__
1947
-
1948
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
1949
-
1950
- __Returns:__
1951
-
1952
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<BUTTON>]
1953
-
1954
- --
1955
-
1956
- ##### [first_button](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/button.rb#L53) android
1957
-
1958
- > def first_button
1959
-
1960
- Find the first button.
1961
-
1962
- __Returns:__
1963
-
1964
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[BUTTON]
1965
-
1966
- --
1967
-
1968
- ##### [last_button](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/button.rb#L59) android
1969
-
1970
- > def last_button
1971
-
1972
- Find the last button.
1973
-
1974
- __Returns:__
1975
-
1976
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[BUTTON]
1977
-
1978
- --
1979
-
1980
- ##### [button_exact](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/button.rb#L75) android
1981
-
1982
- > def button_exact(value)
1983
-
1984
- Find the first button that exactly matches value.
1985
-
1986
- __Parameters:__
1987
-
1988
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to match exactly
1989
-
1990
- __Returns:__
1991
-
1992
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[BUTTON]
1993
-
1994
- --
1995
-
1996
- ##### [buttons_exact](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/button.rb#L82) android
1997
-
1998
- > def buttons_exact(value)
1999
-
2000
- Find all buttons that exactly match value.
2001
-
2002
- __Parameters:__
2003
-
2004
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to match exactly
2005
-
2006
- __Returns:__
2007
-
2008
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<BUTTON>]
2009
-
2010
- --
2011
-
2012
- ##### [_button_visible_selectors](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/button.rb#L95) android
2013
-
2014
- > def _button_visible_selectors(opts = {})
2015
-
2016
-
2017
-
2018
- --
2019
-
2020
- ##### [_button_exact_string](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/button.rb#L108) android
2021
-
2022
- > def _button_exact_string(value)
2023
-
2024
-
2025
-
2026
- --
2027
-
2028
- ##### [_button_contains_string](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/button.rb#L114) android
2029
-
2030
- > def _button_contains_string(value)
2031
-
2032
-
2033
-
2034
- --
2035
-
2036
- ##### [find](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/generic.rb#L20) android
2037
-
2038
- > def find(value)
2039
-
2040
- Find the first element containing value
2041
-
2042
- __Parameters:__
2043
-
2044
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
2045
-
2046
- __Returns:__
2047
-
2048
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
2049
-
2050
- --
2051
-
2052
- ##### [finds](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/generic.rb#L27) android
2053
-
2054
- > def finds(value)
2055
-
2056
- Find all elements containing value
2057
-
2058
- __Parameters:__
2059
-
2060
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
2061
-
2062
- __Returns:__
2063
-
2064
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>]
2065
-
2066
- --
2067
-
2068
- ##### [find_exact](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/generic.rb#L34) android
2069
-
2070
- > def find_exact(value)
2071
-
2072
- Find the first element exactly matching value
2073
-
2074
- __Parameters:__
2075
-
2076
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
2077
-
2078
- __Returns:__
2079
-
2080
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
2081
-
2082
- --
2083
-
2084
- ##### [finds_exact](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/generic.rb#L41) android
2085
-
2086
- > def finds_exact(value)
2087
-
2088
- Find all elements exactly matching value
2089
-
2090
- __Parameters:__
2091
-
2092
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
2093
-
2094
- __Returns:__
2095
-
2096
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>]
2097
-
2098
- --
2099
-
2100
- ##### [scroll_to](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/generic.rb#L54) android
2101
-
2102
- > def scroll_to(text, scrollable_index = 0)
2103
-
2104
- Scroll to the first element containing target text or description.
2105
-
2106
- __Parameters:__
2107
-
2108
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text or resourceId to search for in the text value and content description
2109
-
2110
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] scrollable_index - the index for scrollable views.
2111
-
2112
- __Returns:__
2113
-
2114
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element] the element scrolled to
2115
-
2116
- --
2117
-
2118
- ##### [scroll_to_exact](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/generic.rb#L70) android
2119
-
2120
- > def scroll_to_exact(text, scrollable_index = 0)
2121
-
2122
- Scroll to the first element with the exact target text or description.
2123
-
2124
- __Parameters:__
2125
-
2126
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text or resourceId to search for in the text value and content description
2127
-
2128
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] scrollable_index - the index for scrollable views.
2129
-
2130
- __Returns:__
2131
-
2132
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element] the element scrolled to
2133
-
2134
- --
2135
-
2136
- ##### [for](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/espresso/bridge.rb#L21) android
2137
-
2138
- > def for(target)
2139
-
2140
-
2141
-
2142
- --
2143
-
2144
- ##### [complex_find_contains](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/espresso/helper.rb#L23) android
2145
-
2146
- > def complex_find_contains(class_name, value)
2147
-
2148
- Find the first element that contains value
2149
-
2150
- __Parameters:__
2151
-
2152
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class name for the element
2153
-
2154
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
2155
-
2156
- __Returns:__
2157
-
2158
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
2159
-
2160
- --
2161
-
2162
- ##### [complex_finds_contains](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/espresso/helper.rb#L31) android
2163
-
2164
- > def complex_finds_contains(class_name, value)
2165
-
2166
- Find all elements containing value
2167
-
2168
- __Parameters:__
2169
-
2170
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class name for the element
2171
-
2172
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
2173
-
2174
- __Returns:__
2175
-
2176
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>]
2177
-
2178
- --
2179
-
2180
- ##### [complex_find_exact](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/espresso/helper.rb#L39) android
2181
-
2182
- > def complex_find_exact(class_name, value)
2183
-
2184
- Find the first element exactly matching value
2185
-
2186
- __Parameters:__
2187
-
2188
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class name for the element
2189
-
2190
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
2191
-
2192
- __Returns:__
2193
-
2194
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
2195
-
2196
- --
2197
-
2198
- ##### [complex_finds_exact](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/espresso/helper.rb#L47) android
2199
-
2200
- > def complex_finds_exact(class_name, value)
2201
-
2202
- Find all elements exactly matching value
2203
-
2204
- __Parameters:__
2205
-
2206
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class name for the element
2207
-
2208
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
2209
-
2210
- __Returns:__
2211
-
2212
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
2213
-
2214
- --
2215
-
2216
- ##### [textfield](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/textfield.rb#L24) android
2217
-
2218
- > def textfield(value)
2219
-
2220
- Find the first EditText that contains value or by index.
2221
- If int then the EditText at that index is returned.
2222
-
2223
- __Parameters:__
2224
-
2225
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String, Integer] value - the text to match exactly.
2226
-
2227
- __Returns:__
2228
-
2229
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[EDIT_TEXT]
2230
-
2231
- --
2232
-
2233
- ##### [textfields](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/textfield.rb#L34) android
2234
-
2235
- > def textfields(value = false)
2236
-
2237
- Find all EditTexts containing value.
2238
- If value is omitted, all EditTexts are returned.
2239
-
2240
- __Parameters:__
2241
-
2242
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
2243
-
2244
- __Returns:__
2245
-
2246
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<EDIT_TEXT>]
2247
-
2248
- --
2249
-
2250
- ##### [first_textfield](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/textfield.rb#L42) android
2251
-
2252
- > def first_textfield
2253
-
2254
- Find the first EditText.
2255
-
2256
- __Returns:__
2257
-
2258
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[EDIT_TEXT]
2259
-
2260
- --
2261
-
2262
- ##### [last_textfield](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/textfield.rb#L48) android
2263
-
2264
- > def last_textfield
2265
-
2266
- Find the last EditText.
2267
-
2268
- __Returns:__
2269
-
2270
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[EDIT_TEXT]
2271
-
2272
- --
2273
-
2274
- ##### [textfield_exact](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/textfield.rb#L55) android
2275
-
2276
- > def textfield_exact(value)
2277
-
2278
- Find the first EditText that exactly matches value.
2279
-
2280
- __Parameters:__
2281
-
2282
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to match exactly
2283
-
2284
- __Returns:__
2285
-
2286
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[EDIT_TEXT]
2287
-
2288
- --
2289
-
2290
- ##### [textfields_exact](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/element/textfield.rb#L62) android
2291
-
2292
- > def textfields_exact(value)
2293
-
2294
- Find all EditTexts that exactly match value.
2295
-
2296
- __Parameters:__
2297
-
2298
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to match exactly
2299
-
2300
- __Returns:__
2301
-
2302
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<EDIT_TEXT>]
2303
-
2304
- --
2305
-
2306
- ##### [for](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/uiautomator2/bridge.rb#L21) android
2307
-
2308
- > def for(target)
2309
-
2310
-
2311
-
2312
- --
2313
-
2314
- ##### [string_visible_contains](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/uiautomator2/helper.rb#L27) android
2315
-
2316
- > def string_visible_contains(class_name, value)
2317
-
2318
- Returns a string that matches the first element that contains value
2319
- For automationName is Appium
2320
- example: string_visible_contains 'UIATextField', 'sign in'
2321
- note for XPath: https://github.com/appium/ruby_lib/pull/561
2322
-
2323
- __Parameters:__
2324
-
2325
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class name for the element
2326
-
2327
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
2328
-
2329
- __Returns:__
2330
-
2331
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
2332
-
2333
- --
2334
-
2335
- ##### [complex_find_contains](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/uiautomator2/helper.rb#L45) android
2336
-
2337
- > def complex_find_contains(class_name, value)
2338
-
2339
- Find the first element that contains value
2340
-
2341
- __Parameters:__
2342
-
2343
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class name for the element
2344
-
2345
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
2346
-
2347
- __Returns:__
2348
-
2349
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
2350
-
2351
- --
2352
-
2353
- ##### [complex_finds_contains](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/uiautomator2/helper.rb#L56) android
2354
-
2355
- > def complex_finds_contains(class_name, value)
2356
-
2357
- Find all elements containing value
2358
-
2359
- __Parameters:__
2360
-
2361
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class name for the element
2362
-
2363
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
2364
-
2365
- __Returns:__
2366
-
2367
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>]
2368
-
2369
- --
2370
-
2371
- ##### [complex_find_exact](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/uiautomator2/helper.rb#L84) android
2372
-
2373
- > def complex_find_exact(class_name, value)
2374
-
2375
- Find the first element exactly matching value
2376
-
2377
- __Parameters:__
2378
-
2379
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class name for the element
2380
-
2381
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
2382
-
2383
- __Returns:__
2384
-
2385
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
2386
-
2387
- --
2388
-
2389
- ##### [complex_finds_exact](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/uiautomator2/helper.rb#L95) android
2390
-
2391
- > def complex_finds_exact(class_name, value)
2392
-
2393
- Find all elements exactly matching value
2394
-
2395
- __Parameters:__
2396
-
2397
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] class_name - the class name for the element
2398
-
2399
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
2400
-
2401
- __Returns:__
2402
-
2403
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
2404
-
2405
- --
2406
-
2407
- ##### [shell](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/command/command.rb#L28) android
2408
-
2409
- > def shell(command, arguments)
2410
-
2411
- Conduct an adb shell script on Appium server.
2412
- Require `--relaxed-security` arguments when run Appium server as server side arguments.
2413
-
2414
- __Parameters:__
2415
-
2416
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] command - Command for "adb shell"
2417
-
2418
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array] arguments - Arguments for the adb command
2419
-
2420
- --
2421
-
2422
- ##### [start_logs_broadcast](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/command/command.rb#L42) android
2423
-
2424
- > def start_logs_broadcast(logcat_file = 'logcat.log')
2425
-
2426
- Starts Android logcat broadcast websocket
2427
-
2428
- __Parameters:__
2429
-
2430
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] logcat_file - A file path to write messages from a logcat WebSocket client
2431
-
2432
- --
2433
-
2434
- ##### [stop_logs_broadcast](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/common/command/command.rb#L55) android
2435
-
2436
- > def stop_logs_broadcast
2437
-
2438
- Stop Android logcat broadcast websocket
2439
-
2440
- --
2441
-
2442
- ##### [button](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/espresso/element/button.rb#L23) android
2443
-
2444
- > def button(value)
2445
-
2446
- Find the first button that contains value or by index.
2447
- If int then the button at that index is returned.
2448
-
2449
- __Parameters:__
2450
-
2451
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String, Integer] value - the value to exactly match.
2452
-
2453
- __Returns:__
2454
-
2455
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Button]
2456
-
2457
- --
2458
-
2459
- ##### [buttons](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/espresso/element/button.rb#L46) android
2460
-
2461
- > def buttons(value = false)
2462
-
2463
- Find all buttons containing value.
2464
- If value is omitted, all buttons are returned.
2465
-
2466
- __Parameters:__
2467
-
2468
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
2469
-
2470
- __Returns:__
2471
-
2472
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Button>]
2473
-
2474
- --
2475
-
2476
- ##### [first_button](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/espresso/element/button.rb#L56) android
2477
-
2478
- > def first_button
2479
-
2480
- Find the first button.
2481
-
2482
- __Returns:__
2483
-
2484
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Button]
2485
-
2486
- --
2487
-
2488
- ##### [last_button](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/espresso/element/button.rb#L62) android
2489
-
2490
- > def last_button
2491
-
2492
- Find the last button.
2493
-
2494
- __Returns:__
2495
-
2496
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Button]
2497
-
2498
- --
2499
-
2500
- ##### [button_exact](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/espresso/element/button.rb#L77) android
2501
-
2502
- > def button_exact(value)
2503
-
2504
- Find the first button that exactly matches value.
2505
-
2506
- __Parameters:__
2507
-
2508
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to match exactly
2509
-
2510
- __Returns:__
2511
-
2512
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Button]
2513
-
2514
- --
2515
-
2516
- ##### [buttons_exact](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/espresso/element/button.rb#L89) android
2517
-
2518
- > def buttons_exact(value)
2519
-
2520
- Find all buttons that exactly match value.
2521
-
2522
- __Parameters:__
2523
-
2524
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to match exactly
2525
-
2526
- __Returns:__
2527
-
2528
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Button>]
2529
-
2530
- --
2531
-
2532
- ##### [_button_visible_selectors_xpath](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/espresso/element/button.rb#L104) android
2533
-
2534
- > def _button_visible_selectors_xpath(opts = {})
2535
-
2536
-
2537
-
2538
- --
2539
-
2540
- ##### [_button_exact_string_xpath](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/espresso/element/button.rb#L125) android
2541
-
2542
- > def _button_exact_string_xpath(class_name, value)
2543
-
2544
-
2545
-
2546
- --
2547
-
2548
- ##### [_button_contains_string_xpath](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/espresso/element/button.rb#L130) android
2549
-
2550
- > def _button_contains_string_xpath(class_name, value)
2551
-
2552
-
2553
-
2554
- --
2555
-
2556
- ##### [scroll_to](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/espresso/element/generic.rb#L23) android
2557
-
2558
- > def scroll_to(text)
2559
-
2560
- Scroll to the first element containing target text or description.
2561
- Scroll happens upto 30 times in centre of device width.
2562
-
2563
- __Parameters:__
2564
-
2565
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text or resourceId to search for in the text value and content description
2566
-
2567
- __Returns:__
2568
-
2569
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element] the element scrolled to
2570
-
2571
- --
2572
-
2573
- ##### [scroll_to_exact](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/espresso/element/generic.rb#L48) android
2574
-
2575
- > def scroll_to_exact(text)
2576
-
2577
- Scroll to the first element with the exact target text or description.
2578
- Scroll happens upto 30 times in centre of device width.
2579
-
2580
- __Parameters:__
2581
-
2582
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text or resourceId to search for in the text value and content description
2583
-
2584
- __Returns:__
2585
-
2586
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element] the element scrolled to
2587
-
2588
- --
2589
-
2590
- ##### [button](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/uiautomator2/element/button.rb#L23) android
2591
-
2592
- > def button(value)
2593
-
2594
- Find the first button that contains value or by index.
2595
- If int then the button at that index is returned.
2596
-
2597
- __Parameters:__
2598
-
2599
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String, Integer] value - the value to exactly match.
2600
-
2601
- __Returns:__
2602
-
2603
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Button]
2604
-
2605
- --
2606
-
2607
- ##### [buttons](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/uiautomator2/element/button.rb#L44) android
2608
-
2609
- > def buttons(value = false)
2610
-
2611
- Find all buttons containing value.
2612
- If value is omitted, all buttons are returned.
2613
-
2614
- __Parameters:__
2615
-
2616
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to search for
2617
-
2618
- __Returns:__
2619
-
2620
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Button>]
2621
-
2622
- --
2623
-
2624
- ##### [first_button](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/uiautomator2/element/button.rb#L52) android
2625
-
2626
- > def first_button
2627
-
2628
- Find the first button.
2629
-
2630
- __Returns:__
2631
-
2632
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Button]
2633
-
2634
- --
2635
-
2636
- ##### [last_button](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/uiautomator2/element/button.rb#L59) android
2637
-
2638
- > def last_button
2639
-
2640
- Find the last button.
2641
-
2642
- __Returns:__
2643
-
2644
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Button]
2645
-
2646
- --
2647
-
2648
- ##### [button_exact](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/uiautomator2/element/button.rb#L76) android
2649
-
2650
- > def button_exact(value)
2651
-
2652
- Find the first button that exactly matches value.
2653
-
2654
- __Parameters:__
2655
-
2656
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to match exactly
2657
-
2658
- __Returns:__
2659
-
2660
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Button]
2661
-
2662
- --
2663
-
2664
- ##### [buttons_exact](https://github.com/appium/ruby_lib/blob/50cf980b570acd7d2d95ea64d1d1b0225f96c73b/lib/appium_lib/android/uiautomator2/element/button.rb#L84) android
2665
-
2666
- > def buttons_exact(value)
2667
-
2668
- Find all buttons that exactly match value.
2669
-
2670
- __Parameters:__
2671
-
2672
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value to match exactly
2673
-
2674
- __Returns:__
2675
-
2676
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Button>]
2677
-
2678
- --
2679
-