Browse the docs

Focus a field or element

Moves focus to an element, and can select its text.

Focus selector

Details #

Focuses the element. With select the text in a field is selected too.

Parameters #

ParameterTypeRequiredValuesWhat it does
selectortextYesRequired.
browserone ofsafari chrome front
selectyes / noSelect the field's text.
tabany value
timeoutnumber, tab.

Every step also accepts label, onFailure, timeout and dryRunSafe.

Examples #

Focus the search box
Do
  1. Focus “input[type=search]”
Open in Switchboard to try it