Taiko
Documentation

Home / API Reference

focus

Fetches an element with the given selector and focuses it. If there's no element matching selector, the method throws an error.

Examples

await focus(textBox('Username:'))

Parameters


selector

A selector of an element to focus. If there are multiple elements satisfying the selector, the first will be focused.


options

options.waitForEvents

Events available to wait for ['DOMContentLoaded', 'loadEventFired', 'networkAlmostIdle', 'networkIdle', 'firstPaint', 'firstContentfulPaint', 'firstMeaningfulPaint']

Default value
['firstMeaningfulPaint']

Returns

This API does not return any values