I.fill

Fill an input field.

Note

Can be used on date picker fields that accept direct text input.

Usage

I.fill(field, value)
Parameter Type Remarks
field string Keyword to identify the field.
Not case-sensitive.

The associated label, aria-label, placeholder, adjacent text, and current value can be used to identify a field.
CSS and XPATH selectors can also be used, but is not recommended as it makes the tests harder to keep up to date.
value string
Value to fill into the field.

# Using field label

You can use the field's <label>, aria-label, placeholder, value, name, and nearby text to identify the field.

I.fill("Email", "bruce@waynecorp.com");

This command fills "bruce@waynecorp.com" into field idenfied as "Email".

# Using field CSS / XPATH

You can also use CSS and XPATH to identify the field.

I.fill(".input-email", "bruce@waynecorp.com");

This command fills "bruce@waynecorp.com" into the input field with the CSS class input-email.

Use sparingly.
Use hard selectors like CSS / XPATH sparingly because it makes your tests fragile and harder to read and maintain.