Class: Watir::Container::TextField
Constant Summary
Constants inherited
from HtmlElement
HtmlElement::OPERATIONS
Instance Attribute Summary
Attributes inherited from HtmlElement
#how, #what
Instance Method Summary
collapse
#by_value, #enabled?, #speak, #tag
Methods included from Clickable
#click
Methods inherited from HtmlElement
#exists?, #name, #operate, #speak, #tag
Instance Method Details
#getContents ⇒ Object
393
394
395
|
# File 'lib/safariwatir.rb', line 393
def getContents
@scripter.get_value_for(self)
end
|
#set(value) ⇒ Object
381
382
383
384
385
386
387
388
389
390
391
|
# File 'lib/safariwatir.rb', line 381
def set(value)
value = value.to_s
@scripter.focus(self)
@scripter.highlight(self) do
clear_text_input
value.length.times do |i|
append_text_input(value[i, 1])
end
end
@scripter.blur(self)
end
|
#verify_contains(expected) ⇒ Object
397
398
399
400
401
402
403
404
405
|
# File 'lib/safariwatir.rb', line 397
def verify_contains(expected)
actual = getContents
case expected
when Regexp
actual.match(expected) != nil
else
expected == actual
end
end
|