appium_lib 0.13.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,1697 +0,0 @@
1
- ##### [s_texts](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/element/text.rb#L10)
2
-
3
- > def s_texts text=nil
4
-
5
- Get an array of text texts if text is nil else
6
- Get all static textfields that include text.
7
-
8
- __Parameters:__
9
-
10
-      [String] text - the text to find.
11
-
12
- __Returns:__
13
-
14
-      [Array]
15
-
16
- --
17
-
18
- ##### [s_texts_names](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/element/text.rb#L18)
19
-
20
- > def s_texts_names
21
-
22
-
23
-
24
- --
25
-
26
- ##### [e_s_texts](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/element/text.rb#L24)
27
-
28
- > def e_s_texts
29
-
30
- Get an array of text elements.
31
-
32
- __Returns:__
33
-
34
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Text>]
35
-
36
- --
37
-
38
- ##### [first_s_text](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/element/text.rb#L30)
39
-
40
- > def first_s_text
41
-
42
- Get the first text element.
43
-
44
- __Returns:__
45
-
46
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Text]
47
-
48
- --
49
-
50
- ##### [last_s_text](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/element/text.rb#L36)
51
-
52
- > def last_s_text
53
-
54
- Get the last text element
55
-
56
- __Returns:__
57
-
58
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Text]
59
-
60
- --
61
-
62
- ##### [s_text](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/element/text.rb#L43)
63
-
64
- > def s_text text
65
-
66
- Get the first element that includes text.
67
-
68
- __Parameters:__
69
-
70
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String, Integer] text - the text to find. If int then the text at that index is returned.
71
-
72
- __Returns:__
73
-
74
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Text]
75
-
76
- --
77
-
78
- ##### [s_text_exact](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/element/text.rb#L51)
79
-
80
- > def s_text_exact text
81
-
82
- Get the first textfield that matches text.
83
-
84
- __Parameters:__
85
-
86
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text that the tag must match
87
-
88
- __Returns:__
89
-
90
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Text]
91
-
92
- --
93
-
94
- ##### [s_texts_exact](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/element/text.rb#L58)
95
-
96
- > def s_texts_exact text
97
-
98
- Get all static textfields that matches text.
99
-
100
- __Parameters:__
101
-
102
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text that the tag must match
103
-
104
- __Returns:__
105
-
106
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Text>]
107
-
108
- --
109
-
110
- ##### [window_size](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/element/window.rb#L5)
111
-
112
- > def window_size
113
-
114
- Get the window's size
115
-
116
- --
117
-
118
- ##### [button](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/element/button.rb#L8)
119
-
120
- > def button text, number=0
121
-
122
- Find a button by text and optionally number.
123
-
124
- __Parameters:__
125
-
126
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String, Integer] text - the text to exactly match. If int then the button at that index is returned.
127
-
128
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] number - the occurrence of the button matching text. Defaults to the first button.
129
-
130
- __Returns:__
131
-
132
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Button] the button found with text and matching number
133
-
134
- --
135
-
136
- ##### [buttons](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/element/button.rb#L19)
137
-
138
- > def buttons text=nil
139
-
140
- Get an array of button texts or button elements if text is provided.
141
-
142
- __Parameters:__
143
-
144
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text to exactly match
145
-
146
- __Returns:__
147
-
148
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<String>, Array<Buttons>] either an array of button texts or an array of button elements if text is provided.
149
-
150
- --
151
-
152
- ##### [first_button](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/element/button.rb#L26)
153
-
154
- > def first_button
155
-
156
- Get the first button element.
157
-
158
- __Returns:__
159
-
160
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Button]
161
-
162
- --
163
-
164
- ##### [last_button](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/element/button.rb#L32)
165
-
166
- > def last_button
167
-
168
- Get the last button element.
169
-
170
- __Returns:__
171
-
172
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Button]
173
-
174
- --
175
-
176
- ##### [button_exact](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/element/button.rb#L39)
177
-
178
- > def button_exact text
179
-
180
- Get the first button element that exactly matches text.
181
-
182
- __Parameters:__
183
-
184
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text to match exactly
185
-
186
- __Returns:__
187
-
188
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Button]
189
-
190
- --
191
-
192
- ##### [buttons_exact](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/element/button.rb#L46)
193
-
194
- > def buttons_exact text
195
-
196
- Get all button elements that exactly match text.
197
-
198
- __Parameters:__
199
-
200
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text to match exactly
201
-
202
- __Returns:__
203
-
204
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Button>]
205
-
206
- --
207
-
208
- ##### [e_buttons](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/element/button.rb#L52)
209
-
210
- > def e_buttons
211
-
212
- Get an array of button elements.
213
-
214
- __Returns:__
215
-
216
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Button>]
217
-
218
- --
219
-
220
- ##### [button_num](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/element/button.rb#L72)
221
-
222
- > def button_num text, number=1
223
-
224
- Expected to be called via button method.
225
-
226
- Get the button element exactly matching text and
227
- occurrence. number=2 means the 2nd occurrence.
228
-
229
- find the second Sign In button
230
-
231
- b = e_button 'Sign In', 2
232
-
233
- Button order will change in iOS vs Android
234
- so if there's no button found at number then
235
- return the first button.
236
-
237
- __Parameters:__
238
-
239
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text to match
240
-
241
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] number - the button occurance to return. 1 = first button
242
-
243
- __Returns:__
244
-
245
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Button] the button that matches text and number
246
-
247
- --
248
-
249
- ##### [find_eles_attr](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/helper.rb#L8) ios
250
-
251
- > def find_eles_attr tag_name, attribute
252
-
253
- iOS only. Android uses uiautomator instead of uiautomation.
254
- Get an array of attribute values from elements exactly matching tag name.
255
-
256
- __Parameters:__
257
-
258
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag_name - the tag name to find
259
-
260
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] attribute - the attribute to collect
261
-
262
- __Returns:__
263
-
264
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<String>] an array of strings containing the attribute from found elements of type tag_name.
265
-
266
- --
267
-
268
- ##### [find_2_eles_attr](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/helper.rb#L29) ios
269
-
270
- > def find_2_eles_attr tag_name_1, tag_name_2, attribute
271
-
272
- iOS only. Android doesn't use find_2_eles_attr.
273
- Get an array of attribute values from elements exactly matching tag name.
274
-
275
- __Parameters:__
276
-
277
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag_name_1 - the 1st tag name to find
278
-
279
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag_name_2 - the 2nd tag name to find
280
-
281
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] attribute - the attribute to collect
282
-
283
- __Returns:__
284
-
285
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<String>] an array of strings containing the attribute from found elements of type tag_name.
286
-
287
- --
288
-
289
- ##### [password](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/helper.rb#L50) ios
290
-
291
- > def password length=1
292
-
293
- iOS only. On Android uiautomator always returns an empty string for EditText password.
294
-
295
- Password character returned from value of UIASecureTextField
296
-
297
- __Parameters:__
298
-
299
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] length - the length of the password to generate
300
-
301
- __Returns:__
302
-
303
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] the returned string is of size length
304
-
305
- --
306
-
307
- ##### [get_page_class](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/helper.rb#L55) ios
308
-
309
- > def get_page_class
310
-
311
- Returns a string of class counts.
312
-
313
- --
314
-
315
- ##### [page_class](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/helper.rb#L81) ios
316
-
317
- > def page_class
318
-
319
-
320
-
321
- --
322
-
323
- ##### [get_page](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/helper.rb#L93) ios
324
-
325
- > def get_page element=source_window(0)
326
-
327
- Returns a string of interesting elements. iOS only.
328
-
329
- Defaults to inspecting the 1st windows source only.
330
- use get_page(get_source) for all window sources
331
-
332
- __Parameters:__
333
-
334
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Object] element - the element to search. omit to search everything
335
-
336
- __Returns:__
337
-
338
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
339
-
340
- --
341
-
342
- ##### [page](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/helper.rb#L154) ios
343
-
344
- > def page window_number = -1
345
-
346
- Prints a string of interesting elements to the console.
347
-
348
- __Returns:__
349
-
350
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
351
-
352
- --
353
-
354
- ##### [source_window](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/helper.rb#L169) ios
355
-
356
- > def source_window window_number=0
357
-
358
- Gets the JSON source of window number
359
-
360
- __Parameters:__
361
-
362
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] window_number - the int index of the target window
363
-
364
- __Returns:__
365
-
366
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[JSON]
367
-
368
- --
369
-
370
- ##### [page_window](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/helper.rb#L176) ios
371
-
372
- > def page_window window_number=0
373
-
374
- Prints parsed page source to console.
375
- example: page_window 0
376
-
377
- __Parameters:__
378
-
379
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] window_number - the int index of the target window
380
-
381
- --
382
-
383
- ##### [fast_duration](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/helper.rb#L183) ios
384
-
385
- > def fast_duration
386
-
387
- The fastest duration that can be used on iOS.
388
-
389
- __Returns:__
390
-
391
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Float]
392
-
393
- --
394
-
395
- ##### [id](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/helper.rb#L190) ios
396
-
397
- > def id id
398
-
399
- Find by id. Useful for selendroid
400
-
401
- __Parameters:__
402
-
403
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] id - the id to search for
404
-
405
- __Returns:__
406
-
407
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
408
-
409
- --
410
-
411
- ##### [alert_click](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/element/alert.rb#L14) ios
412
-
413
- > def alert_click value
414
-
415
- iOS only
416
- Tap the alert button identified by value.
417
-
418
- Click the ok button:
419
- alert_click 'OK'
420
-
421
- Click the first button:
422
- alert_click 0
423
-
424
- __Parameters:__
425
-
426
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer, String] value - either an integer index of the button or the button's name
427
-
428
- __Returns:__
429
-
430
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
431
-
432
- --
433
-
434
- ##### [alert_text](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/element/alert.rb#L21) ios
435
-
436
- > def alert_text
437
-
438
- Get the alert message text.
439
-
440
- __Returns:__
441
-
442
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
443
-
444
- --
445
-
446
- ##### [alert_accept](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/element/alert.rb#L30) ios
447
-
448
- > def alert_accept
449
-
450
- Accept the alert.
451
-
452
- __Returns:__
453
-
454
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
455
-
456
- --
457
-
458
- ##### [alert_accept_text](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/element/alert.rb#L40) ios
459
-
460
- > def alert_accept_text
461
-
462
- Get the text of the alert's accept button.
463
- The last button is considered "accept." on iOS 6
464
- The first button is considered "accept." on iOS 7
465
-
466
- __Returns:__
467
-
468
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
469
-
470
- --
471
-
472
- ##### [alert_dismiss](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/element/alert.rb#L64) ios
473
-
474
- > def alert_dismiss
475
-
476
- Dismiss the alert.
477
-
478
- __Returns:__
479
-
480
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
481
-
482
- --
483
-
484
- ##### [alert_dismiss_text](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/element/alert.rb#L74) ios
485
-
486
- > def alert_dismiss_text
487
-
488
- Get the text of the alert's dismiss button.
489
- The first button is considered "dismiss." on iOS 6
490
- The last button is considered "dismiss." on iOS 7
491
-
492
- __Returns:__
493
-
494
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
495
-
496
- --
497
-
498
- ##### [find](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/element/generic.rb#L61) ios
499
-
500
- > def find text
501
-
502
- Return the first element matching text.
503
-
504
- __Parameters:__
505
-
506
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text to search for
507
-
508
- __Returns:__
509
-
510
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element] the first matching element
511
-
512
- --
513
-
514
- ##### [finds](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/element/generic.rb#L83) ios
515
-
516
- > def finds text
517
-
518
- Return all elements matching text.
519
-
520
- __Parameters:__
521
-
522
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text to search for
523
-
524
- __Returns:__
525
-
526
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>] all matching elements
527
-
528
- --
529
-
530
- ##### [text](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/element/generic.rb#L97) ios
531
-
532
- > def text text
533
-
534
- Return the first element matching text.
535
-
536
- __Parameters:__
537
-
538
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text to search for
539
-
540
- __Returns:__
541
-
542
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element] the first matching element
543
-
544
- --
545
-
546
- ##### [texts](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/element/generic.rb#L105) ios
547
-
548
- > def texts text
549
-
550
- Return all elements matching text.
551
-
552
- __Parameters:__
553
-
554
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text to search for
555
-
556
- __Returns:__
557
-
558
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>] all matching elements
559
-
560
- --
561
-
562
- ##### [name](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/element/generic.rb#L117) ios
563
-
564
- > def name name
565
-
566
- Return the first element matching name.
567
- on Android name is content description
568
- on iOS name is the accessibility label or the text.
569
-
570
- __Parameters:__
571
-
572
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] name - the name to search for
573
-
574
- __Returns:__
575
-
576
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element] the first matching element
577
-
578
- --
579
-
580
- ##### [names](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/element/generic.rb#L126) ios
581
-
582
- > def names name
583
-
584
- Return all elements matching name.
585
- on Android name is content description
586
- on iOS name is the accessibility label or the text.
587
-
588
- __Parameters:__
589
-
590
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] name - the name to search for
591
-
592
- __Returns:__
593
-
594
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>] all matching elements
595
-
596
- --
597
-
598
- ##### [locate_single_textfield](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/element/textfield.rb#L8) ios
599
-
600
- > def locate_single_textfield js
601
-
602
- UIATextField & UIASecureTextField methods
603
-
604
- Find textfield and then secure elements in one server call
605
- to match Android.
606
-
607
- --
608
-
609
- ##### [textfields](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/element/textfield.rb#L18) ios
610
-
611
- > def textfields
612
-
613
- Get an array of textfield texts.
614
- Does not respect implicit wait because we're using execute_script.
615
-
616
- __Returns:__
617
-
618
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<String>]
619
-
620
- --
621
-
622
- ##### [e_textfields](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/element/textfield.rb#L24) ios
623
-
624
- > def e_textfields
625
-
626
- Get an array of textfield elements.
627
-
628
- __Returns:__
629
-
630
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Textfield>]
631
-
632
- --
633
-
634
- ##### [first_textfield](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/element/textfield.rb#L30) ios
635
-
636
- > def first_textfield
637
-
638
- Get the first textfield element.
639
-
640
- __Returns:__
641
-
642
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Textfield]
643
-
644
- --
645
-
646
- ##### [last_textfield](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/element/textfield.rb#L36) ios
647
-
648
- > def last_textfield
649
-
650
- Get the last textfield element.
651
-
652
- __Returns:__
653
-
654
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Textfield]
655
-
656
- --
657
-
658
- ##### [textfield](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/element/textfield.rb#L43) ios
659
-
660
- > def textfield text
661
-
662
- Get the first textfield that matches text.
663
-
664
- __Parameters:__
665
-
666
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String, Integer] text - the text to match exactly. If int then the textfield at that index is returned.
667
-
668
- __Returns:__
669
-
670
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Textfield]
671
-
672
- --
673
-
674
- ##### [textfield_include](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/element/textfield.rb#L57) ios
675
-
676
- > def textfield_include text
677
-
678
- Get the first textfield that includes text.
679
-
680
- __Parameters:__
681
-
682
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text the textfield must include
683
-
684
- __Returns:__
685
-
686
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Textfield]
687
-
688
- --
689
-
690
- ##### [textfield_exact](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/ios/element/textfield.rb#L64) ios
691
-
692
- > def textfield_exact text
693
-
694
- Get the first textfield that exactly matches text.
695
-
696
- __Parameters:__
697
-
698
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text the textfield must exactly match
699
-
700
- __Returns:__
701
-
702
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Textfield]
703
-
704
- --
705
-
706
- ##### [wait](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L33)
707
-
708
- > def wait max_wait=-1, interval=0.5, &block
709
-
710
- Check every 0.5 seconds to see if block.call doesn't raise an exception.
711
- if .call raises an exception then it will be tried again.
712
- if .call doesn't raise an exception then it will stop waiting.
713
-
714
- Example: wait { name('back').click }
715
-
716
- Give up after 30 seconds.
717
-
718
- __Parameters:__
719
-
720
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] max_wait - the maximum time in seconds to wait for.
721
- Note that max wait 0 means infinity.
722
-
723
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Float] interval - the time in seconds to wait after calling the block
724
-
725
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Block] block - the block to call
726
-
727
- __Returns:__
728
-
729
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Object] the result of block.call
730
-
731
- --
732
-
733
- ##### [ignore](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L53)
734
-
735
- > def ignore &block
736
-
737
- Return block.call and ignore any exceptions.
738
-
739
- --
740
-
741
- ##### [wait_true](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L63)
742
-
743
- > def wait_true max_wait=-1, interval=0.5, &block
744
-
745
- Check every 0.5 seconds to see if block.call returns true. nil is considered a failure.
746
- Give up after 30 seconds.
747
-
748
- __Parameters:__
749
-
750
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] max_wait - the maximum time in seconds to wait for
751
-
752
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Float] interval - the time in seconds to wait after calling the block
753
-
754
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Block] block - the block to call
755
-
756
- __Returns:__
757
-
758
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Object] the result of block.call
759
-
760
- --
761
-
762
- ##### [back](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L84)
763
-
764
- > def back
765
-
766
- Navigate back.
767
-
768
- __Returns:__
769
-
770
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
771
-
772
- --
773
-
774
- ##### [session_id](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L89)
775
-
776
- > def session_id
777
-
778
- For Sauce Labs reporting. Returns the current session id.
779
-
780
- --
781
-
782
- ##### [xpath](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L97)
783
-
784
- > def xpath xpath_str
785
-
786
- Returns the first element that matches the provided xpath.
787
-
788
- __Parameters:__
789
-
790
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] xpath_str - the XPath string
791
-
792
- __Returns:__
793
-
794
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
795
-
796
- --
797
-
798
- ##### [xpaths](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L105)
799
-
800
- > def xpaths xpath_str
801
-
802
- Returns all elements that match the provided xpath.
803
-
804
- __Parameters:__
805
-
806
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] xpath_str - the XPath string
807
-
808
- __Returns:__
809
-
810
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>]
811
-
812
- --
813
-
814
- ##### [ele_index](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L113)
815
-
816
- > def ele_index tag_name, index
817
-
818
- Get the element of type tag_name at matching index.
819
-
820
- __Parameters:__
821
-
822
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag_name - the tag name to find
823
-
824
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] index - the index
825
-
826
- __Returns:__
827
-
828
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element] the found element of type tag_name
829
-
830
- --
831
-
832
- ##### [find_eles](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L122)
833
-
834
- > def find_eles tag_name
835
-
836
- Get all elements exactly matching tag name
837
-
838
- __Parameters:__
839
-
840
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag_name - the tag name to find
841
-
842
- __Returns:__
843
-
844
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>] the found elements of type tag_name
845
-
846
- --
847
-
848
- ##### [find_ele_by_text](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L130)
849
-
850
- > def find_ele_by_text tag, text
851
-
852
- Get the first tag that exactly matches tag and text.
853
-
854
- __Parameters:__
855
-
856
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag - the tag name to match
857
-
858
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text to exactly match
859
-
860
- __Returns:__
861
-
862
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element] the element of type tag exactly matching text
863
-
864
- --
865
-
866
- ##### [find_eles_by_text](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L138)
867
-
868
- > def find_eles_by_text tag, text
869
-
870
- Get all tags that exactly match tag and text.
871
-
872
- __Parameters:__
873
-
874
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag - the tag name to match
875
-
876
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text to exactly match
877
-
878
- __Returns:__
879
-
880
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>] the elements of type tag exactly matching text
881
-
882
- --
883
-
884
- ##### [find_ele_by_attr_include](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L147)
885
-
886
- > def find_ele_by_attr_include tag, attr, value
887
-
888
- Get the first tag by attribute that exactly matches value.
889
-
890
- __Parameters:__
891
-
892
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag - the tag name to match
893
-
894
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] attr - the attribute to compare
895
-
896
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value of the attribute that the element must include
897
-
898
- __Returns:__
899
-
900
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element] the element of type tag who's attribute includes value
901
-
902
- --
903
-
904
- ##### [find_eles_by_attr_include](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L156)
905
-
906
- > def find_eles_by_attr_include tag, attr, value
907
-
908
- Get tags by attribute that include value.
909
-
910
- __Parameters:__
911
-
912
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag - the tag name to match
913
-
914
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] attr - the attribute to compare
915
-
916
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] value - the value of the attribute that the element must include
917
-
918
- __Returns:__
919
-
920
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>] the elements of type tag who's attribute includes value
921
-
922
- --
923
-
924
- ##### [find_ele_by_text_include](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L165)
925
-
926
- > def find_ele_by_text_include tag, text
927
-
928
- Get the first tag that includes text.
929
- element.attribute(:text).include? text
930
-
931
- __Parameters:__
932
-
933
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag - the tag name to match
934
-
935
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text the element must include
936
-
937
- __Returns:__
938
-
939
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element] the element of type tag that includes text
940
-
941
- --
942
-
943
- ##### [find_eles_by_text_include](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L174)
944
-
945
- > def find_eles_by_text_include tag, text
946
-
947
- Get the tags that include text.
948
- element.attribute(:text).include? text
949
-
950
- __Parameters:__
951
-
952
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag - the tag name to match
953
-
954
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] text - the text the element must include
955
-
956
- __Returns:__
957
-
958
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>] the elements of type tag that includes text
959
-
960
- --
961
-
962
- ##### [first_ele](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L181)
963
-
964
- > def first_ele tag_name
965
-
966
- Get the first tag that matches tag_name
967
-
968
- __Parameters:__
969
-
970
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag_name - the tag to match
971
-
972
- __Returns:__
973
-
974
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
975
-
976
- --
977
-
978
- ##### [last_ele](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L189)
979
-
980
- > def last_ele tag_name
981
-
982
- Get the last tag that matches tag_name
983
-
984
- __Parameters:__
985
-
986
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag_name - the tag to match
987
-
988
- __Returns:__
989
-
990
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
991
-
992
- --
993
-
994
- ##### [source](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L195)
995
-
996
- > def source
997
-
998
- Prints a JSON view of the current page
999
-
1000
- __Returns:__
1001
-
1002
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
1003
-
1004
- --
1005
-
1006
- ##### [get_source](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L201)
1007
-
1008
- > def get_source
1009
-
1010
- Gets a JSON view of the current page
1011
-
1012
- __Returns:__
1013
-
1014
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[JSON]
1015
-
1016
- --
1017
-
1018
- ##### [find_name](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L210)
1019
-
1020
- > def find_name name
1021
-
1022
- Returns the first element that exactly matches name
1023
-
1024
- __Parameters:__
1025
-
1026
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] name - the name to exactly match
1027
-
1028
- __Returns:__
1029
-
1030
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1031
-
1032
- --
1033
-
1034
- ##### [find_names](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L218)
1035
-
1036
- > def find_names name
1037
-
1038
- Returns all elements that exactly match name
1039
-
1040
- __Parameters:__
1041
-
1042
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] name - the name to exactly match
1043
-
1044
- __Returns:__
1045
-
1046
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>]
1047
-
1048
- --
1049
-
1050
- ##### [tag](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L226)
1051
-
1052
- > def tag tag_name
1053
-
1054
- Returns the first element matching tag_name
1055
-
1056
- __Parameters:__
1057
-
1058
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] tag_name - the tag_name to search for
1059
-
1060
- __Returns:__
1061
-
1062
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1063
-
1064
- --
1065
-
1066
- ##### [px_to_window_rel](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L236)
1067
-
1068
- > def px_to_window_rel opts={}
1069
-
1070
- Converts pixel values to window relative values
1071
-
1072
- ```ruby
1073
- px_to_window_rel x: 50, y: 150
1074
- ```
1075
-
1076
- --
1077
-
1078
- ##### [lazy_load_strings](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L246)
1079
-
1080
- > def lazy_load_strings
1081
-
1082
-
1083
-
1084
- --
1085
-
1086
- ##### [xml_keys](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L253)
1087
-
1088
- > def xml_keys target
1089
-
1090
- Search strings.xml's values for target.
1091
-
1092
- __Parameters:__
1093
-
1094
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] target - the target to search for in strings.xml values
1095
-
1096
- __Returns:__
1097
-
1098
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array]
1099
-
1100
- --
1101
-
1102
- ##### [xml_values](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L261)
1103
-
1104
- > def xml_values target
1105
-
1106
- Search strings.xml's keys for target.
1107
-
1108
- __Parameters:__
1109
-
1110
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] target - the target to search for in strings.xml keys
1111
-
1112
- __Returns:__
1113
-
1114
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array]
1115
-
1116
- --
1117
-
1118
- ##### [resolve_id](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L269)
1119
-
1120
- > def resolve_id id
1121
-
1122
- Resolve id in strings.xml and return the value.
1123
-
1124
- __Parameters:__
1125
-
1126
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] id - the id to resolve
1127
-
1128
- __Returns:__
1129
-
1130
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
1131
-
1132
- --
1133
-
1134
- ##### [raise_no_element_error](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/helper.rb#L275)
1135
-
1136
- > def raise_no_element_error
1137
-
1138
- Used to error when finding a single element fails.
1139
-
1140
- --
1141
-
1142
- ##### [value](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/patch.rb#L32)
1143
-
1144
- > def value
1145
-
1146
- Returns the value attribute
1147
-
1148
- Fixes NoMethodError: undefined method `value' for Selenium::WebDriver::Element
1149
-
1150
- --
1151
-
1152
- ##### [name](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/patch.rb#L39)
1153
-
1154
- > def name
1155
-
1156
- Returns the name attribute
1157
-
1158
- Fixes NoMethodError: undefined method `name' for Selenium::WebDriver::Element
1159
-
1160
- --
1161
-
1162
- ##### [tag_name](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/patch.rb#L46)
1163
-
1164
- > def tag_name
1165
-
1166
- Returns the type attribute
1167
-
1168
- Fixes Selenium::WebDriver::Error::UnknownError: Not yet implemented
1169
-
1170
- --
1171
-
1172
- ##### [location_rel](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/common/patch.rb#L58)
1173
-
1174
- > def location_rel
1175
-
1176
- For use with mobile tap.
1177
-
1178
- ```ruby
1179
- execute_script 'mobile: tap', :x => 0.0, :y => 0.98
1180
- ```
1181
-
1182
- https://github.com/appium/appium/wiki/Automating-mobile-gestures
1183
-
1184
- __Returns:__
1185
-
1186
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[OpenStruct] the relative x, y in a struct. ex: { x: 0.50, y: 0.20 }
1187
-
1188
- --
1189
-
1190
- ##### [CORE](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L16)
1191
-
1192
- > CORE = [ :array, :hash, :class, :file, :dir, :bigdecimal, :rational, :struct, :openstruct, :method, :unboundmethod ]
1193
-
1194
-
1195
-
1196
- --
1197
-
1198
- ##### [awesome_openstruct](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L18)
1199
-
1200
- > def awesome_openstruct target
1201
-
1202
-
1203
-
1204
- --
1205
-
1206
- ##### [load_appium_txt](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L28)
1207
-
1208
- > def load_appium_txt opts
1209
-
1210
- Load appium.txt (toml format) into system ENV
1211
- the basedir of this file + appium.txt is what's used
1212
-
1213
- __Parameters:__
1214
-
1215
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Hash] opts - file: '/path/to/appium.txt', verbose: true
1216
-
1217
- __Returns:__
1218
-
1219
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<String>] the require files. nil if require doesn't exist
1220
-
1221
- --
1222
-
1223
- ##### [promote_singleton_appium_methods](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L154)
1224
-
1225
- > def self.promote_singleton_appium_methods main_module
1226
-
1227
-
1228
-
1229
- --
1230
-
1231
- ##### [promote_appium_methods](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L184)
1232
-
1233
- > def self.promote_appium_methods class_array
1234
-
1235
- Promote appium methods to class instance methods
1236
-
1237
- To promote methods to all classes:
1238
-
1239
- ```ruby
1240
- Appium.promote_appium_methods Object
1241
- ```
1242
-
1243
- __Parameters:__
1244
-
1245
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Class>] class_array - An array of classes
1246
-
1247
- --
1248
-
1249
- ##### [default_wait](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L515)
1250
-
1251
- > def default_wait
1252
-
1253
- Returns the default client side wait.
1254
- This value is independent of what the server is using
1255
-
1256
- __Returns:__
1257
-
1258
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer]
1259
-
1260
- --
1261
-
1262
- ##### [app_path](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L213)
1263
-
1264
- > def app_path
1265
-
1266
- Returns the value of attribute app_path
1267
-
1268
- --
1269
-
1270
- ##### [app_name](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L213)
1271
-
1272
- > def app_name
1273
-
1274
- Returns the value of attribute app_name
1275
-
1276
- --
1277
-
1278
- ##### [device](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L213)
1279
-
1280
- > def device
1281
-
1282
- Returns the value of attribute device
1283
-
1284
- --
1285
-
1286
- ##### [app_package](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L213)
1287
-
1288
- > def app_package
1289
-
1290
- Returns the value of attribute app_package
1291
-
1292
- --
1293
-
1294
- ##### [app_activity](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L213)
1295
-
1296
- > def app_activity
1297
-
1298
- Returns the value of attribute app_activity
1299
-
1300
- --
1301
-
1302
- ##### [app_wait_activity](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L213)
1303
-
1304
- > def app_wait_activity
1305
-
1306
- Returns the value of attribute app_wait_activity
1307
-
1308
- --
1309
-
1310
- ##### [sauce_username](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L213)
1311
-
1312
- > def sauce_username
1313
-
1314
- Returns the value of attribute sauce_username
1315
-
1316
- --
1317
-
1318
- ##### [sauce_access_key](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L213)
1319
-
1320
- > def sauce_access_key
1321
-
1322
- Returns the value of attribute sauce_access_key
1323
-
1324
- --
1325
-
1326
- ##### [port](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L213)
1327
-
1328
- > def port
1329
-
1330
- Returns the value of attribute port
1331
-
1332
- --
1333
-
1334
- ##### [debug](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L213)
1335
-
1336
- > def debug
1337
-
1338
- Returns the value of attribute debug
1339
-
1340
- --
1341
-
1342
- ##### [export_session](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L213)
1343
-
1344
- > def export_session
1345
-
1346
- Returns the value of attribute export_session
1347
-
1348
- --
1349
-
1350
- ##### [device_cap](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L213)
1351
-
1352
- > def device_cap
1353
-
1354
- Returns the value of attribute device_cap
1355
-
1356
- --
1357
-
1358
- ##### [compress_xml](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L213)
1359
-
1360
- > def compress_xml
1361
-
1362
- Returns the value of attribute compress_xml
1363
-
1364
- --
1365
-
1366
- ##### [custom_url](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L213)
1367
-
1368
- > def custom_url
1369
-
1370
- Returns the value of attribute custom_url
1371
-
1372
- --
1373
-
1374
- ##### [global_webdriver_http_sleep](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L219)
1375
-
1376
- > def global_webdriver_http_sleep
1377
-
1378
- The amount to sleep in seconds before every webdriver http call.
1379
-
1380
- --
1381
-
1382
- ##### [global_webdriver_http_sleep=](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L219)
1383
-
1384
- > def global_webdriver_http_sleep=(value)
1385
-
1386
- The amount to sleep in seconds before every webdriver http call.
1387
-
1388
- --
1389
-
1390
- ##### [initialize](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L249)
1391
-
1392
- > def initialize opts={}
1393
-
1394
- Creates a new driver.
1395
- :device is :android, :ios, or :selendroid
1396
-
1397
- ```ruby
1398
- # Options include:
1399
- :app_path, :app_name, :app_package, :app_activity,
1400
- :app_wait_activity, :sauce_username, :sauce_access_key,
1401
- :port, :os, :debug
1402
-
1403
- require 'rubygems'
1404
- require 'appium_lib'
1405
-
1406
- # Start iOS driver
1407
- app = { device: :ios, app_path: '/path/to/MyiOS.app'}
1408
- Appium::Driver.new(app).start_driver
1409
-
1410
- # Start Android driver
1411
- apk = { device: :android
1412
- app_path: '/path/to/the.apk',
1413
- app_package: 'com.example.pkg',
1414
- app_activity: 'act.Start',
1415
- app_wait_activity: 'act.Start'
1416
- }
1417
-
1418
- Appium::Driver.new(apk).start_driver
1419
- ```
1420
-
1421
- __Parameters:__
1422
-
1423
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Object] opts - A hash containing various options.
1424
-
1425
- __Returns:__
1426
-
1427
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Driver]
1428
-
1429
- --
1430
-
1431
- ##### [status](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L356)
1432
-
1433
- > def status
1434
-
1435
- Returns the status payload
1436
-
1437
- ```ruby
1438
- {"status"=>0,
1439
- "value"=>
1440
- {"build"=>
1441
- {"version"=>"0.8.2",
1442
- "revision"=>"f2a2bc3782e4b0370d97a097d7e04913cf008995"}},
1443
- "sessionId"=>"8f4b34a7-a9a9-4ac5-b125-36258143446a"}
1444
- ```
1445
-
1446
- Discover the Appium rev running on the server.
1447
-
1448
- `status["value"]["build"]["revision"]`
1449
- `f2a2bc3782e4b0370d97a097d7e04913cf008995`
1450
-
1451
- __Returns:__
1452
-
1453
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[JSON]
1454
-
1455
- --
1456
-
1457
- ##### [server_version](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L362)
1458
-
1459
- > def server_version
1460
-
1461
- Returns the server's version string
1462
-
1463
- __Returns:__
1464
-
1465
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String]
1466
-
1467
- --
1468
-
1469
- ##### [absolute_app_path](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L402)
1470
-
1471
- > def absolute_app_path
1472
-
1473
- Converts environment variable APP_PATH to an absolute path.
1474
-
1475
- __Returns:__
1476
-
1477
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] APP_PATH as an absolute path
1478
-
1479
- --
1480
-
1481
- ##### [server_url](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L422)
1482
-
1483
- > def server_url
1484
-
1485
- Get the server url for sauce or local based on env vars.
1486
-
1487
- __Returns:__
1488
-
1489
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] the server url
1490
-
1491
- --
1492
-
1493
- ##### [restart](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L433)
1494
-
1495
- > def restart
1496
-
1497
- Restarts the driver
1498
-
1499
- __Returns:__
1500
-
1501
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Driver] the driver
1502
-
1503
- --
1504
-
1505
- ##### [driver](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L440)
1506
-
1507
- > def driver
1508
-
1509
- Returns the driver
1510
-
1511
- __Returns:__
1512
-
1513
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Driver] the driver
1514
-
1515
- --
1516
-
1517
- ##### [screenshot](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L450)
1518
-
1519
- > def screenshot png_save_path
1520
-
1521
- Takes a png screenshot and saves to the target path.
1522
-
1523
- Example: screenshot '/tmp/hi.png'
1524
-
1525
- __Parameters:__
1526
-
1527
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] png_save_path - the full path to save the png
1528
-
1529
- __Returns:__
1530
-
1531
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[nil]
1532
-
1533
- --
1534
-
1535
- ##### [driver_quit](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L457)
1536
-
1537
- > def driver_quit
1538
-
1539
- Quits the driver
1540
-
1541
- __Returns:__
1542
-
1543
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
1544
-
1545
- --
1546
-
1547
- ##### [start_driver](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L465)
1548
-
1549
- > def start_driver
1550
-
1551
- Creates a new global driver and quits the old one if it exists.
1552
-
1553
- __Returns:__
1554
-
1555
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Selenium::WebDriver] the new global driver
1556
-
1557
- --
1558
-
1559
- ##### [no_wait](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L499)
1560
-
1561
- > def no_wait
1562
-
1563
- Set implicit wait and default_wait to zero.
1564
-
1565
- --
1566
-
1567
- ##### [set_wait](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L507)
1568
-
1569
- > def set_wait timeout=@default_wait
1570
-
1571
- Set implicit wait and default_wait to timeout, defaults to 30.
1572
-
1573
- __Parameters:__
1574
-
1575
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] timeout - the timeout in seconds
1576
-
1577
- __Returns:__
1578
-
1579
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
1580
-
1581
- --
1582
-
1583
- ##### [exists](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L531)
1584
-
1585
- > def exists pre_check=0, post_check=@default_wait, &search_block
1586
-
1587
- Returns existence of element.
1588
-
1589
- Example:
1590
-
1591
- exists { button('sign in') } ? puts('true') : puts('false')
1592
-
1593
- __Parameters:__
1594
-
1595
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] pre_check - the amount in seconds to set the
1596
- wait to before checking existance
1597
-
1598
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Integer] post_check - the amount in seconds to set the
1599
- wait to after checking existance
1600
-
1601
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Block] search_block - the block to call
1602
-
1603
- __Returns:__
1604
-
1605
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Boolean]
1606
-
1607
- --
1608
-
1609
- ##### [execute_script](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L553)
1610
-
1611
- > def execute_script script, *args
1612
-
1613
- The same as @driver.execute_script
1614
-
1615
- __Parameters:__
1616
-
1617
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String] script - the script to execute
1618
-
1619
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[*args] args - the args to pass to the script
1620
-
1621
- __Returns:__
1622
-
1623
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Object]
1624
-
1625
- --
1626
-
1627
- ##### [mobile](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L569)
1628
-
1629
- > def mobile method, *args
1630
-
1631
- Helper method for mobile gestures
1632
-
1633
- https://github.com/appium/appium/wiki/Automating-mobile-gestures
1634
-
1635
- driver.execute_script 'mobile: swipe', endX: 100, endY: 100, duration: 0.01
1636
-
1637
- becomes
1638
-
1639
- mobile :swipe, endX: 100, endY: 100, duration: 0.01
1640
-
1641
- __Parameters:__
1642
-
1643
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[String, Symbol] method - the method to execute
1644
-
1645
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[*args] args - the args to pass to the method
1646
-
1647
- __Returns:__
1648
-
1649
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Object]
1650
-
1651
- --
1652
-
1653
- ##### [find_elements](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L580)
1654
-
1655
- > def find_elements *args
1656
-
1657
- Calls @driver.find_elements
1658
-
1659
- __Parameters:__
1660
-
1661
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[*args] args - the args to use
1662
-
1663
- __Returns:__
1664
-
1665
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Array<Element>] Array is empty when no elements are found.
1666
-
1667
- --
1668
-
1669
- ##### [find_element](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L588)
1670
-
1671
- > def find_element *args
1672
-
1673
- Calls @driver.find_elements
1674
-
1675
- __Parameters:__
1676
-
1677
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[*args] args - the args to use
1678
-
1679
- __Returns:__
1680
-
1681
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Element]
1682
-
1683
- --
1684
-
1685
- ##### [x](https://github.com/appium/ruby_lib/blob/c92bd3710be09731aa8ba4547a3e19af9eeaceab/lib/appium_lib/driver.rb#L595)
1686
-
1687
- > def x
1688
-
1689
- Quit the driver and Pry.
1690
- quit and exit are reserved by Pry.
1691
-
1692
- __Returns:__
1693
-
1694
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[void]
1695
-
1696
- --
1697
-