Text Input Elements
Overview
Text Inputs include:
Watir::TextField
and
Watir::TextArea
.
Note that any Input
element that does not define a type
attribute is
considered to be a TextField
.
These are accessed by calling Browser#text_field
or Browser#textarea
, respectively.
Creating a TextFieldCollection
is accomplished with Browser#text_fields
,
and creating a TextareaCollection
is accomplished with Browser#textareas
,
For all of the different ways of locating a TextField
or TextArea
element,
take a look at our Locating Elements Guide.
They also inherit methods from standard Web Elements
Common or Special Methods
The first 3 are defined in Watir::UserEditable
module
Standard Setter Interface
TextField#set
and TextArea#set
take a String
argument.
Watir clears the field, then sends the provided keys to the element.
Example
WYSIWYG Editors
Most WYSIWYG Editors function by setting non-input elements to editable with
the attribute content-editable
. See WYSIWYG Editors page for more information.