Module: Watir::Container
Defined Under Namespace
Modules: Clickable
Classes: AlertWindow, Button, Checkbox, ContentElement, Div, Form, Frame, HtmlElement, Image, InputElement, Label, Link, Option, P, Password, Radio, SecurityWarningWindow, SelectList, Span, Table, TableCell, TableRow, TextField
Constant Summary
collapse
- DEFAULT_TYPING_LAG =
0.08
Instance Method Summary
collapse
-
#button(how, what) ⇒ Object
-
#cell(how, what) ⇒ Object
-
#checkbox(how, what, value = nil) ⇒ Object
-
#contains_text(what) ⇒ Object
-
#div(how, what) ⇒ Object
-
#form(how, what) ⇒ Object
-
#frame(name) ⇒ Object
-
#image(how, what) ⇒ Object
-
#label(how, what) ⇒ Object
-
#link(how, what) ⇒ Object
-
#p(how, what) ⇒ Object
-
#password(how, what) ⇒ Object
-
#radio(how, what, value = nil) ⇒ Object
-
#row(how, what) ⇒ Object
-
#select_list(how, what) ⇒ Object
-
#set_fast_speed ⇒ Object
-
#set_slow_speed ⇒ Object
-
#span(how, what) ⇒ Object
-
#speed=(how_fast) ⇒ Object
-
#table(how, what) ⇒ Object
-
#text_field(how, what) ⇒ Object
Instance Method Details
414
415
416
|
# File 'lib/safariwatir.rb', line 414
def button(how, what)
Button.new(scripter, how, what)
end
|
#cell(how, what) ⇒ Object
418
419
420
|
# File 'lib/safariwatir.rb', line 418
def cell(how, what)
TableCell.new(scripter, how, what)
end
|
#checkbox(how, what, value = nil) ⇒ Object
422
423
424
|
# File 'lib/safariwatir.rb', line 422
def checkbox(how, what, value = nil)
Checkbox.new(scripter, how, what, value)
end
|
#contains_text(what) ⇒ Object
482
483
484
485
486
487
488
489
490
491
|
# File 'lib/safariwatir.rb', line 482
def contains_text(what)
case what
when Regexp
text =~ what
when String
text.index(what)
else
raise MissingWayOfFindingObjectException
end
end
|
#div(how, what) ⇒ Object
426
427
428
|
# File 'lib/safariwatir.rb', line 426
def div(how, what)
Div.new(scripter, how, what)
end
|
434
435
436
|
# File 'lib/safariwatir.rb', line 434
def form(how, what)
Form.new(scripter, how, what)
end
|
#frame(name) ⇒ Object
438
439
440
|
# File 'lib/safariwatir.rb', line 438
def frame(name)
Frame.new(scripter, name)
end
|
#image(how, what) ⇒ Object
442
443
444
|
# File 'lib/safariwatir.rb', line 442
def image(how, what)
Image.new(scripter, how, what)
end
|
#label(how, what) ⇒ Object
446
447
448
|
# File 'lib/safariwatir.rb', line 446
def label(how, what)
Label.new(scripter, how, what)
end
|
#link(how, what) ⇒ Object
450
451
452
|
# File 'lib/safariwatir.rb', line 450
def link(how, what)
Link.new(scripter, how, what)
end
|
#p(how, what) ⇒ Object
430
431
432
|
# File 'lib/safariwatir.rb', line 430
def p(how, what)
P.new(scripter, how, what)
end
|
#password(how, what) ⇒ Object
454
455
456
|
# File 'lib/safariwatir.rb', line 454
def password(how, what)
Password.new(scripter, how, what)
end
|
#radio(how, what, value = nil) ⇒ Object
458
459
460
|
# File 'lib/safariwatir.rb', line 458
def radio(how, what, value = nil)
Radio.new(scripter, how, what, value)
end
|
#row(how, what) ⇒ Object
462
463
464
|
# File 'lib/safariwatir.rb', line 462
def row(how, what)
TableRow.new(scripter, how, what)
end
|
#select_list(how, what) ⇒ Object
466
467
468
|
# File 'lib/safariwatir.rb', line 466
def select_list(how, what)
SelectList.new(scripter, how, what)
end
|
#set_fast_speed ⇒ Object
28
29
30
|
# File 'lib/safariwatir.rb', line 28
def set_fast_speed
@scripter.typing_lag = 0
end
|
#set_slow_speed ⇒ Object
32
33
34
|
# File 'lib/safariwatir.rb', line 32
def set_slow_speed
@scripter.typing_lag = DEFAULT_TYPING_LAG
end
|
#span(how, what) ⇒ Object
470
471
472
|
# File 'lib/safariwatir.rb', line 470
def span(how, what)
Span.new(scripter, how, what)
end
|
#speed=(how_fast) ⇒ Object
36
37
38
39
40
41
42
43
|
# File 'lib/safariwatir.rb', line 36
def speed=(how_fast)
case how_fast
when :fast then set_fast_speed
when :slow then set_slow_speed
else
raise ArgumentError, "Invalid speed: #{how_fast}"
end
end
|
#table(how, what) ⇒ Object
474
475
476
|
# File 'lib/safariwatir.rb', line 474
def table(how, what)
Table.new(scripter, how, what)
end
|
#text_field(how, what) ⇒ Object
478
479
480
|
# File 'lib/safariwatir.rb', line 478
def text_field(how, what)
TextField.new(scripter, how, what)
end
|