appium_lib 0.15.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -3
- data/Rakefile +14 -3
- data/appium_lib.gemspec +2 -0
- data/docs/android_docs.md +1690 -0
- data/docs/ios_docs.md +1754 -0
- data/docs_gen/make_docs.rb +7 -1
- data/lib/appium_lib/common/version.rb +2 -2
- data/lib/appium_lib/driver.rb +4 -4
- data/release_notes.md +8 -0
- metadata +30 -2
data/docs/ios_docs.md
CHANGED
@@ -0,0 +1,1754 @@
|
|
1
|
+
##### [s_texts](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/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/fe6057045fd4d9ee1eb77ec57108755b4d445592/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/fe6057045fd4d9ee1eb77ec57108755b4d445592/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
|
+
[Array<Text>]
|
35
|
+
|
36
|
+
--
|
37
|
+
|
38
|
+
##### [first_s_text](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/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
|
+
[Text]
|
47
|
+
|
48
|
+
--
|
49
|
+
|
50
|
+
##### [last_s_text](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/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
|
+
[Text]
|
59
|
+
|
60
|
+
--
|
61
|
+
|
62
|
+
##### [s_text](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/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
|
+
[String, Integer] text - the text to find. If int then the text at that index is returned.
|
71
|
+
|
72
|
+
__Returns:__
|
73
|
+
|
74
|
+
[Text]
|
75
|
+
|
76
|
+
--
|
77
|
+
|
78
|
+
##### [s_text_exact](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/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
|
+
[String] text - the text that the tag must match
|
87
|
+
|
88
|
+
__Returns:__
|
89
|
+
|
90
|
+
[Text]
|
91
|
+
|
92
|
+
--
|
93
|
+
|
94
|
+
##### [s_texts_exact](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/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
|
+
[String] text - the text that the tag must match
|
103
|
+
|
104
|
+
__Returns:__
|
105
|
+
|
106
|
+
[Array<Text>]
|
107
|
+
|
108
|
+
--
|
109
|
+
|
110
|
+
##### [window_size](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/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/fe6057045fd4d9ee1eb77ec57108755b4d445592/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
|
+
[String, Integer] text - the text to exactly match. If int then the button at that index is returned.
|
127
|
+
|
128
|
+
[Integer] number - the occurrence of the button matching text. Defaults to the first button.
|
129
|
+
|
130
|
+
__Returns:__
|
131
|
+
|
132
|
+
[Button] the button found with text and matching number
|
133
|
+
|
134
|
+
--
|
135
|
+
|
136
|
+
##### [buttons](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/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
|
+
[String] text - the text to exactly match
|
145
|
+
|
146
|
+
__Returns:__
|
147
|
+
|
148
|
+
[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/fe6057045fd4d9ee1eb77ec57108755b4d445592/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
|
+
[Button]
|
161
|
+
|
162
|
+
--
|
163
|
+
|
164
|
+
##### [last_button](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/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
|
+
[Button]
|
173
|
+
|
174
|
+
--
|
175
|
+
|
176
|
+
##### [button_exact](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/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
|
+
[String] text - the text to match exactly
|
185
|
+
|
186
|
+
__Returns:__
|
187
|
+
|
188
|
+
[Button]
|
189
|
+
|
190
|
+
--
|
191
|
+
|
192
|
+
##### [buttons_exact](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/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
|
+
[String] text - the text to match exactly
|
201
|
+
|
202
|
+
__Returns:__
|
203
|
+
|
204
|
+
[Array<Button>]
|
205
|
+
|
206
|
+
--
|
207
|
+
|
208
|
+
##### [e_buttons](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/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
|
+
[Array<Button>]
|
217
|
+
|
218
|
+
--
|
219
|
+
|
220
|
+
##### [button_num](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/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
|
+
[String] text - the text to match
|
240
|
+
|
241
|
+
[Integer] number - the button occurance to return. 1 = first button
|
242
|
+
|
243
|
+
__Returns:__
|
244
|
+
|
245
|
+
[Button] the button that matches text and number
|
246
|
+
|
247
|
+
--
|
248
|
+
|
249
|
+
##### [find_eles_attr](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/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
|
+
[String] tag_name - the tag name to find
|
259
|
+
|
260
|
+
[String] attribute - the attribute to collect
|
261
|
+
|
262
|
+
__Returns:__
|
263
|
+
|
264
|
+
[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/fe6057045fd4d9ee1eb77ec57108755b4d445592/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
|
+
[String] tag_name_1 - the 1st tag name to find
|
278
|
+
|
279
|
+
[String] tag_name_2 - the 2nd tag name to find
|
280
|
+
|
281
|
+
[String] attribute - the attribute to collect
|
282
|
+
|
283
|
+
__Returns:__
|
284
|
+
|
285
|
+
[Array<String>] an array of strings containing the attribute from found elements of type tag_name.
|
286
|
+
|
287
|
+
--
|
288
|
+
|
289
|
+
##### [ios_password](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/ios/helper.rb#L50) ios
|
290
|
+
|
291
|
+
> def ios_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
|
+
[Integer] length - the length of the password to generate
|
300
|
+
|
301
|
+
__Returns:__
|
302
|
+
|
303
|
+
[String] the returned string is of size length
|
304
|
+
|
305
|
+
--
|
306
|
+
|
307
|
+
##### [get_page_class](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/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/fe6057045fd4d9ee1eb77ec57108755b4d445592/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/fe6057045fd4d9ee1eb77ec57108755b4d445592/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
|
+
[Object] element - the element to search. omit to search everything
|
335
|
+
|
336
|
+
__Returns:__
|
337
|
+
|
338
|
+
[String]
|
339
|
+
|
340
|
+
--
|
341
|
+
|
342
|
+
##### [page](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/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
|
+
[void]
|
351
|
+
|
352
|
+
--
|
353
|
+
|
354
|
+
##### [source_window](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/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
|
+
[Integer] window_number - the int index of the target window
|
363
|
+
|
364
|
+
__Returns:__
|
365
|
+
|
366
|
+
[JSON]
|
367
|
+
|
368
|
+
--
|
369
|
+
|
370
|
+
##### [page_window](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/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
|
+
[Integer] window_number - the int index of the target window
|
380
|
+
|
381
|
+
--
|
382
|
+
|
383
|
+
##### [fast_duration](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/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
|
+
[Float]
|
392
|
+
|
393
|
+
--
|
394
|
+
|
395
|
+
##### [id](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/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
|
+
[String] id - the id to search for
|
404
|
+
|
405
|
+
__Returns:__
|
406
|
+
|
407
|
+
[Element]
|
408
|
+
|
409
|
+
--
|
410
|
+
|
411
|
+
##### [ios_version](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/ios/helper.rb#L198) ios
|
412
|
+
|
413
|
+
> def ios_version
|
414
|
+
|
415
|
+
Return the iOS version as an array of integers
|
416
|
+
|
417
|
+
__Returns:__
|
418
|
+
|
419
|
+
[Array<Integer>]
|
420
|
+
|
421
|
+
--
|
422
|
+
|
423
|
+
##### [alert_click](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/ios/element/alert.rb#L14) ios
|
424
|
+
|
425
|
+
> def alert_click value
|
426
|
+
|
427
|
+
iOS only
|
428
|
+
Tap the alert button identified by value.
|
429
|
+
|
430
|
+
Click the ok button:
|
431
|
+
alert_click 'OK'
|
432
|
+
|
433
|
+
Click the first button:
|
434
|
+
alert_click 0
|
435
|
+
|
436
|
+
__Parameters:__
|
437
|
+
|
438
|
+
[Integer, String] value - either an integer index of the button or the button's name
|
439
|
+
|
440
|
+
__Returns:__
|
441
|
+
|
442
|
+
[void]
|
443
|
+
|
444
|
+
--
|
445
|
+
|
446
|
+
##### [alert_text](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/ios/element/alert.rb#L21) ios
|
447
|
+
|
448
|
+
> def alert_text
|
449
|
+
|
450
|
+
Get the alert message text.
|
451
|
+
|
452
|
+
__Returns:__
|
453
|
+
|
454
|
+
[String]
|
455
|
+
|
456
|
+
--
|
457
|
+
|
458
|
+
##### [alert_accept](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/ios/element/alert.rb#L30) ios
|
459
|
+
|
460
|
+
> def alert_accept
|
461
|
+
|
462
|
+
Accept the alert.
|
463
|
+
|
464
|
+
__Returns:__
|
465
|
+
|
466
|
+
[void]
|
467
|
+
|
468
|
+
--
|
469
|
+
|
470
|
+
##### [alert_accept_text](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/ios/element/alert.rb#L40) ios
|
471
|
+
|
472
|
+
> def alert_accept_text
|
473
|
+
|
474
|
+
Get the text of the alert's accept button.
|
475
|
+
The last button is considered "accept." on iOS 6
|
476
|
+
The first button is considered "accept." on iOS 7
|
477
|
+
|
478
|
+
__Returns:__
|
479
|
+
|
480
|
+
[String]
|
481
|
+
|
482
|
+
--
|
483
|
+
|
484
|
+
##### [alert_dismiss](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/ios/element/alert.rb#L64) ios
|
485
|
+
|
486
|
+
> def alert_dismiss
|
487
|
+
|
488
|
+
Dismiss the alert.
|
489
|
+
|
490
|
+
__Returns:__
|
491
|
+
|
492
|
+
[void]
|
493
|
+
|
494
|
+
--
|
495
|
+
|
496
|
+
##### [alert_dismiss_text](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/ios/element/alert.rb#L74) ios
|
497
|
+
|
498
|
+
> def alert_dismiss_text
|
499
|
+
|
500
|
+
Get the text of the alert's dismiss button.
|
501
|
+
The first button is considered "dismiss." on iOS 6
|
502
|
+
The last button is considered "dismiss." on iOS 7
|
503
|
+
|
504
|
+
__Returns:__
|
505
|
+
|
506
|
+
[String]
|
507
|
+
|
508
|
+
--
|
509
|
+
|
510
|
+
##### [find](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/ios/element/generic.rb#L61) ios
|
511
|
+
|
512
|
+
> def find text
|
513
|
+
|
514
|
+
Return the first element matching text.
|
515
|
+
|
516
|
+
__Parameters:__
|
517
|
+
|
518
|
+
[String] text - the text to search for
|
519
|
+
|
520
|
+
__Returns:__
|
521
|
+
|
522
|
+
[Element] the first matching element
|
523
|
+
|
524
|
+
--
|
525
|
+
|
526
|
+
##### [finds](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/ios/element/generic.rb#L83) ios
|
527
|
+
|
528
|
+
> def finds text
|
529
|
+
|
530
|
+
Return all elements matching text.
|
531
|
+
|
532
|
+
__Parameters:__
|
533
|
+
|
534
|
+
[String] text - the text to search for
|
535
|
+
|
536
|
+
__Returns:__
|
537
|
+
|
538
|
+
[Array<Element>] all matching elements
|
539
|
+
|
540
|
+
--
|
541
|
+
|
542
|
+
##### [text](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/ios/element/generic.rb#L97) ios
|
543
|
+
|
544
|
+
> def text text
|
545
|
+
|
546
|
+
Return the first element matching text.
|
547
|
+
|
548
|
+
__Parameters:__
|
549
|
+
|
550
|
+
[String] text - the text to search for
|
551
|
+
|
552
|
+
__Returns:__
|
553
|
+
|
554
|
+
[Element] the first matching element
|
555
|
+
|
556
|
+
--
|
557
|
+
|
558
|
+
##### [texts](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/ios/element/generic.rb#L105) ios
|
559
|
+
|
560
|
+
> def texts text
|
561
|
+
|
562
|
+
Return all elements matching text.
|
563
|
+
|
564
|
+
__Parameters:__
|
565
|
+
|
566
|
+
[String] text - the text to search for
|
567
|
+
|
568
|
+
__Returns:__
|
569
|
+
|
570
|
+
[Array<Element>] all matching elements
|
571
|
+
|
572
|
+
--
|
573
|
+
|
574
|
+
##### [name](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/ios/element/generic.rb#L117) ios
|
575
|
+
|
576
|
+
> def name name
|
577
|
+
|
578
|
+
Return the first element matching name.
|
579
|
+
on Android name is content description
|
580
|
+
on iOS name is the accessibility label or the text.
|
581
|
+
|
582
|
+
__Parameters:__
|
583
|
+
|
584
|
+
[String] name - the name to search for
|
585
|
+
|
586
|
+
__Returns:__
|
587
|
+
|
588
|
+
[Element] the first matching element
|
589
|
+
|
590
|
+
--
|
591
|
+
|
592
|
+
##### [name_exact](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/ios/element/generic.rb#L121) ios
|
593
|
+
|
594
|
+
> def name_exact name
|
595
|
+
|
596
|
+
|
597
|
+
|
598
|
+
--
|
599
|
+
|
600
|
+
##### [names](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/ios/element/generic.rb#L139) ios
|
601
|
+
|
602
|
+
> def names name
|
603
|
+
|
604
|
+
Return all elements matching name.
|
605
|
+
on Android name is content description
|
606
|
+
on iOS name is the accessibility label or the text.
|
607
|
+
|
608
|
+
__Parameters:__
|
609
|
+
|
610
|
+
[String] name - the name to search for
|
611
|
+
|
612
|
+
__Returns:__
|
613
|
+
|
614
|
+
[Array<Element>] all matching elements
|
615
|
+
|
616
|
+
--
|
617
|
+
|
618
|
+
##### [locate_single_textfield](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/ios/element/textfield.rb#L8) ios
|
619
|
+
|
620
|
+
> def locate_single_textfield js
|
621
|
+
|
622
|
+
UIATextField & UIASecureTextField methods
|
623
|
+
|
624
|
+
Find textfield and then secure elements in one server call
|
625
|
+
to match Android.
|
626
|
+
|
627
|
+
--
|
628
|
+
|
629
|
+
##### [textfields](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/ios/element/textfield.rb#L18) ios
|
630
|
+
|
631
|
+
> def textfields
|
632
|
+
|
633
|
+
Get an array of textfield texts.
|
634
|
+
Does not respect implicit wait because we're using execute_script.
|
635
|
+
|
636
|
+
__Returns:__
|
637
|
+
|
638
|
+
[Array<String>]
|
639
|
+
|
640
|
+
--
|
641
|
+
|
642
|
+
##### [e_textfields](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/ios/element/textfield.rb#L24) ios
|
643
|
+
|
644
|
+
> def e_textfields
|
645
|
+
|
646
|
+
Get an array of textfield elements.
|
647
|
+
|
648
|
+
__Returns:__
|
649
|
+
|
650
|
+
[Array<Textfield>]
|
651
|
+
|
652
|
+
--
|
653
|
+
|
654
|
+
##### [first_textfield](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/ios/element/textfield.rb#L30) ios
|
655
|
+
|
656
|
+
> def first_textfield
|
657
|
+
|
658
|
+
Get the first textfield element.
|
659
|
+
|
660
|
+
__Returns:__
|
661
|
+
|
662
|
+
[Textfield]
|
663
|
+
|
664
|
+
--
|
665
|
+
|
666
|
+
##### [last_textfield](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/ios/element/textfield.rb#L36) ios
|
667
|
+
|
668
|
+
> def last_textfield
|
669
|
+
|
670
|
+
Get the last textfield element.
|
671
|
+
|
672
|
+
__Returns:__
|
673
|
+
|
674
|
+
[Textfield]
|
675
|
+
|
676
|
+
--
|
677
|
+
|
678
|
+
##### [textfield](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/ios/element/textfield.rb#L43) ios
|
679
|
+
|
680
|
+
> def textfield text
|
681
|
+
|
682
|
+
Get the first textfield that matches text.
|
683
|
+
|
684
|
+
__Parameters:__
|
685
|
+
|
686
|
+
[String, Integer] text - the text to match exactly. If int then the textfield at that index is returned.
|
687
|
+
|
688
|
+
__Returns:__
|
689
|
+
|
690
|
+
[Textfield]
|
691
|
+
|
692
|
+
--
|
693
|
+
|
694
|
+
##### [textfield_include](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/ios/element/textfield.rb#L57) ios
|
695
|
+
|
696
|
+
> def textfield_include text
|
697
|
+
|
698
|
+
Get the first textfield that includes text.
|
699
|
+
|
700
|
+
__Parameters:__
|
701
|
+
|
702
|
+
[String] text - the text the textfield must include
|
703
|
+
|
704
|
+
__Returns:__
|
705
|
+
|
706
|
+
[Textfield]
|
707
|
+
|
708
|
+
--
|
709
|
+
|
710
|
+
##### [textfield_exact](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/ios/element/textfield.rb#L64) ios
|
711
|
+
|
712
|
+
> def textfield_exact text
|
713
|
+
|
714
|
+
Get the first textfield that exactly matches text.
|
715
|
+
|
716
|
+
__Parameters:__
|
717
|
+
|
718
|
+
[String] text - the text the textfield must exactly match
|
719
|
+
|
720
|
+
__Returns:__
|
721
|
+
|
722
|
+
[Textfield]
|
723
|
+
|
724
|
+
--
|
725
|
+
|
726
|
+
##### [textfield_named](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/ios/element/textfield.rb#L70) ios
|
727
|
+
|
728
|
+
> def textfield_named target_name
|
729
|
+
|
730
|
+
Get the first textfield that exactly matches name
|
731
|
+
|
732
|
+
__Returns:__
|
733
|
+
|
734
|
+
[Element]
|
735
|
+
|
736
|
+
--
|
737
|
+
|
738
|
+
##### [wait](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L33)
|
739
|
+
|
740
|
+
> def wait max_wait=30, interval=0.5, &block
|
741
|
+
|
742
|
+
Check every 0.5 seconds to see if block.call doesn't raise an exception.
|
743
|
+
if .call raises an exception then it will be tried again.
|
744
|
+
if .call doesn't raise an exception then it will stop waiting.
|
745
|
+
|
746
|
+
Example: wait { name('back').click }
|
747
|
+
|
748
|
+
Give up after 30 seconds.
|
749
|
+
|
750
|
+
__Parameters:__
|
751
|
+
|
752
|
+
[Integer] max_wait - the maximum time in seconds to wait for.
|
753
|
+
Note that max wait 0 means infinity.
|
754
|
+
|
755
|
+
[Float] interval - the time in seconds to wait after calling the block
|
756
|
+
|
757
|
+
[Block] block - the block to call
|
758
|
+
|
759
|
+
__Returns:__
|
760
|
+
|
761
|
+
[Object] the result of block.call
|
762
|
+
|
763
|
+
--
|
764
|
+
|
765
|
+
##### [ignore](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L45)
|
766
|
+
|
767
|
+
> def ignore &block
|
768
|
+
|
769
|
+
Return block.call and ignore any exceptions.
|
770
|
+
|
771
|
+
--
|
772
|
+
|
773
|
+
##### [wait_true](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L55)
|
774
|
+
|
775
|
+
> def wait_true max_wait=30, interval=0.5, &block
|
776
|
+
|
777
|
+
Check every 0.5 seconds to see if block.call returns true. nil is considered a failure.
|
778
|
+
Give up after 30 seconds.
|
779
|
+
|
780
|
+
__Parameters:__
|
781
|
+
|
782
|
+
[Integer] max_wait - the maximum time in seconds to wait for
|
783
|
+
|
784
|
+
[Float] interval - the time in seconds to wait after calling the block
|
785
|
+
|
786
|
+
[Block] block - the block to call
|
787
|
+
|
788
|
+
__Returns:__
|
789
|
+
|
790
|
+
[Object] the result of block.call
|
791
|
+
|
792
|
+
--
|
793
|
+
|
794
|
+
##### [back](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L68)
|
795
|
+
|
796
|
+
> def back
|
797
|
+
|
798
|
+
Navigate back.
|
799
|
+
|
800
|
+
__Returns:__
|
801
|
+
|
802
|
+
[void]
|
803
|
+
|
804
|
+
--
|
805
|
+
|
806
|
+
##### [session_id](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L73)
|
807
|
+
|
808
|
+
> def session_id
|
809
|
+
|
810
|
+
For Sauce Labs reporting. Returns the current session id.
|
811
|
+
|
812
|
+
--
|
813
|
+
|
814
|
+
##### [xpath](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L81)
|
815
|
+
|
816
|
+
> def xpath xpath_str
|
817
|
+
|
818
|
+
Returns the first element that matches the provided xpath.
|
819
|
+
|
820
|
+
__Parameters:__
|
821
|
+
|
822
|
+
[String] xpath_str - the XPath string
|
823
|
+
|
824
|
+
__Returns:__
|
825
|
+
|
826
|
+
[Element]
|
827
|
+
|
828
|
+
--
|
829
|
+
|
830
|
+
##### [xpaths](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L89)
|
831
|
+
|
832
|
+
> def xpaths xpath_str
|
833
|
+
|
834
|
+
Returns all elements that match the provided xpath.
|
835
|
+
|
836
|
+
__Parameters:__
|
837
|
+
|
838
|
+
[String] xpath_str - the XPath string
|
839
|
+
|
840
|
+
__Returns:__
|
841
|
+
|
842
|
+
[Array<Element>]
|
843
|
+
|
844
|
+
--
|
845
|
+
|
846
|
+
##### [ele_index](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L97)
|
847
|
+
|
848
|
+
> def ele_index tag_name, index
|
849
|
+
|
850
|
+
Get the element of type tag_name at matching index.
|
851
|
+
|
852
|
+
__Parameters:__
|
853
|
+
|
854
|
+
[String] tag_name - the tag name to find
|
855
|
+
|
856
|
+
[Integer] index - the index
|
857
|
+
|
858
|
+
__Returns:__
|
859
|
+
|
860
|
+
[Element] the found element of type tag_name
|
861
|
+
|
862
|
+
--
|
863
|
+
|
864
|
+
##### [find_eles](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L106)
|
865
|
+
|
866
|
+
> def find_eles tag_name
|
867
|
+
|
868
|
+
Get all elements exactly matching tag name
|
869
|
+
|
870
|
+
__Parameters:__
|
871
|
+
|
872
|
+
[String] tag_name - the tag name to find
|
873
|
+
|
874
|
+
__Returns:__
|
875
|
+
|
876
|
+
[Array<Element>] the found elements of type tag_name
|
877
|
+
|
878
|
+
--
|
879
|
+
|
880
|
+
##### [find_ele_by_text](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L114)
|
881
|
+
|
882
|
+
> def find_ele_by_text tag, text
|
883
|
+
|
884
|
+
Get the first tag that exactly matches tag and text.
|
885
|
+
|
886
|
+
__Parameters:__
|
887
|
+
|
888
|
+
[String] tag - the tag name to match
|
889
|
+
|
890
|
+
[String] text - the text to exactly match
|
891
|
+
|
892
|
+
__Returns:__
|
893
|
+
|
894
|
+
[Element] the element of type tag exactly matching text
|
895
|
+
|
896
|
+
--
|
897
|
+
|
898
|
+
##### [find_eles_by_text](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L122)
|
899
|
+
|
900
|
+
> def find_eles_by_text tag, text
|
901
|
+
|
902
|
+
Get all tags that exactly match tag and text.
|
903
|
+
|
904
|
+
__Parameters:__
|
905
|
+
|
906
|
+
[String] tag - the tag name to match
|
907
|
+
|
908
|
+
[String] text - the text to exactly match
|
909
|
+
|
910
|
+
__Returns:__
|
911
|
+
|
912
|
+
[Array<Element>] the elements of type tag exactly matching text
|
913
|
+
|
914
|
+
--
|
915
|
+
|
916
|
+
##### [find_ele_by_attr_include](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L131)
|
917
|
+
|
918
|
+
> def find_ele_by_attr_include tag, attr, value
|
919
|
+
|
920
|
+
Get the first tag by attribute that exactly matches value.
|
921
|
+
|
922
|
+
__Parameters:__
|
923
|
+
|
924
|
+
[String] tag - the tag name to match
|
925
|
+
|
926
|
+
[String] attr - the attribute to compare
|
927
|
+
|
928
|
+
[String] value - the value of the attribute that the element must include
|
929
|
+
|
930
|
+
__Returns:__
|
931
|
+
|
932
|
+
[Element] the element of type tag who's attribute includes value
|
933
|
+
|
934
|
+
--
|
935
|
+
|
936
|
+
##### [find_eles_by_attr_include](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L140)
|
937
|
+
|
938
|
+
> def find_eles_by_attr_include tag, attr, value
|
939
|
+
|
940
|
+
Get tags by attribute that include value.
|
941
|
+
|
942
|
+
__Parameters:__
|
943
|
+
|
944
|
+
[String] tag - the tag name to match
|
945
|
+
|
946
|
+
[String] attr - the attribute to compare
|
947
|
+
|
948
|
+
[String] value - the value of the attribute that the element must include
|
949
|
+
|
950
|
+
__Returns:__
|
951
|
+
|
952
|
+
[Array<Element>] the elements of type tag who's attribute includes value
|
953
|
+
|
954
|
+
--
|
955
|
+
|
956
|
+
##### [find_ele_by_text_include](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L149)
|
957
|
+
|
958
|
+
> def find_ele_by_text_include tag, text
|
959
|
+
|
960
|
+
Get the first tag that includes text.
|
961
|
+
element.attribute(:text).include? text
|
962
|
+
|
963
|
+
__Parameters:__
|
964
|
+
|
965
|
+
[String] tag - the tag name to match
|
966
|
+
|
967
|
+
[String] text - the text the element must include
|
968
|
+
|
969
|
+
__Returns:__
|
970
|
+
|
971
|
+
[Element] the element of type tag that includes text
|
972
|
+
|
973
|
+
--
|
974
|
+
|
975
|
+
##### [find_eles_by_text_include](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L158)
|
976
|
+
|
977
|
+
> def find_eles_by_text_include tag, text
|
978
|
+
|
979
|
+
Get the tags that include text.
|
980
|
+
element.attribute(:text).include? text
|
981
|
+
|
982
|
+
__Parameters:__
|
983
|
+
|
984
|
+
[String] tag - the tag name to match
|
985
|
+
|
986
|
+
[String] text - the text the element must include
|
987
|
+
|
988
|
+
__Returns:__
|
989
|
+
|
990
|
+
[Array<Element>] the elements of type tag that includes text
|
991
|
+
|
992
|
+
--
|
993
|
+
|
994
|
+
##### [first_ele](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L165)
|
995
|
+
|
996
|
+
> def first_ele tag_name
|
997
|
+
|
998
|
+
Get the first tag that matches tag_name
|
999
|
+
|
1000
|
+
__Parameters:__
|
1001
|
+
|
1002
|
+
[String] tag_name - the tag to match
|
1003
|
+
|
1004
|
+
__Returns:__
|
1005
|
+
|
1006
|
+
[Element]
|
1007
|
+
|
1008
|
+
--
|
1009
|
+
|
1010
|
+
##### [last_ele](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L173)
|
1011
|
+
|
1012
|
+
> def last_ele tag_name
|
1013
|
+
|
1014
|
+
Get the last tag that matches tag_name
|
1015
|
+
|
1016
|
+
__Parameters:__
|
1017
|
+
|
1018
|
+
[String] tag_name - the tag to match
|
1019
|
+
|
1020
|
+
__Returns:__
|
1021
|
+
|
1022
|
+
[Element]
|
1023
|
+
|
1024
|
+
--
|
1025
|
+
|
1026
|
+
##### [source](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L179)
|
1027
|
+
|
1028
|
+
> def source
|
1029
|
+
|
1030
|
+
Prints a JSON view of the current page
|
1031
|
+
|
1032
|
+
__Returns:__
|
1033
|
+
|
1034
|
+
[void]
|
1035
|
+
|
1036
|
+
--
|
1037
|
+
|
1038
|
+
##### [get_source](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L185)
|
1039
|
+
|
1040
|
+
> def get_source
|
1041
|
+
|
1042
|
+
Gets a JSON view of the current page
|
1043
|
+
|
1044
|
+
__Returns:__
|
1045
|
+
|
1046
|
+
[JSON]
|
1047
|
+
|
1048
|
+
--
|
1049
|
+
|
1050
|
+
##### [find_name](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L194)
|
1051
|
+
|
1052
|
+
> def find_name name
|
1053
|
+
|
1054
|
+
Returns the first element that exactly matches name
|
1055
|
+
|
1056
|
+
__Parameters:__
|
1057
|
+
|
1058
|
+
[String] name - the name to exactly match
|
1059
|
+
|
1060
|
+
__Returns:__
|
1061
|
+
|
1062
|
+
[Element]
|
1063
|
+
|
1064
|
+
--
|
1065
|
+
|
1066
|
+
##### [find_names](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L202)
|
1067
|
+
|
1068
|
+
> def find_names name
|
1069
|
+
|
1070
|
+
Returns all elements that exactly match name
|
1071
|
+
|
1072
|
+
__Parameters:__
|
1073
|
+
|
1074
|
+
[String] name - the name to exactly match
|
1075
|
+
|
1076
|
+
__Returns:__
|
1077
|
+
|
1078
|
+
[Array<Element>]
|
1079
|
+
|
1080
|
+
--
|
1081
|
+
|
1082
|
+
##### [tag](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L210)
|
1083
|
+
|
1084
|
+
> def tag tag_name
|
1085
|
+
|
1086
|
+
Returns the first element matching tag_name
|
1087
|
+
|
1088
|
+
__Parameters:__
|
1089
|
+
|
1090
|
+
[String] tag_name - the tag_name to search for
|
1091
|
+
|
1092
|
+
__Returns:__
|
1093
|
+
|
1094
|
+
[Element]
|
1095
|
+
|
1096
|
+
--
|
1097
|
+
|
1098
|
+
##### [tags](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L218)
|
1099
|
+
|
1100
|
+
> def tags tag_name
|
1101
|
+
|
1102
|
+
Returns all elements matching tag_name
|
1103
|
+
|
1104
|
+
__Parameters:__
|
1105
|
+
|
1106
|
+
[String] tag_name - the tag_name to search for
|
1107
|
+
|
1108
|
+
__Returns:__
|
1109
|
+
|
1110
|
+
[Element]
|
1111
|
+
|
1112
|
+
--
|
1113
|
+
|
1114
|
+
##### [px_to_window_rel](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L228)
|
1115
|
+
|
1116
|
+
> def px_to_window_rel opts={}
|
1117
|
+
|
1118
|
+
Converts pixel values to window relative values
|
1119
|
+
|
1120
|
+
```ruby
|
1121
|
+
px_to_window_rel x: 50, y: 150
|
1122
|
+
```
|
1123
|
+
|
1124
|
+
--
|
1125
|
+
|
1126
|
+
##### [lazy_load_strings](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L238)
|
1127
|
+
|
1128
|
+
> def lazy_load_strings
|
1129
|
+
|
1130
|
+
|
1131
|
+
|
1132
|
+
--
|
1133
|
+
|
1134
|
+
##### [xml_keys](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L245)
|
1135
|
+
|
1136
|
+
> def xml_keys target
|
1137
|
+
|
1138
|
+
Search strings.xml's values for target.
|
1139
|
+
|
1140
|
+
__Parameters:__
|
1141
|
+
|
1142
|
+
[String] target - the target to search for in strings.xml values
|
1143
|
+
|
1144
|
+
__Returns:__
|
1145
|
+
|
1146
|
+
[Array]
|
1147
|
+
|
1148
|
+
--
|
1149
|
+
|
1150
|
+
##### [xml_values](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L253)
|
1151
|
+
|
1152
|
+
> def xml_values target
|
1153
|
+
|
1154
|
+
Search strings.xml's keys for target.
|
1155
|
+
|
1156
|
+
__Parameters:__
|
1157
|
+
|
1158
|
+
[String] target - the target to search for in strings.xml keys
|
1159
|
+
|
1160
|
+
__Returns:__
|
1161
|
+
|
1162
|
+
[Array]
|
1163
|
+
|
1164
|
+
--
|
1165
|
+
|
1166
|
+
##### [resolve_id](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L261)
|
1167
|
+
|
1168
|
+
> def resolve_id id
|
1169
|
+
|
1170
|
+
Resolve id in strings.xml and return the value.
|
1171
|
+
|
1172
|
+
__Parameters:__
|
1173
|
+
|
1174
|
+
[String] id - the id to resolve
|
1175
|
+
|
1176
|
+
__Returns:__
|
1177
|
+
|
1178
|
+
[String]
|
1179
|
+
|
1180
|
+
--
|
1181
|
+
|
1182
|
+
##### [raise_no_element_error](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/helper.rb#L267)
|
1183
|
+
|
1184
|
+
> def raise_no_element_error
|
1185
|
+
|
1186
|
+
Used to error when finding a single element fails.
|
1187
|
+
|
1188
|
+
--
|
1189
|
+
|
1190
|
+
##### [value](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/patch.rb#L32)
|
1191
|
+
|
1192
|
+
> def value
|
1193
|
+
|
1194
|
+
Returns the value attribute
|
1195
|
+
|
1196
|
+
Fixes NoMethodError: undefined method `value' for Selenium::WebDriver::Element
|
1197
|
+
|
1198
|
+
--
|
1199
|
+
|
1200
|
+
##### [name](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/patch.rb#L39)
|
1201
|
+
|
1202
|
+
> def name
|
1203
|
+
|
1204
|
+
Returns the name attribute
|
1205
|
+
|
1206
|
+
Fixes NoMethodError: undefined method `name' for Selenium::WebDriver::Element
|
1207
|
+
|
1208
|
+
--
|
1209
|
+
|
1210
|
+
##### [tag_name](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/patch.rb#L46)
|
1211
|
+
|
1212
|
+
> def tag_name
|
1213
|
+
|
1214
|
+
Returns the type attribute
|
1215
|
+
|
1216
|
+
Fixes Selenium::WebDriver::Error::UnknownError: Not yet implemented
|
1217
|
+
|
1218
|
+
--
|
1219
|
+
|
1220
|
+
##### [location_rel](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/common/patch.rb#L58)
|
1221
|
+
|
1222
|
+
> def location_rel
|
1223
|
+
|
1224
|
+
For use with mobile tap.
|
1225
|
+
|
1226
|
+
```ruby
|
1227
|
+
execute_script 'mobile: tap', :x => 0.0, :y => 0.98
|
1228
|
+
```
|
1229
|
+
|
1230
|
+
https://github.com/appium/appium/wiki/Automating-mobile-gestures
|
1231
|
+
|
1232
|
+
__Returns:__
|
1233
|
+
|
1234
|
+
[OpenStruct] the relative x, y in a struct. ex: { x: 0.50, y: 0.20 }
|
1235
|
+
|
1236
|
+
--
|
1237
|
+
|
1238
|
+
##### [CORE](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L16)
|
1239
|
+
|
1240
|
+
> CORE = [ :array, :hash, :class, :file, :dir, :bigdecimal, :rational, :struct, :openstruct, :method, :unboundmethod ]
|
1241
|
+
|
1242
|
+
|
1243
|
+
|
1244
|
+
--
|
1245
|
+
|
1246
|
+
##### [awesome_openstruct](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L18)
|
1247
|
+
|
1248
|
+
> def awesome_openstruct target
|
1249
|
+
|
1250
|
+
|
1251
|
+
|
1252
|
+
--
|
1253
|
+
|
1254
|
+
##### [load_appium_txt](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L28)
|
1255
|
+
|
1256
|
+
> def load_appium_txt opts
|
1257
|
+
|
1258
|
+
Load appium.txt (toml format) into system ENV
|
1259
|
+
the basedir of this file + appium.txt is what's used
|
1260
|
+
|
1261
|
+
__Parameters:__
|
1262
|
+
|
1263
|
+
[Hash] opts - file: '/path/to/appium.txt', verbose: true
|
1264
|
+
|
1265
|
+
__Returns:__
|
1266
|
+
|
1267
|
+
[Array<String>] the require files. nil if require doesn't exist
|
1268
|
+
|
1269
|
+
--
|
1270
|
+
|
1271
|
+
##### [promote_singleton_appium_methods](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L154)
|
1272
|
+
|
1273
|
+
> def self.promote_singleton_appium_methods main_module
|
1274
|
+
|
1275
|
+
|
1276
|
+
|
1277
|
+
--
|
1278
|
+
|
1279
|
+
##### [promote_appium_methods](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L184)
|
1280
|
+
|
1281
|
+
> def self.promote_appium_methods class_array
|
1282
|
+
|
1283
|
+
Promote appium methods to class instance methods
|
1284
|
+
|
1285
|
+
To promote methods to all classes:
|
1286
|
+
|
1287
|
+
```ruby
|
1288
|
+
Appium.promote_appium_methods Object
|
1289
|
+
```
|
1290
|
+
|
1291
|
+
__Parameters:__
|
1292
|
+
|
1293
|
+
[Array<Class>] class_array - An array of classes
|
1294
|
+
|
1295
|
+
--
|
1296
|
+
|
1297
|
+
##### [default_wait](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L538)
|
1298
|
+
|
1299
|
+
> def default_wait
|
1300
|
+
|
1301
|
+
Returns the default client side wait.
|
1302
|
+
This value is independent of what the server is using
|
1303
|
+
|
1304
|
+
__Returns:__
|
1305
|
+
|
1306
|
+
[Integer]
|
1307
|
+
|
1308
|
+
--
|
1309
|
+
|
1310
|
+
##### [app_path](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L213)
|
1311
|
+
|
1312
|
+
> def app_path
|
1313
|
+
|
1314
|
+
Returns the value of attribute app_path
|
1315
|
+
|
1316
|
+
--
|
1317
|
+
|
1318
|
+
##### [app_name](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L213)
|
1319
|
+
|
1320
|
+
> def app_name
|
1321
|
+
|
1322
|
+
Returns the value of attribute app_name
|
1323
|
+
|
1324
|
+
--
|
1325
|
+
|
1326
|
+
##### [device](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L213)
|
1327
|
+
|
1328
|
+
> def device
|
1329
|
+
|
1330
|
+
Returns the value of attribute device
|
1331
|
+
|
1332
|
+
--
|
1333
|
+
|
1334
|
+
##### [app_package](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L213)
|
1335
|
+
|
1336
|
+
> def app_package
|
1337
|
+
|
1338
|
+
Returns the value of attribute app_package
|
1339
|
+
|
1340
|
+
--
|
1341
|
+
|
1342
|
+
##### [app_activity](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L213)
|
1343
|
+
|
1344
|
+
> def app_activity
|
1345
|
+
|
1346
|
+
Returns the value of attribute app_activity
|
1347
|
+
|
1348
|
+
--
|
1349
|
+
|
1350
|
+
##### [app_wait_activity](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L213)
|
1351
|
+
|
1352
|
+
> def app_wait_activity
|
1353
|
+
|
1354
|
+
Returns the value of attribute app_wait_activity
|
1355
|
+
|
1356
|
+
--
|
1357
|
+
|
1358
|
+
##### [sauce_username](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L213)
|
1359
|
+
|
1360
|
+
> def sauce_username
|
1361
|
+
|
1362
|
+
Returns the value of attribute sauce_username
|
1363
|
+
|
1364
|
+
--
|
1365
|
+
|
1366
|
+
##### [sauce_access_key](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L213)
|
1367
|
+
|
1368
|
+
> def sauce_access_key
|
1369
|
+
|
1370
|
+
Returns the value of attribute sauce_access_key
|
1371
|
+
|
1372
|
+
--
|
1373
|
+
|
1374
|
+
##### [port](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L213)
|
1375
|
+
|
1376
|
+
> def port
|
1377
|
+
|
1378
|
+
Returns the value of attribute port
|
1379
|
+
|
1380
|
+
--
|
1381
|
+
|
1382
|
+
##### [debug](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L213)
|
1383
|
+
|
1384
|
+
> def debug
|
1385
|
+
|
1386
|
+
Returns the value of attribute debug
|
1387
|
+
|
1388
|
+
--
|
1389
|
+
|
1390
|
+
##### [export_session](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L213)
|
1391
|
+
|
1392
|
+
> def export_session
|
1393
|
+
|
1394
|
+
Returns the value of attribute export_session
|
1395
|
+
|
1396
|
+
--
|
1397
|
+
|
1398
|
+
##### [device_cap](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L213)
|
1399
|
+
|
1400
|
+
> def device_cap
|
1401
|
+
|
1402
|
+
Returns the value of attribute device_cap
|
1403
|
+
|
1404
|
+
--
|
1405
|
+
|
1406
|
+
##### [compress_xml](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L213)
|
1407
|
+
|
1408
|
+
> def compress_xml
|
1409
|
+
|
1410
|
+
Returns the value of attribute compress_xml
|
1411
|
+
|
1412
|
+
--
|
1413
|
+
|
1414
|
+
##### [custom_url](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L213)
|
1415
|
+
|
1416
|
+
> def custom_url
|
1417
|
+
|
1418
|
+
Returns the value of attribute custom_url
|
1419
|
+
|
1420
|
+
--
|
1421
|
+
|
1422
|
+
##### [global_webdriver_http_sleep](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L219)
|
1423
|
+
|
1424
|
+
> def global_webdriver_http_sleep
|
1425
|
+
|
1426
|
+
The amount to sleep in seconds before every webdriver http call.
|
1427
|
+
|
1428
|
+
--
|
1429
|
+
|
1430
|
+
##### [global_webdriver_http_sleep=](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L219)
|
1431
|
+
|
1432
|
+
> def global_webdriver_http_sleep=(value)
|
1433
|
+
|
1434
|
+
The amount to sleep in seconds before every webdriver http call.
|
1435
|
+
|
1436
|
+
--
|
1437
|
+
|
1438
|
+
##### [initialize](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L249)
|
1439
|
+
|
1440
|
+
> def initialize opts={}
|
1441
|
+
|
1442
|
+
Creates a new driver.
|
1443
|
+
:device is :android, :ios, or :selendroid
|
1444
|
+
|
1445
|
+
```ruby
|
1446
|
+
# Options include:
|
1447
|
+
:app_path, :app_name, :app_package, :app_activity,
|
1448
|
+
:app_wait_activity, :sauce_username, :sauce_access_key,
|
1449
|
+
:port, :os, :debug
|
1450
|
+
|
1451
|
+
require 'rubygems'
|
1452
|
+
require 'appium_lib'
|
1453
|
+
|
1454
|
+
# Start iOS driver
|
1455
|
+
app = { device: :ios, app_path: '/path/to/MyiOS.app'}
|
1456
|
+
Appium::Driver.new(app).start_driver
|
1457
|
+
|
1458
|
+
# Start Android driver
|
1459
|
+
apk = { device: :android
|
1460
|
+
app_path: '/path/to/the.apk',
|
1461
|
+
app_package: 'com.example.pkg',
|
1462
|
+
app_activity: 'act.Start',
|
1463
|
+
app_wait_activity: 'act.Start'
|
1464
|
+
}
|
1465
|
+
|
1466
|
+
Appium::Driver.new(apk).start_driver
|
1467
|
+
```
|
1468
|
+
|
1469
|
+
__Parameters:__
|
1470
|
+
|
1471
|
+
[Object] opts - A hash containing various options.
|
1472
|
+
|
1473
|
+
__Returns:__
|
1474
|
+
|
1475
|
+
[Driver]
|
1476
|
+
|
1477
|
+
--
|
1478
|
+
|
1479
|
+
##### [status](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L357)
|
1480
|
+
|
1481
|
+
> def status
|
1482
|
+
|
1483
|
+
Returns the status payload
|
1484
|
+
|
1485
|
+
```ruby
|
1486
|
+
{"status"=>0,
|
1487
|
+
"value"=>
|
1488
|
+
{"build"=>
|
1489
|
+
{"version"=>"0.8.2",
|
1490
|
+
"revision"=>"f2a2bc3782e4b0370d97a097d7e04913cf008995"}},
|
1491
|
+
"sessionId"=>"8f4b34a7-a9a9-4ac5-b125-36258143446a"}
|
1492
|
+
```
|
1493
|
+
|
1494
|
+
Discover the Appium rev running on the server.
|
1495
|
+
|
1496
|
+
`status["value"]["build"]["revision"]`
|
1497
|
+
`f2a2bc3782e4b0370d97a097d7e04913cf008995`
|
1498
|
+
|
1499
|
+
__Returns:__
|
1500
|
+
|
1501
|
+
[JSON]
|
1502
|
+
|
1503
|
+
--
|
1504
|
+
|
1505
|
+
##### [server_version](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L363)
|
1506
|
+
|
1507
|
+
> def server_version
|
1508
|
+
|
1509
|
+
Returns the server's version string
|
1510
|
+
|
1511
|
+
__Returns:__
|
1512
|
+
|
1513
|
+
[String]
|
1514
|
+
|
1515
|
+
--
|
1516
|
+
|
1517
|
+
##### [absolute_app_path](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L404)
|
1518
|
+
|
1519
|
+
> def absolute_app_path
|
1520
|
+
|
1521
|
+
Converts environment variable APP_PATH to an absolute path.
|
1522
|
+
|
1523
|
+
__Returns:__
|
1524
|
+
|
1525
|
+
[String] APP_PATH as an absolute path
|
1526
|
+
|
1527
|
+
--
|
1528
|
+
|
1529
|
+
##### [server_url](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L424)
|
1530
|
+
|
1531
|
+
> def server_url
|
1532
|
+
|
1533
|
+
Get the server url for sauce or local based on env vars.
|
1534
|
+
|
1535
|
+
__Returns:__
|
1536
|
+
|
1537
|
+
[String] the server url
|
1538
|
+
|
1539
|
+
--
|
1540
|
+
|
1541
|
+
##### [restart](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L435)
|
1542
|
+
|
1543
|
+
> def restart
|
1544
|
+
|
1545
|
+
Restarts the driver
|
1546
|
+
|
1547
|
+
__Returns:__
|
1548
|
+
|
1549
|
+
[Driver] the driver
|
1550
|
+
|
1551
|
+
--
|
1552
|
+
|
1553
|
+
##### [driver](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L442)
|
1554
|
+
|
1555
|
+
> def driver
|
1556
|
+
|
1557
|
+
Returns the driver
|
1558
|
+
|
1559
|
+
__Returns:__
|
1560
|
+
|
1561
|
+
[Driver] the driver
|
1562
|
+
|
1563
|
+
--
|
1564
|
+
|
1565
|
+
##### [screenshot](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L452)
|
1566
|
+
|
1567
|
+
> def screenshot png_save_path
|
1568
|
+
|
1569
|
+
Takes a png screenshot and saves to the target path.
|
1570
|
+
|
1571
|
+
Example: screenshot '/tmp/hi.png'
|
1572
|
+
|
1573
|
+
__Parameters:__
|
1574
|
+
|
1575
|
+
[String] png_save_path - the full path to save the png
|
1576
|
+
|
1577
|
+
__Returns:__
|
1578
|
+
|
1579
|
+
[nil]
|
1580
|
+
|
1581
|
+
--
|
1582
|
+
|
1583
|
+
##### [driver_quit](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L459)
|
1584
|
+
|
1585
|
+
> def driver_quit
|
1586
|
+
|
1587
|
+
Quits the driver
|
1588
|
+
|
1589
|
+
__Returns:__
|
1590
|
+
|
1591
|
+
[void]
|
1592
|
+
|
1593
|
+
--
|
1594
|
+
|
1595
|
+
##### [start_driver](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L467)
|
1596
|
+
|
1597
|
+
> def start_driver
|
1598
|
+
|
1599
|
+
Creates a new global driver and quits the old one if it exists.
|
1600
|
+
|
1601
|
+
__Returns:__
|
1602
|
+
|
1603
|
+
[Selenium::WebDriver] the new global driver
|
1604
|
+
|
1605
|
+
--
|
1606
|
+
|
1607
|
+
##### [no_wait](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L501)
|
1608
|
+
|
1609
|
+
> def no_wait
|
1610
|
+
|
1611
|
+
Set implicit wait and default_wait to zero.
|
1612
|
+
|
1613
|
+
--
|
1614
|
+
|
1615
|
+
##### [set_wait](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L520)
|
1616
|
+
|
1617
|
+
> def set_wait timeout=nil
|
1618
|
+
|
1619
|
+
Set implicit wait and default_wait to timeout, defaults to 30.
|
1620
|
+
if set_wait is called without a param then the second to last
|
1621
|
+
wait will be used.
|
1622
|
+
|
1623
|
+
```ruby`
|
1624
|
+
set_wait 2
|
1625
|
+
set_wait 3
|
1626
|
+
set_wait # 2
|
1627
|
+
|
1628
|
+
````
|
1629
|
+
|
1630
|
+
__Parameters:__
|
1631
|
+
|
1632
|
+
[Integer] timeout - the timeout in seconds
|
1633
|
+
|
1634
|
+
__Returns:__
|
1635
|
+
|
1636
|
+
[void]
|
1637
|
+
|
1638
|
+
--
|
1639
|
+
|
1640
|
+
##### [exists](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L554)
|
1641
|
+
|
1642
|
+
> def exists pre_check=0, post_check=@default_wait, &search_block
|
1643
|
+
|
1644
|
+
Returns existence of element.
|
1645
|
+
|
1646
|
+
Example:
|
1647
|
+
|
1648
|
+
exists { button('sign in') } ? puts('true') : puts('false')
|
1649
|
+
|
1650
|
+
__Parameters:__
|
1651
|
+
|
1652
|
+
[Integer] pre_check - the amount in seconds to set the
|
1653
|
+
wait to before checking existance
|
1654
|
+
|
1655
|
+
[Integer] post_check - the amount in seconds to set the
|
1656
|
+
wait to after checking existance
|
1657
|
+
|
1658
|
+
[Block] search_block - the block to call
|
1659
|
+
|
1660
|
+
__Returns:__
|
1661
|
+
|
1662
|
+
[Boolean]
|
1663
|
+
|
1664
|
+
--
|
1665
|
+
|
1666
|
+
##### [execute_script](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L578)
|
1667
|
+
|
1668
|
+
> def execute_script script, *args
|
1669
|
+
|
1670
|
+
The same as @driver.execute_script
|
1671
|
+
|
1672
|
+
__Parameters:__
|
1673
|
+
|
1674
|
+
[String] script - the script to execute
|
1675
|
+
|
1676
|
+
[*args] args - the args to pass to the script
|
1677
|
+
|
1678
|
+
__Returns:__
|
1679
|
+
|
1680
|
+
[Object]
|
1681
|
+
|
1682
|
+
--
|
1683
|
+
|
1684
|
+
##### [mobile](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L594)
|
1685
|
+
|
1686
|
+
> def mobile method, *args
|
1687
|
+
|
1688
|
+
Helper method for mobile gestures
|
1689
|
+
|
1690
|
+
https://github.com/appium/appium/wiki/Automating-mobile-gestures
|
1691
|
+
|
1692
|
+
driver.execute_script 'mobile: swipe', endX: 100, endY: 100, duration: 0.01
|
1693
|
+
|
1694
|
+
becomes
|
1695
|
+
|
1696
|
+
mobile :swipe, endX: 100, endY: 100, duration: 0.01
|
1697
|
+
|
1698
|
+
__Parameters:__
|
1699
|
+
|
1700
|
+
[String, Symbol] method - the method to execute
|
1701
|
+
|
1702
|
+
[*args] args - the args to pass to the method
|
1703
|
+
|
1704
|
+
__Returns:__
|
1705
|
+
|
1706
|
+
[Object]
|
1707
|
+
|
1708
|
+
--
|
1709
|
+
|
1710
|
+
##### [find_elements](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L605)
|
1711
|
+
|
1712
|
+
> def find_elements *args
|
1713
|
+
|
1714
|
+
Calls @driver.find_elements
|
1715
|
+
|
1716
|
+
__Parameters:__
|
1717
|
+
|
1718
|
+
[*args] args - the args to use
|
1719
|
+
|
1720
|
+
__Returns:__
|
1721
|
+
|
1722
|
+
[Array<Element>] Array is empty when no elements are found.
|
1723
|
+
|
1724
|
+
--
|
1725
|
+
|
1726
|
+
##### [find_element](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L613)
|
1727
|
+
|
1728
|
+
> def find_element *args
|
1729
|
+
|
1730
|
+
Calls @driver.find_elements
|
1731
|
+
|
1732
|
+
__Parameters:__
|
1733
|
+
|
1734
|
+
[*args] args - the args to use
|
1735
|
+
|
1736
|
+
__Returns:__
|
1737
|
+
|
1738
|
+
[Element]
|
1739
|
+
|
1740
|
+
--
|
1741
|
+
|
1742
|
+
##### [x](https://github.com/appium/ruby_lib/blob/fe6057045fd4d9ee1eb77ec57108755b4d445592/lib/appium_lib/driver.rb#L620)
|
1743
|
+
|
1744
|
+
> def x
|
1745
|
+
|
1746
|
+
Quit the driver and Pry.
|
1747
|
+
quit and exit are reserved by Pry.
|
1748
|
+
|
1749
|
+
__Returns:__
|
1750
|
+
|
1751
|
+
[void]
|
1752
|
+
|
1753
|
+
--
|
1754
|
+
|