# `Playwright.Locator`
[🔗](https://github.com/ftes/playwright_ex/blob/v1.65.0-rc.3/lib/playwright/api/locator.ex#L7)

Locators are the central piece of Playwright's auto-waiting and retry-ability. In a nutshell, locators represent
a way to find element(s) on the page at any moment. A locator can be created with the `Playwright.Page.locator/3` method.

[Learn more about locators](https://playwright.dev/docs/locators).

*Since Playwright 1.14.*

The examples alias the modules they use (`alias Playwright.{Locator, Page}`).

# `aria_snapshot_json_options`

```elixir
@type aria_snapshot_json_options() ::
  [
    boxes: boolean(),
    depth: integer(),
    mode: :ai | :default,
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:boxes) =&gt; boolean(),
      optional(:depth) =&gt; integer(),
      optional(:mode) =&gt; :ai | :default,
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `aria_snapshot_json/2`, see its docs.

# `aria_snapshot_options`

```elixir
@type aria_snapshot_options() ::
  [
    boxes: boolean(),
    depth: integer(),
    mode: :ai | :default,
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:boxes) =&gt; boolean(),
      optional(:depth) =&gt; integer(),
      optional(:mode) =&gt; :ai | :default,
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `aria_snapshot/2`, see its docs.

# `blur_options`

```elixir
@type blur_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `blur/2`, see its docs.

# `bounding_box_options`

```elixir
@type bounding_box_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `bounding_box/2`, see its docs.

# `check_options`

```elixir
@type check_options() ::
  [
    force: boolean(),
    no_wait_after: boolean(),
    position: %{x: number(), y: number()},
    scroll: :auto | :none,
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity,
    trial: boolean()
  ]
  | %{
      optional(:force) =&gt; boolean(),
      optional(:no_wait_after) =&gt; boolean(),
      optional(:position) =&gt; %{x: number(), y: number()},
      optional(:scroll) =&gt; :auto | :none,
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:trial) =&gt; boolean()
    }
```

Options of `check/2`, see its docs.

# `clear_options`

```elixir
@type clear_options() ::
  [
    force: boolean(),
    no_wait_after: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:force) =&gt; boolean(),
      optional(:no_wait_after) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `clear/2`, see its docs.

# `click_options`

```elixir
@type click_options() ::
  [
    button: :left | :right | :middle,
    click_count: integer(),
    delay: number(),
    force: boolean(),
    modifiers: [:alt | :control | :control_or_meta | :meta | :shift],
    no_wait_after: boolean(),
    position: %{x: number(), y: number()},
    scroll: :auto | :none,
    signal: Playwright.AbortSignal.t(),
    steps: integer(),
    timeout: number() | :infinity,
    trial: boolean()
  ]
  | %{
      optional(:button) =&gt; :left | :right | :middle,
      optional(:click_count) =&gt; integer(),
      optional(:delay) =&gt; number(),
      optional(:force) =&gt; boolean(),
      optional(:modifiers) =&gt; [
        :alt | :control | :control_or_meta | :meta | :shift
      ],
      optional(:no_wait_after) =&gt; boolean(),
      optional(:position) =&gt; %{x: number(), y: number()},
      optional(:scroll) =&gt; :auto | :none,
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:steps) =&gt; integer(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:trial) =&gt; boolean()
    }
```

Options of `click/2`, see its docs.

# `dblclick_options`

```elixir
@type dblclick_options() ::
  [
    button: :left | :right | :middle,
    delay: number(),
    force: boolean(),
    modifiers: [:alt | :control | :control_or_meta | :meta | :shift],
    no_wait_after: boolean(),
    position: %{x: number(), y: number()},
    scroll: :auto | :none,
    signal: Playwright.AbortSignal.t(),
    steps: integer(),
    timeout: number() | :infinity,
    trial: boolean()
  ]
  | %{
      optional(:button) =&gt; :left | :right | :middle,
      optional(:delay) =&gt; number(),
      optional(:force) =&gt; boolean(),
      optional(:modifiers) =&gt; [
        :alt | :control | :control_or_meta | :meta | :shift
      ],
      optional(:no_wait_after) =&gt; boolean(),
      optional(:position) =&gt; %{x: number(), y: number()},
      optional(:scroll) =&gt; :auto | :none,
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:steps) =&gt; integer(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:trial) =&gt; boolean()
    }
```

Options of `dblclick/2`, see its docs.

# `dispatch_event_options`

```elixir
@type dispatch_event_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `dispatch_event/4`, see its docs.

# `drag_to_options`

```elixir
@type drag_to_options() ::
  [
    force: boolean(),
    no_wait_after: boolean(),
    scroll: :auto | :none,
    signal: Playwright.AbortSignal.t(),
    source_position: %{x: number(), y: number()},
    steps: integer(),
    target_position: %{x: number(), y: number()},
    timeout: number() | :infinity,
    trial: boolean()
  ]
  | %{
      optional(:force) =&gt; boolean(),
      optional(:no_wait_after) =&gt; boolean(),
      optional(:scroll) =&gt; :auto | :none,
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:source_position) =&gt; %{x: number(), y: number()},
      optional(:steps) =&gt; integer(),
      optional(:target_position) =&gt; %{x: number(), y: number()},
      optional(:timeout) =&gt; number() | :infinity,
      optional(:trial) =&gt; boolean()
    }
```

Options of `drag_to/3`, see its docs.

# `drop_options`

```elixir
@type drop_options() ::
  [
    position: %{x: number(), y: number()},
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:position) =&gt; %{x: number(), y: number()},
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `drop/3`, see its docs.

# `element_handle_options`

```elixir
@type element_handle_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `element_handle/2`, see its docs.

# `evaluate_handle_options`

```elixir
@type evaluate_handle_options() ::
  [
    expose_functions: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:expose_functions) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `evaluate_handle/4`, see its docs.

# `evaluate_options`

```elixir
@type evaluate_options() ::
  [
    expose_functions: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:expose_functions) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `evaluate/4`, see its docs.

# `fill_options`

```elixir
@type fill_options() ::
  [
    force: boolean(),
    no_wait_after: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:force) =&gt; boolean(),
      optional(:no_wait_after) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `fill/3`, see its docs.

# `filter_options`

```elixir
@type filter_options() ::
  [
    has: t(),
    has_not: t(),
    has_not_text: String.t() | Regex.t() | Playwright.RegExp.t(),
    has_text: String.t() | Regex.t() | Playwright.RegExp.t(),
    visible: boolean()
  ]
  | %{
      optional(:has) =&gt; t(),
      optional(:has_not) =&gt; t(),
      optional(:has_not_text) =&gt; String.t() | Regex.t() | Playwright.RegExp.t(),
      optional(:has_text) =&gt; String.t() | Regex.t() | Playwright.RegExp.t(),
      optional(:visible) =&gt; boolean()
    }
```

Options of `filter/2`, see its docs.

# `focus_options`

```elixir
@type focus_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `focus/2`, see its docs.

# `get_attribute_options`

```elixir
@type get_attribute_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `get_attribute/3`, see its docs.

# `get_by_alt_text_options`

```elixir
@type get_by_alt_text_options() ::
  [{:exact, boolean()}] | %{optional(:exact) =&gt; boolean()}
```

Options of `get_by_alt_text/3`, see its docs.

# `get_by_label_options`

```elixir
@type get_by_label_options() ::
  [{:exact, boolean()}] | %{optional(:exact) =&gt; boolean()}
```

Options of `get_by_label/3`, see its docs.

# `get_by_placeholder_options`

```elixir
@type get_by_placeholder_options() ::
  [{:exact, boolean()}] | %{optional(:exact) =&gt; boolean()}
```

Options of `get_by_placeholder/3`, see its docs.

# `get_by_role_options`

```elixir
@type get_by_role_options() ::
  [
    checked: boolean(),
    description: String.t() | Regex.t() | Playwright.RegExp.t(),
    disabled: boolean(),
    exact: boolean(),
    expanded: boolean(),
    include_hidden: boolean(),
    level: integer(),
    name: String.t() | Regex.t() | Playwright.RegExp.t(),
    pressed: boolean(),
    selected: boolean()
  ]
  | %{
      optional(:checked) =&gt; boolean(),
      optional(:description) =&gt; String.t() | Regex.t() | Playwright.RegExp.t(),
      optional(:disabled) =&gt; boolean(),
      optional(:exact) =&gt; boolean(),
      optional(:expanded) =&gt; boolean(),
      optional(:include_hidden) =&gt; boolean(),
      optional(:level) =&gt; integer(),
      optional(:name) =&gt; String.t() | Regex.t() | Playwright.RegExp.t(),
      optional(:pressed) =&gt; boolean(),
      optional(:selected) =&gt; boolean()
    }
```

Options of `get_by_role/3`, see its docs.

# `get_by_text_options`

```elixir
@type get_by_text_options() ::
  [{:exact, boolean()}] | %{optional(:exact) =&gt; boolean()}
```

Options of `get_by_text/3`, see its docs.

# `get_by_title_options`

```elixir
@type get_by_title_options() ::
  [{:exact, boolean()}] | %{optional(:exact) =&gt; boolean()}
```

Options of `get_by_title/3`, see its docs.

# `highlight_options`

```elixir
@type highlight_options() ::
  [{:style, String.t() | %{optional(String.t()) =&gt; String.t() | number()}}]
  | %{
      optional(:style) =&gt;
        String.t() | %{optional(String.t()) =&gt; String.t() | number()}
    }
```

Options of `highlight/2`, see its docs.

# `hover_options`

```elixir
@type hover_options() ::
  [
    force: boolean(),
    modifiers: [:alt | :control | :control_or_meta | :meta | :shift],
    no_wait_after: boolean(),
    position: %{x: number(), y: number()},
    scroll: :auto | :none,
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity,
    trial: boolean()
  ]
  | %{
      optional(:force) =&gt; boolean(),
      optional(:modifiers) =&gt; [
        :alt | :control | :control_or_meta | :meta | :shift
      ],
      optional(:no_wait_after) =&gt; boolean(),
      optional(:position) =&gt; %{x: number(), y: number()},
      optional(:scroll) =&gt; :auto | :none,
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:trial) =&gt; boolean()
    }
```

Options of `hover/2`, see its docs.

# `inner_html_options`

```elixir
@type inner_html_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `inner_html/2`, see its docs.

# `inner_text_options`

```elixir
@type inner_text_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `inner_text/2`, see its docs.

# `input_value_options`

```elixir
@type input_value_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `input_value/2`, see its docs.

# `is_checked_options`

```elixir
@type is_checked_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `is_checked/2`, see its docs.

# `is_disabled_options`

```elixir
@type is_disabled_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `is_disabled/2`, see its docs.

# `is_editable_options`

```elixir
@type is_editable_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `is_editable/2`, see its docs.

# `is_enabled_options`

```elixir
@type is_enabled_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `is_enabled/2`, see its docs.

# `is_hidden_options`

```elixir
@type is_hidden_options() ::
  [{:timeout, number() | :infinity}]
  | %{optional(:timeout) =&gt; number() | :infinity}
```

Options of `is_hidden/2`, see its docs.

# `is_visible_options`

```elixir
@type is_visible_options() ::
  [{:timeout, number() | :infinity}]
  | %{optional(:timeout) =&gt; number() | :infinity}
```

Options of `is_visible/2`, see its docs.

# `locator_options`

```elixir
@type locator_options() ::
  [
    has: t(),
    has_not: t(),
    has_not_text: String.t() | Regex.t() | Playwright.RegExp.t(),
    has_text: String.t() | Regex.t() | Playwright.RegExp.t()
  ]
  | %{
      optional(:has) =&gt; t(),
      optional(:has_not) =&gt; t(),
      optional(:has_not_text) =&gt; String.t() | Regex.t() | Playwright.RegExp.t(),
      optional(:has_text) =&gt; String.t() | Regex.t() | Playwright.RegExp.t()
    }
```

Options of `locator/3`, see its docs.

# `press_options`

```elixir
@type press_options() ::
  [
    delay: number(),
    no_wait_after: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:delay) =&gt; number(),
      optional(:no_wait_after) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `press/3`, see its docs.

# `press_sequentially_options`

```elixir
@type press_sequentially_options() ::
  [
    delay: number(),
    no_wait_after: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:delay) =&gt; number(),
      optional(:no_wait_after) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `press_sequentially/3`, see its docs.

# `screenshot_options`

```elixir
@type screenshot_options() ::
  [
    animations: :disabled | :allow,
    caret: :hide | :initial,
    mask: [t()],
    mask_color: String.t(),
    omit_background: boolean(),
    path: String.t(),
    quality: integer(),
    scale: :css | :device,
    signal: Playwright.AbortSignal.t(),
    style: String.t(),
    timeout: number() | :infinity,
    type: :png | :jpeg | :webp
  ]
  | %{
      optional(:animations) =&gt; :disabled | :allow,
      optional(:caret) =&gt; :hide | :initial,
      optional(:mask) =&gt; [t()],
      optional(:mask_color) =&gt; String.t(),
      optional(:omit_background) =&gt; boolean(),
      optional(:path) =&gt; String.t(),
      optional(:quality) =&gt; integer(),
      optional(:scale) =&gt; :css | :device,
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:style) =&gt; String.t(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:type) =&gt; :png | :jpeg | :webp
    }
```

Options of `screenshot/2`, see its docs.

# `scroll_into_view_if_needed_options`

```elixir
@type scroll_into_view_if_needed_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `scroll_into_view_if_needed/2`, see its docs.

# `select_option_options`

```elixir
@type select_option_options() ::
  [
    force: boolean(),
    no_wait_after: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:force) =&gt; boolean(),
      optional(:no_wait_after) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `select_option/3`, see its docs.

# `select_text_options`

```elixir
@type select_text_options() ::
  [
    force: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:force) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `select_text/2`, see its docs.

# `set_checked_options`

```elixir
@type set_checked_options() ::
  [
    force: boolean(),
    no_wait_after: boolean(),
    position: %{x: number(), y: number()},
    scroll: :auto | :none,
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity,
    trial: boolean()
  ]
  | %{
      optional(:force) =&gt; boolean(),
      optional(:no_wait_after) =&gt; boolean(),
      optional(:position) =&gt; %{x: number(), y: number()},
      optional(:scroll) =&gt; :auto | :none,
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:trial) =&gt; boolean()
    }
```

Options of `set_checked/3`, see its docs.

# `set_input_files_options`

```elixir
@type set_input_files_options() ::
  [
    no_wait_after: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:no_wait_after) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `set_input_files/3`, see its docs.

# `t`

```elixir
@type t() :: %Playwright.Locator{_apiName: term(), _frame: term(), _selector: term()}
```

A `Locator` handle. Compare handles with `==`, their fields are internal.

# `tap_options`

```elixir
@type tap_options() ::
  [
    force: boolean(),
    modifiers: [:alt | :control | :control_or_meta | :meta | :shift],
    no_wait_after: boolean(),
    position: %{x: number(), y: number()},
    scroll: :auto | :none,
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity,
    trial: boolean()
  ]
  | %{
      optional(:force) =&gt; boolean(),
      optional(:modifiers) =&gt; [
        :alt | :control | :control_or_meta | :meta | :shift
      ],
      optional(:no_wait_after) =&gt; boolean(),
      optional(:position) =&gt; %{x: number(), y: number()},
      optional(:scroll) =&gt; :auto | :none,
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:trial) =&gt; boolean()
    }
```

Options of `tap/2`, see its docs.

# `text_content_options`

```elixir
@type text_content_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `text_content/2`, see its docs.

# `type_options`

```elixir
@type type_options() ::
  [
    delay: number(),
    no_wait_after: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:delay) =&gt; number(),
      optional(:no_wait_after) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `type/3`, see its docs.

# `uncheck_options`

```elixir
@type uncheck_options() ::
  [
    force: boolean(),
    no_wait_after: boolean(),
    position: %{x: number(), y: number()},
    scroll: :auto | :none,
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity,
    trial: boolean()
  ]
  | %{
      optional(:force) =&gt; boolean(),
      optional(:no_wait_after) =&gt; boolean(),
      optional(:position) =&gt; %{x: number(), y: number()},
      optional(:scroll) =&gt; :auto | :none,
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:trial) =&gt; boolean()
    }
```

Options of `uncheck/2`, see its docs.

# `wait_for_function_options`

```elixir
@type wait_for_function_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `wait_for_function/4`, see its docs.

# `wait_for_options`

```elixir
@type wait_for_options() ::
  [
    signal: Playwright.AbortSignal.t(),
    state: :attached | :detached | :visible | :hidden,
    timeout: number() | :infinity
  ]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:state) =&gt; :attached | :detached | :visible | :hidden,
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `wait_for/2`, see its docs.

# `all`

```elixir
@spec all(t()) :: {:ok, [t()]} | {:error, Playwright.error()}
```

When the locator points to a list of elements, this returns an array of locators, pointing to their respective elements.

> #### Note {: .info}
>
> `Playwright.Locator.all/1` does not wait for elements to match the locator, and instead immediately returns whatever is present in the page.
>
> When the list of elements changes dynamically, `Playwright.Locator.all/1` will produce unpredictable and flaky results.
>
> When the list of elements is stable, but loaded dynamically, wait for the full list to finish loading before calling `Playwright.Locator.all/1`.

**Usage**

```elixir
for li <- Page.get_by_role(page, :listitem) |> Locator.all!() do
  Locator.click!(li)
end
```

*Since Playwright 1.29.*

# `all!`

```elixir
@spec all!(t()) :: [t()]
```

Like `all/1`, but returns the value and raises on error.

# `all_inner_texts`

```elixir
@spec all_inner_texts(t()) :: {:ok, [String.t()]} | {:error, Playwright.error()}
```

Returns an array of `node.innerText` values for all matching nodes.

> #### Asserting text {: .warning}
>
> If you need to assert text on the page, prefer `Playwright.Expect.to_have_text/3` with `:use_inner_text` option to avoid flakiness. See [assertions guide](https://playwright.dev/docs/test-assertions) for more details.

**Usage**

```elixir
texts = Page.get_by_role(page, :link) |> Locator.all_inner_texts!()
```

*Since Playwright 1.14.*

# `all_inner_texts!`

```elixir
@spec all_inner_texts!(t()) :: [String.t()]
```

Like `all_inner_texts/1`, but returns the value and raises on error.

# `all_text_contents`

```elixir
@spec all_text_contents(t()) :: {:ok, [String.t()]} | {:error, Playwright.error()}
```

Returns an array of `node.textContent` values for all matching nodes.

> #### Asserting text {: .warning}
>
> If you need to assert text on the page, prefer `Playwright.Expect.to_have_text/3` to avoid flakiness. See [assertions guide](https://playwright.dev/docs/test-assertions) for more details.

**Usage**

```elixir
texts = Page.get_by_role(page, :link) |> Locator.all_text_contents!()
```

*Since Playwright 1.14.*

# `all_text_contents!`

```elixir
@spec all_text_contents!(t()) :: [String.t()]
```

Like `all_text_contents/1`, but returns the value and raises on error.

# `and_`

```elixir
@spec and_(t(), t()) :: t()
```

Creates a locator that matches both this locator and the argument locator.

**Usage**

The following example finds a button with a specific title.

```elixir
button = Page.get_by_role(page, :button) |> Locator.and_(Page.get_by_title(page, "Subscribe"))
```

*Since Playwright 1.34.*

## Arguments

* `other_locator` - Additional locator to match.

# `aria_snapshot`

```elixir
@spec aria_snapshot(t(), aria_snapshot_options()) ::
  {:ok, String.t()} | {:error, Playwright.error()}
```

Captures the aria snapshot of the given element.
Read more about [aria snapshots](https://playwright.dev/docs/aria-snapshots) and `Playwright.Expect.to_match_aria_snapshot/3` for the corresponding assertion.

**Usage**

```elixir
Page.get_by_role(page, :link) |> Locator.aria_snapshot!()
```

**Details**

This method captures the aria snapshot of the given element. The snapshot is a string that represents the state of the element and its children.
The snapshot can be used to assert the state of the element in the test, or to compare it to state in the future.

The ARIA snapshot is represented using [YAML](https://yaml.org/spec/1.2.2/) markup language:

* The keys of the objects are the roles and optional accessible names of the elements.
* The values are either text content or an array of child elements.
* Generic static text can be represented with the `text` key.

Below is the HTML markup and the respective ARIA snapshot:

```html
<ul aria-label="Links">
  <li><a href="/">Home</a></li>
  <li><a href="/about">About</a></li>
<ul>
```

```yml
- list "Links":
  - listitem:
    - link "Home"
  - listitem:
    - link "About"
```

An AI-optimized snapshot, controlled by `:mode`, is different from a default snapshot:

1. Includes element references `[ref=e2]`.
   2. Does not wait for an element matching the locator, and fails when no elements match.
   3. Includes snapshots of `<iframe>`s inside the target.
   4. Can omit names that repeat printed descendants, such as a heading containing a link. Names that identify dialogs, landmarks, groups, tables and table headers are retained.

*Since Playwright 1.49.*

## Options

* `:boxes` (`t:boolean/0`) - *Since Playwright 1.60.* When `true`, appends each element's bounding box as `[box=x,y,width,height]` to the snapshot. Coordinates are
  relative to the viewport, in CSS pixels, as returned by [`Element.getBoundingClientRect()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).
  Defaults to `false`.
* `:depth` (`t:integer/0`) - *Since Playwright 1.59.* When specified, limits the depth of the snapshot.
* `:mode` (`:ai` | `:default`) - *Since Playwright 1.59.* When set to `:ai`, returns a snapshot optimized for AI consumption. Defaults to `:default`. See details for more information.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `aria_snapshot!`

```elixir
@spec aria_snapshot!(t(), aria_snapshot_options()) :: String.t()
```

Like `aria_snapshot/2`, but returns the value and raises on error.

# `aria_snapshot_json`

```elixir
@spec aria_snapshot_json(t(), aria_snapshot_json_options()) ::
  {:ok, term()} | {:error, Playwright.error()}
```

Captures the aria snapshot of the given element as a free form JSON object.

**Usage**

```elixir
Page.get_by_role(page, :list) |> Locator.aria_snapshot_json!()
```

**Details**

This method returns the same tree as `Playwright.Locator.aria_snapshot/2`, serialized as a JSON value instead of YAML markup.
The result is a list of nodes, each node being an object with the following properties:

* `role` Aria role of the element, or `"text"` for a static text fragment.
* `name` Accessible name of the element, if any.
* `text` Text content of the element when it is the only child, or the content of a static text fragment.
* `children` Child nodes and text fragments.
* Boolean and value properties for element state flags: `checked`, `disabled`, `expanded`, `active`, `invalid`, `level`, `pressed` and `selected`.
* Additional element properties, for example `url` for links and `placeholder` for text boxes.
* `ref` Element reference for AI-optimized snapshots.
* `cursor` Set to `"pointer"` for clickable elements in AI-optimized snapshots.
* `box` Bounding box of the element when `:boxes` is set.

*Since Playwright 1.63.*

## Options

* `:boxes` (`t:boolean/0`) - When `true`, includes each element's bounding box as a `box` property with `x`, `y`, `width` and `height`. Coordinates are
  relative to the viewport, in CSS pixels, as returned by [`Element.getBoundingClientRect()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).
  Defaults to `false`.
* `:depth` (`t:integer/0`) - When specified, limits the depth of the snapshot.
* `:mode` (`:ai` | `:default`) - When set to `:ai`, returns a snapshot optimized for AI consumption. Defaults to `:default`. See details in `Playwright.Locator.aria_snapshot/2`.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `aria_snapshot_json!`

```elixir
@spec aria_snapshot_json!(t(), aria_snapshot_json_options()) :: term()
```

Like `aria_snapshot_json/2`, but returns the value and raises on error.

# `blur`

```elixir
@spec blur(t(), blur_options()) :: :ok | {:error, Playwright.error()}
```

Calls [blur](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/blur) on the element.

*Since Playwright 1.28.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `blur!`

```elixir
@spec blur!(t(), blur_options()) :: :ok
```

Like `blur/2`, but returns the value and raises on error.

# `bounding_box`

```elixir
@spec bounding_box(t(), bounding_box_options()) ::
  {:ok, nil | %{x: number(), y: number(), width: number(), height: number()}}
  | {:error, Playwright.error()}
```

This method returns the bounding box of the element matching the locator, or `nil` if the element is not visible. The bounding box is
calculated relative to the main frame viewport - which is usually the same as the browser window.

**Details**

Scrolling affects the returned bounding box, similarly to
[Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect). That
means `x` and/or `y` may be negative.

Elements from child frames return the bounding box relative to the main frame, unlike the
[Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).

Assuming the page is static, it is safe to use bounding box coordinates to perform input. For example, the following
snippet should click the center of the element.

**Usage**

```elixir
box = Page.get_by_role(page, :button) |> Locator.bounding_box!()
Mouse.click!(Page.mouse(page), box.x + box.width / 2, box.y + box.height / 2)
```

*Since Playwright 1.14.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `bounding_box!`

```elixir
@spec bounding_box!(t(), bounding_box_options()) ::
  nil | %{x: number(), y: number(), width: number(), height: number()}
```

Like `bounding_box/2`, but returns the value and raises on error.

# `check`

```elixir
@spec check(t(), check_options()) :: :ok | {:error, Playwright.error()}
```

Ensure that checkbox or radio element is checked.

**Details**

Performs the following steps:

1. Ensure that element is a checkbox or a radio input. If not, this method fails. If the element is already
   checked, this method returns immediately.
1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the element, unless `:force` option is set.
1. Scroll the element into view if needed.
1. Use `Playwright.Page.mouse/1` to click in the center of the element.
1. Ensure that the element is now checked. If not, this method fails.

If the element is detached from the DOM at any moment during the action, this method fails.

When all steps combined have not finished during the specified `:timeout`, this method fails with a
[`TimeoutError`](`Playwright.TimeoutError`). Passing zero timeout disables this.

**Usage**

```elixir
Page.get_by_role(page, :checkbox) |> Locator.check!()
```

*Since Playwright 1.14.*

## Options

* `:force` (`t:boolean/0`) - Whether to bypass the [actionability](https://playwright.dev/docs/actionability) checks. Defaults to `false`.
* `:no_wait_after` (`t:boolean/0`) - This option has no effect.
* `:position` (`t:map/0`) - A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
  element.
  * `:x`
  * `:y`
* `:scroll` (`:auto` | `:none`) - *Since Playwright 1.62.* Controls whether Playwright scrolls the element into view before performing the action. Defaults to `:auto`,
  which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to
  `:none`, Playwright does not scroll the element and the action fails if the element is not already in the viewport.
  This is useful to assert that an element is reachable by the user without additional scrolling.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.
* `:trial` (`t:boolean/0`) - When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it.

# `check!`

```elixir
@spec check!(t(), check_options()) :: :ok
```

Like `check/2`, but returns the value and raises on error.

# `clear`

```elixir
@spec clear(t(), clear_options()) :: :ok | {:error, Playwright.error()}
```

Clear the input field.

**Details**

This method waits for [actionability](https://playwright.dev/docs/actionability) checks, focuses the element, clears it and triggers an `input` event after clearing.

If the target element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method fails. However, if the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be cleared instead.

**Usage**

```elixir
Page.get_by_role(page, :textbox) |> Locator.clear!()
```

*Since Playwright 1.28.*

## Options

* `:force` (`t:boolean/0`) - Whether to bypass the [actionability](https://playwright.dev/docs/actionability) checks. Defaults to `false`.
* `:no_wait_after` (`t:boolean/0`) - This option has no effect.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `clear!`

```elixir
@spec clear!(t(), clear_options()) :: :ok
```

Like `clear/2`, but returns the value and raises on error.

# `click`

```elixir
@spec click(t(), click_options()) :: :ok | {:error, Playwright.error()}
```

Click an element.

**Details**

This method clicks the element by performing the following steps:

1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the element, unless `:force` option is set.
1. Scroll the element into view if needed.
1. Use `Playwright.Page.mouse/1` to click in the center of the element, or the specified `:position`.
1. Wait for initiated navigations to either succeed or fail, unless `:no_wait_after` option is set.

If the element is detached from the DOM at any moment during the action, this method fails.

When all steps combined have not finished during the specified `:timeout`, this method fails with a
[`TimeoutError`](`Playwright.TimeoutError`). Passing zero timeout disables this.

**Usage**

Click a button:

```elixir
Page.get_by_role(page, :button) |> Locator.click!()
```

Shift-right-click at a specific position on a canvas:

```elixir
Page.locator(page, "canvas")
|> Locator.click!(button: :right, modifiers: [:shift], position: %{x: 23, y: 32})
```

*Since Playwright 1.14.*

## Options

* `:button` (`:left` | `:right` | `:middle`) - Defaults to `:left`.
* `:click_count` (`t:integer/0`) - defaults to 1. See [`UIEvent.detail`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail).
* `:delay` (`t:number/0`) - Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.
* `:force` (`t:boolean/0`) - Whether to bypass the [actionability](https://playwright.dev/docs/actionability) checks. Defaults to `false`.
* `:modifiers` (list of `:alt` | `:control` | `:control_or_meta` | `:meta` | `:shift`) - Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current
  modifiers back. If not specified, currently pressed modifiers are used. "ControlOrMeta" resolves to "Control" on Windows
  and Linux and to "Meta" on macOS.
* `:no_wait_after` (`t:boolean/0`) - Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
  opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating
  to inaccessible pages. Defaults to `false`.
* `:position` (`t:map/0`) - A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
  element.
  * `:x`
  * `:y`
* `:scroll` (`:auto` | `:none`) - *Since Playwright 1.62.* Controls whether Playwright scrolls the element into view before performing the action. Defaults to `:auto`,
  which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to
  `:none`, Playwright does not scroll the element and the action fails if the element is not already in the viewport.
  This is useful to assert that an element is reachable by the user without additional scrolling.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:steps` (`t:integer/0`) - *Since Playwright 1.57.* Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between Playwright's current cursor position and the provided destination. When set to 1, emits a single `mousemove` event at the destination location.
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.
* `:trial` (`t:boolean/0`) - When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it. Note that keyboard `:modifiers` will be pressed regardless of `:trial` to allow testing elements which are only visible when those keys are pressed.

# `click!`

```elixir
@spec click!(t(), click_options()) :: :ok
```

Like `click/2`, but returns the value and raises on error.

# `content_frame`

```elixir
@spec content_frame(t()) :: Playwright.FrameLocator.t()
```

Returns a [`FrameLocator`](`Playwright.FrameLocator`) object pointing to the same `iframe` as this locator.

Useful when you have a [`Locator`](`Playwright.Locator`) object obtained somewhere, and later on would like to interact with the content inside the frame.

For a reverse operation, use `Playwright.FrameLocator.owner/1`.

**Usage**

```elixir
locator = Page.locator(page, ~s(iframe[name="embedded"]))
# ...
frame_locator = Locator.content_frame(locator)
FrameLocator.get_by_role(frame_locator, :button) |> Locator.click!()
```

*Since Playwright 1.43.*

# `count`

```elixir
@spec count(t()) :: {:ok, integer()} | {:error, Playwright.error()}
```

Returns the number of elements matching the locator.

> #### Asserting count {: .warning}
>
> If you need to assert the number of elements on the page, prefer `Playwright.Expect.to_have_count/3` to avoid flakiness. See [assertions guide](https://playwright.dev/docs/test-assertions) for more details.

**Usage**

```elixir
count = Page.get_by_role(page, :listitem) |> Locator.count!()
```

*Since Playwright 1.14.*

# `count!`

```elixir
@spec count!(t()) :: integer()
```

Like `count/1`, but returns the value and raises on error.

# `dblclick`

```elixir
@spec dblclick(t(), dblclick_options()) :: :ok | {:error, Playwright.error()}
```

Double-click an element.

**Details**

This method double clicks the element by performing the following steps:

1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the element, unless `:force` option is set.
1. Scroll the element into view if needed.
1. Use `Playwright.Page.mouse/1` to double click in the center of the element, or the specified `:position`.

If the element is detached from the DOM at any moment during the action, this method fails.

When all steps combined have not finished during the specified `:timeout`, this method fails with a
[`TimeoutError`](`Playwright.TimeoutError`). Passing zero timeout disables this.

> #### Note {: .info}
>
> `Playwright.Locator.dblclick/2` dispatches two `click` events and a single `dblclick` event.

*Since Playwright 1.14.*

## Options

* `:button` (`:left` | `:right` | `:middle`) - Defaults to `:left`.
* `:delay` (`t:number/0`) - Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.
* `:force` (`t:boolean/0`) - Whether to bypass the [actionability](https://playwright.dev/docs/actionability) checks. Defaults to `false`.
* `:modifiers` (list of `:alt` | `:control` | `:control_or_meta` | `:meta` | `:shift`) - Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current
  modifiers back. If not specified, currently pressed modifiers are used. "ControlOrMeta" resolves to "Control" on Windows
  and Linux and to "Meta" on macOS.
* `:no_wait_after` (`t:boolean/0`) - This option has no effect.
* `:position` (`t:map/0`) - A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
  element.
  * `:x`
  * `:y`
* `:scroll` (`:auto` | `:none`) - *Since Playwright 1.62.* Controls whether Playwright scrolls the element into view before performing the action. Defaults to `:auto`,
  which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to
  `:none`, Playwright does not scroll the element and the action fails if the element is not already in the viewport.
  This is useful to assert that an element is reachable by the user without additional scrolling.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:steps` (`t:integer/0`) - *Since Playwright 1.57.* Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between Playwright's current cursor position and the provided destination. When set to 1, emits a single `mousemove` event at the destination location.
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.
* `:trial` (`t:boolean/0`) - When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it. Note that keyboard `:modifiers` will be pressed regardless of `:trial` to allow testing elements which are only visible when those keys are pressed.

# `dblclick!`

```elixir
@spec dblclick!(t(), dblclick_options()) :: :ok
```

Like `dblclick/2`, but returns the value and raises on error.

# `describe`

```elixir
@spec describe(t(), String.t()) :: t()
```

Describes the locator, description is used in the trace viewer and reports.
Returns the locator pointing to the same element.

**Usage**

```elixir
button = Page.get_by_test_id(page, "btn-sub") |> Locator.describe("Subscribe button")
Locator.click!(button)
```

*Since Playwright 1.53.*

## Arguments

* `description` - Locator description.

# `description`

```elixir
@spec description(t()) :: nil | String.t()
```

Returns locator description previously set with `Playwright.Locator.describe/2`. Returns `nil` if no custom description has been set. Prefer `Playwright.Locator.to_string/1` for a human-readable representation, as it uses the description when available.

**Usage**

```elixir
button = Page.get_by_role(page, :button) |> Locator.describe("Subscribe button")
Locator.description(button)
# => "Subscribe button"

input = Page.get_by_role(page, :textbox)
Locator.description(input)
# => nil
```

*Since Playwright 1.57.*

# `dispatch_event`

```elixir
@spec dispatch_event(t(), String.t(), term() | nil, dispatch_event_options()) ::
  :ok | {:error, Playwright.error()}
```

Programmatically dispatch an event on the matching element.

**Usage**

```elixir
Locator.dispatch_event!(locator, "click")
```

**Details**

The snippet above dispatches the `click` event on the element. Regardless of the visibility state of the element, `click`
is dispatched. This is equivalent to calling
[element.click()](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click).

Under the hood, it creates an instance of an event based on the given `type`, initializes it with
`event_init` properties and dispatches it on the element. Events are `composed`, `cancelable` and bubble by
default.

Since `event_init` is event-specific, please refer to the events documentation for the lists of initial
properties:

* [DeviceMotionEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceMotionEvent/DeviceMotionEvent)
* [DeviceOrientationEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceOrientationEvent/DeviceOrientationEvent)
* [DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/DragEvent)
* [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event/Event)
* [FocusEvent](https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent/FocusEvent)
* [KeyboardEvent](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/KeyboardEvent)
* [MouseEvent](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/MouseEvent)
* [PointerEvent](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/PointerEvent)
* [TouchEvent](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/TouchEvent)
* [WheelEvent](https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent/WheelEvent)

You can also specify [`JSHandle`](`Playwright.JSHandle`) as the property value if you want live objects to be passed into the event:

```elixir
data_transfer = Page.evaluate_handle!(page, "() => new DataTransfer()")
Locator.dispatch_event!(locator, "dragstart", %{dataTransfer: data_transfer})
```

*Since Playwright 1.14.*

## Arguments

* `type` - DOM event type: `"click"`, `"dragstart"`, etc.
* `event_init` - Optional event-specific initialization properties.

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `dispatch_event!`

```elixir
@spec dispatch_event!(t(), String.t(), term() | nil, dispatch_event_options()) :: :ok
```

Like `dispatch_event/4`, but returns the value and raises on error.

# `drag_to`

```elixir
@spec drag_to(t(), t(), drag_to_options()) :: :ok | {:error, Playwright.error()}
```

Drag the source element towards the target element and drop it.

**Details**

This method drags the locator to another target locator or target position. It will
first move to the source element, perform a `mousedown`, then move to the target
element or position and perform a `mouseup`.

**Usage**

```elixir
source = Page.locator(page, "#source")
target = Page.locator(page, "#target")

Locator.drag_to!(source, target)
# or specify exact positions relative to the top-left corners of the elements:
Locator.drag_to!(source, target, source_position: %{x: 34, y: 7}, target_position: %{x: 10, y: 20})
```

*Since Playwright 1.18.*

## Arguments

* `target` - Locator of the element to drag to.

## Options

* `:force` (`t:boolean/0`) - Whether to bypass the [actionability](https://playwright.dev/docs/actionability) checks. Defaults to `false`.
* `:no_wait_after` (`t:boolean/0`) - This option has no effect.
* `:scroll` (`:auto` | `:none`) - *Since Playwright 1.62.* Controls whether Playwright scrolls the element into view before performing the action. Defaults to `:auto`,
  which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to
  `:none`, Playwright does not scroll the element and the action fails if the element is not already in the viewport.
  This is useful to assert that an element is reachable by the user without additional scrolling.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:source_position` (`t:map/0`) - Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not specified, some visible point of the element is used.
  * `:x`
  * `:y`
* `:steps` (`t:integer/0`) - *Since Playwright 1.57.* Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between the `mousedown` and `mouseup` of the drag. When set to 1, emits a single `mousemove` event at the destination location.
* `:target_position` (`t:map/0`) - Drops on the target element at this point relative to the top-left corner of the element's padding box. If not specified, some visible point of the element is used.
  * `:x`
  * `:y`
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.
* `:trial` (`t:boolean/0`) - When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it.

# `drag_to!`

```elixir
@spec drag_to!(t(), t(), drag_to_options()) :: :ok
```

Like `drag_to/3`, but returns the value and raises on error.

# `drop`

```elixir
@spec drop(
  t(),
  %{
    optional(:files) =&gt;
      String.t()
      | [String.t()]
      | %{name: String.t(), mimeType: String.t(), buffer: binary()}
      | [%{name: String.t(), mimeType: String.t(), buffer: binary()}],
    optional(:data) =&gt; %{optional(String.t()) =&gt; String.t()}
  },
  drop_options()
) :: :ok | {:error, Playwright.error()}
```

Simulate an external drag-and-drop of files or clipboard-like data onto this locator.

**Details**

Dispatches the native `dragenter`, `dragover`, and `drop` events at the center of the
target element with a synthetic `DataTransfer` carrying the provided files and/or data
entries. Works cross-browser by constructing the `DataTransfer` in the page context.

If the target element's `dragover` listener does not call `preventDefault()`, the target
is considered to have rejected the drop: Playwright dispatches `dragleave` and this
method fails.

**Usage**

Drop a file buffer onto an upload area:

```elixir
Page.locator(page, "#dropzone")
|> Locator.drop!(%{files: %{name: "note.txt", mimeType: "text/plain", buffer: "hello"}})
```

Drop plain text and a URL together:

```elixir
Page.locator(page, "#dropzone")
|> Locator.drop!(%{data: %{"text/plain" => "hello world", "text/uri-list" => "https://example.com"}})
```

*Since Playwright 1.60.*

## Arguments

* `payload` - Data to drop onto the target. Provide `files` (file paths or in-memory buffers), `data`
  (a mime-type → string map for clipboard-like content such as `text/plain`, `text/html`,
  `text/uri-list`), or both.
  * `:files`
    * `:name` - File name
    * `:mimeType` - File type
    * `:buffer` - File content
  * `:data`

## Options

* `:position` (`t:map/0`) - A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
  element.
  * `:x`
  * `:y`
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `drop!`

```elixir
@spec drop!(
  t(),
  %{
    optional(:files) =&gt;
      String.t()
      | [String.t()]
      | %{name: String.t(), mimeType: String.t(), buffer: binary()}
      | [%{name: String.t(), mimeType: String.t(), buffer: binary()}],
    optional(:data) =&gt; %{optional(String.t()) =&gt; String.t()}
  },
  drop_options()
) :: :ok
```

Like `drop/3`, but returns the value and raises on error.

# `element_handle`

```elixir
@spec element_handle(t(), element_handle_options()) ::
  {:ok, Playwright.ElementHandle.t()} | {:error, Playwright.error()}
```

Resolves given locator to the first matching DOM element. If there are no matching elements, waits for one. If multiple elements match the locator, fails.

> #### Discouraged {: .warning}
>
> Always prefer using [`Locator`](`Playwright.Locator`)s and web assertions over [`ElementHandle`](`Playwright.ElementHandle`)s because latter are inherently racy.

*Since Playwright 1.14.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `element_handle!`

```elixir
@spec element_handle!(t(), element_handle_options()) :: Playwright.ElementHandle.t()
```

Like `element_handle/2`, but returns the value and raises on error.

# `element_handles`

```elixir
@spec element_handles(t()) ::
  {:ok, [Playwright.ElementHandle.t()]} | {:error, Playwright.error()}
```

Resolves given locator to all matching DOM elements. If there are no matching elements, returns an empty list.

> #### Discouraged {: .warning}
>
> Always prefer using [`Locator`](`Playwright.Locator`)s and web assertions over [`ElementHandle`](`Playwright.ElementHandle`)s because latter are inherently racy.

*Since Playwright 1.14.*

# `element_handles!`

```elixir
@spec element_handles!(t()) :: [Playwright.ElementHandle.t()]
```

Like `element_handles/1`, but returns the value and raises on error.

# `evaluate`

```elixir
@spec evaluate(t(), String.t(), term() | nil, evaluate_options()) ::
  {:ok, term()} | {:error, Playwright.error()}
```

Execute JavaScript code in the page, taking the matching element as an argument.

**Details**

Returns the return value of `expression`, called with the matching element as a first argument, and `arg` as a second argument.

If `expression` returns a `Promise`, this method will wait for the promise to resolve and return its value.

If `expression` throws or rejects, this method fails.

**Usage**

Passing argument to `expression`:

```elixir
result =
  Page.get_by_test_id(page, "myId")
  |> Locator.evaluate!("(element, [x, y]) => element.textContent + ' ' + x * y", [7, 8])

# prints "myId text 56"
IO.puts(result)
```

*Since Playwright 1.14.*

## Arguments

* `expression` - Function to be evaluated in the page context.
* `arg` - Optional argument to pass to `expression`.

## Options

* `:expose_functions` (`t:boolean/0`) - *Since Playwright 1.62.* When set to `true`, functions passed inside `arg` are exposed in the page and can be called from the page function. Calling one returns a `Promise` of its result. Under the hood, each function is exposed via `Playwright.Page.expose_function/3`, so it is technically accessible from all frames of the page. Exposed functions are cleared upon the top-level navigation. Defaults to `false`, in which case functions are not serializable and passing one fails.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds to wait for the locator before evaluating. Note that after locator is resolved, evaluation itself is not limited by the timeout. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `evaluate!`

```elixir
@spec evaluate!(t(), String.t(), term() | nil, evaluate_options()) :: term()
```

Like `evaluate/4`, but returns the value and raises on error.

# `evaluate_all`

```elixir
@spec evaluate_all(t(), String.t(), term() | nil) ::
  {:ok, term()} | {:error, Playwright.error()}
```

Execute JavaScript code in the page, taking all matching elements as an argument.

**Details**

Returns the return value of `expression`, called with an array of all matching elements as a first argument, and `arg` as a second argument.

If `expression` returns a `Promise`, this method will wait for the promise to resolve and return its value.

If `expression` throws or rejects, this method fails.

**Usage**

```elixir
locator = Page.locator(page, "div")
more_than_ten = Locator.evaluate_all!(locator, "(divs, min) => divs.length > min", 10)
```

*Since Playwright 1.14.*

## Arguments

* `expression` - Function to be evaluated in the page context.
* `arg` - Optional argument to pass to `expression`.

# `evaluate_all!`

```elixir
@spec evaluate_all!(t(), String.t(), term() | nil) :: term()
```

Like `evaluate_all/3`, but returns the value and raises on error.

# `evaluate_handle`

```elixir
@spec evaluate_handle(t(), String.t(), term() | nil, evaluate_handle_options()) ::
  {:ok, Playwright.JSHandle.t()} | {:error, Playwright.error()}
```

Execute JavaScript code in the page, taking the matching element as an argument, and return a [`JSHandle`](`Playwright.JSHandle`) with the result.

**Details**

Returns the return value of `expression` as a[`JSHandle`](`Playwright.JSHandle`), called with the matching element as a first argument, and `arg` as a second argument.

The only difference between `Playwright.Locator.evaluate/4` and `Playwright.Locator.evaluate_handle/4` is that `Playwright.Locator.evaluate_handle/4` returns [`JSHandle`](`Playwright.JSHandle`).

If `expression` returns a `Promise`, this method will wait for the promise to resolve and return its value.

If `expression` throws or rejects, this method fails.

See `Playwright.Page.evaluate_handle/4` for more details.

*Since Playwright 1.14.*

## Arguments

* `expression` - Function to be evaluated in the page context.
* `arg` - Optional argument to pass to `expression`.

## Options

* `:expose_functions` (`t:boolean/0`) - *Since Playwright 1.62.* When set to `true`, functions passed inside `arg` are exposed in the page and can be called from the page function. Calling one returns a `Promise` of its result. Under the hood, each function is exposed via `Playwright.Page.expose_function/3`, so it is technically accessible from all frames of the page. Exposed functions are cleared upon the top-level navigation. Defaults to `false`, in which case functions are not serializable and passing one fails.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds to wait for the locator before evaluating. Note that after locator is resolved, evaluation itself is not limited by the timeout. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `evaluate_handle!`

```elixir
@spec evaluate_handle!(t(), String.t(), term() | nil, evaluate_handle_options()) ::
  Playwright.JSHandle.t()
```

Like `evaluate_handle/4`, but returns the value and raises on error.

# `fill`

```elixir
@spec fill(t(), String.t(), fill_options()) :: :ok | {:error, Playwright.error()}
```

Set a value to the input field.

**Usage**

```elixir
Page.get_by_role(page, :textbox) |> Locator.fill!("example value")
```

**Details**

This method waits for [actionability](https://playwright.dev/docs/actionability) checks, focuses the element, fills it and triggers an `input` event after filling. Note that you can pass an empty string to clear the input field.

If the target element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method fails. However, if the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be filled instead.

To send fine-grained keyboard events, use `Playwright.Locator.press_sequentially/3`.

*Since Playwright 1.14.*

## Arguments

* `value` - Value to set for the `<input>`, `<textarea>` or `[contenteditable]` element.

## Options

* `:force` (`t:boolean/0`) - Whether to bypass the [actionability](https://playwright.dev/docs/actionability) checks. Defaults to `false`.
* `:no_wait_after` (`t:boolean/0`) - This option has no effect.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `fill!`

```elixir
@spec fill!(t(), String.t(), fill_options()) :: :ok
```

Like `fill/3`, but returns the value and raises on error.

# `filter`

```elixir
@spec filter(t(), filter_options()) :: t()
```

This method narrows existing locator according to the options, for example filters by text.
It can be chained to filter multiple times.

**Usage**

```elixir
row_locator = Page.locator(page, "tr")
# ...
row_locator
|> Locator.filter(has_text: "text in column 1")
|> Locator.filter(has: Page.get_by_role(page, :button, name: "column 2 button"))
|> Locator.screenshot!()
```

*Since Playwright 1.22.*

## Options

* `:has` (`t:Playwright.Locator.t/0`) - Narrows down the results of the method to those which contain elements matching this relative locator.
  For example, `article` that has `text=Playwright` matches `<article><div>Playwright</div></article>`.

  Inner locator **must be relative** to the outer locator and is queried starting with the outer locator match, not the document root. For example, you can find `content` that has `div` in `<article><content><div>Playwright</div></content></article>`. However, looking for `content` that has `article div` will fail, because the inner locator must be relative and should not use any elements outside the `content`.

  Note that outer and inner locators must belong to the same frame. Inner locator must not contain [`FrameLocator`](`Playwright.FrameLocator`)s.
* `:has_not` (`t:Playwright.Locator.t/0`) - *Since Playwright 1.33.* Matches elements that do not contain an element that matches an inner locator. Inner locator is queried against the outer one.
  For example, `article` that does not have `div` matches `<article><span>Playwright</span></article>`.

  Note that outer and inner locators must belong to the same frame. Inner locator must not contain [`FrameLocator`](`Playwright.FrameLocator`)s.
* `:has_not_text` (`t:String.t/0` | `t:Regex.t/0` | `t:Playwright.RegExp.t/0`) - *Since Playwright 1.33.* Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element. When passed a `string`, matching is case-insensitive and searches for a substring.
* `:has_text` (`t:String.t/0` | `t:Regex.t/0` | `t:Playwright.RegExp.t/0`) - Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When passed a `string`, matching is case-insensitive and searches for a substring.
  For example, `"Playwright"` matches `<article><div>Playwright</div></article>`.
* `:visible` (`t:boolean/0`) - *Since Playwright 1.51.* Only matches visible or invisible elements. Prefer the `Playwright.Locator.visible/1` shortcut when matching only visible elements.

# `first`

```elixir
@spec first(t()) :: t()
```

Returns locator to the first matching element.

*Since Playwright 1.14.*

# `focus`

```elixir
@spec focus(t(), focus_options()) :: :ok | {:error, Playwright.error()}
```

Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the matching element.

*Since Playwright 1.14.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `focus!`

```elixir
@spec focus!(t(), focus_options()) :: :ok
```

Like `focus/2`, but returns the value and raises on error.

# `frame_locator`

```elixir
@spec frame_locator(t(), String.t()) :: Playwright.FrameLocator.t()
```

When working with iframes, you can create a frame locator that will enter the iframe and allow locating elements
in that iframe:

**Usage**

```elixir
locator = Page.frame_locator(page, "iframe") |> FrameLocator.get_by_text("Submit")
Locator.click!(locator)
```

*Since Playwright 1.17.*

## Arguments

* `selector` - A selector to use when resolving DOM element.

# `get_attribute`

```elixir
@spec get_attribute(t(), String.t(), get_attribute_options()) ::
  {:ok, nil | String.t()} | {:error, Playwright.error()}
```

Returns the matching element's attribute value.

> #### Asserting attributes {: .warning}
>
> If you need to assert an element's attribute, prefer `Playwright.Expect.to_have_attribute/4` to avoid flakiness. See [assertions guide](https://playwright.dev/docs/test-assertions) for more details.

*Since Playwright 1.14.*

## Arguments

* `name` - Attribute name to get the value for.

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `get_attribute!`

```elixir
@spec get_attribute!(t(), String.t(), get_attribute_options()) :: nil | String.t()
```

Like `get_attribute/3`, but returns the value and raises on error.

# `get_by_alt_text`

```elixir
@spec get_by_alt_text(
  t(),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  get_by_alt_text_options()
) ::
  t()
```

Allows locating elements by their alt text.

**Usage**

For example, this method will find the image by alt text "Playwright logo":

```html
<img alt='Playwright logo'>
```

```elixir
Page.get_by_alt_text(page, "Playwright logo") |> Locator.click!()
```

*Since Playwright 1.27.*

## Arguments

* `text` - Text to locate the element for.

## Options

* `:exact` (`t:boolean/0`) - Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular expression. Note that exact match still trims whitespace.

# `get_by_label`

```elixir
@spec get_by_label(
  t(),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  get_by_label_options()
) :: t()
```

Allows locating input elements by the text of the associated `<label>` or `aria-labelledby` element, or by the `aria-label` attribute.

**Usage**

For example, this method will find inputs by label "Username" and "Password" in the following DOM:

```html
<input aria-label="Username">
<label for="password-input">Password:</label>
<input id="password-input">
```

```elixir
Page.get_by_label(page, "Username") |> Locator.fill!("john")
Page.get_by_label(page, "Password") |> Locator.fill!("secret")
```

*Since Playwright 1.27.*

## Arguments

* `text` - Text to locate the element for.

## Options

* `:exact` (`t:boolean/0`) - Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular expression. Note that exact match still trims whitespace.

# `get_by_placeholder`

```elixir
@spec get_by_placeholder(
  t(),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  get_by_placeholder_options()
) :: t()
```

Allows locating input elements by the placeholder text.

**Usage**

For example, consider the following DOM structure.

```html
<input type="email" placeholder="name@example.com" />
```

You can fill the input after locating it by the placeholder text:

```elixir
Page.get_by_placeholder(page, "name@example.com") |> Locator.fill!("playwright@microsoft.com")
```

*Since Playwright 1.27.*

## Arguments

* `text` - Text to locate the element for.

## Options

* `:exact` (`t:boolean/0`) - Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular expression. Note that exact match still trims whitespace.

# `get_by_role`

```elixir
@spec get_by_role(
  t(),
  :alert
  | :alertdialog
  | :application
  | :article
  | :banner
  | :blockquote
  | :button
  | :caption
  | :cell
  | :checkbox
  | :code
  | :columnheader
  | :combobox
  | :complementary
  | :contentinfo
  | :definition
  | :deletion
  | :dialog
  | :directory
  | :document
  | :emphasis
  | :feed
  | :figure
  | :form
  | :generic
  | :grid
  | :gridcell
  | :group
  | :heading
  | :img
  | :insertion
  | :link
  | :list
  | :listbox
  | :listitem
  | :log
  | :main
  | :marquee
  | :math
  | :meter
  | :menu
  | :menubar
  | :menuitem
  | :menuitemcheckbox
  | :menuitemradio
  | :navigation
  | :none
  | :note
  | :option
  | :paragraph
  | :presentation
  | :progressbar
  | :radio
  | :radiogroup
  | :region
  | :row
  | :rowgroup
  | :rowheader
  | :scrollbar
  | :search
  | :searchbox
  | :separator
  | :slider
  | :spinbutton
  | :status
  | :strong
  | :subscript
  | :superscript
  | :switch
  | :tab
  | :table
  | :tablist
  | :tabpanel
  | :term
  | :textbox
  | :time
  | :timer
  | :toolbar
  | :tooltip
  | :tree
  | :treegrid
  | :treeitem
  | String.t(),
  get_by_role_options()
) :: t()
```

Allows locating elements by their [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles), [ARIA attributes](https://www.w3.org/TR/wai-aria-1.2/#aria-attributes) and [accessible name](https://w3c.github.io/accname/#dfn-accessible-name).

**Usage**

Consider the following DOM structure.

```html
<h3>Sign up</h3>
<label>
  <input type="checkbox" /> Subscribe
</label>
<br/>
<button>Submit</button>
```

You can locate each element by its implicit role:

```elixir
Page.get_by_role(page, :heading, name: "Sign up") |> Expect.to_be_visible!()

Page.get_by_role(page, :checkbox, name: "Subscribe") |> Locator.check!()

Page.get_by_role(page, :button, name: ~r/submit/i) |> Locator.click!()
```

**Details**

Role selector **does not replace** accessibility audits and conformance tests, but rather gives early feedback about the ARIA guidelines.

Many html elements have an implicitly [defined role](https://w3c.github.io/html-aam/#html-element-role-mappings) that is recognized by the role selector. You can find all the [supported roles here](https://www.w3.org/TR/wai-aria-1.2/#role_definitions). ARIA guidelines **do not recommend** duplicating implicit roles and attributes by setting `role` and/or `aria-*` attributes to default values.

*Since Playwright 1.27.*

## Arguments

* `role` - Required aria role.

  In Elixir, a role is an atom of the typespec (`:button`) or a string, also one the typespec lacks (`"mark"`): the JS client takes any string.

## Options

* `:checked` (`t:boolean/0`) - An attribute that is usually set by `aria-checked` or native `<input type=checkbox>` controls.

  Learn more about [`aria-checked`](https://www.w3.org/TR/wai-aria-1.2/#aria-checked).
* `:description` (`t:String.t/0` | `t:Regex.t/0` | `t:Playwright.RegExp.t/0`) - *Since Playwright 1.60.* Option to match the [accessible description](https://w3c.github.io/accname/#dfn-accessible-description). By default, matching is case-insensitive and searches for a substring, use `:exact` to control this behavior.

  Learn more about [accessible description](https://w3c.github.io/accname/#dfn-accessible-description).
* `:disabled` (`t:boolean/0`) - An attribute that is usually set by `aria-disabled` or `disabled`.

  > #### Note {: .info}
  >
  > Unlike most other attributes, `disabled` is inherited through the DOM hierarchy.
  > Learn more about [`aria-disabled`](https://www.w3.org/TR/wai-aria-1.2/#aria-disabled).
* `:exact` (`t:boolean/0`) - *Since Playwright 1.28.* Whether `:name` and `:description` are matched exactly: case-sensitive and whole-string. Defaults to false. Ignored when the value is a regular expression. Note that exact match still trims whitespace.
* `:expanded` (`t:boolean/0`) - An attribute that is usually set by `aria-expanded`.

  Learn more about [`aria-expanded`](https://www.w3.org/TR/wai-aria-1.2/#aria-expanded).
* `:include_hidden` (`t:boolean/0`) - Option that controls whether hidden elements are matched. By default, only non-hidden elements, as [defined by ARIA](https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion), are matched by role selector.

  Learn more about [`aria-hidden`](https://www.w3.org/TR/wai-aria-1.2/#aria-hidden).
* `:level` (`t:integer/0`) - A number attribute that is usually present for roles `heading`, `listitem`, `row`, `treeitem`, with default values for `<h1>-<h6>` elements.

  Learn more about [`aria-level`](https://www.w3.org/TR/wai-aria-1.2/#aria-level).
* `:name` (`t:String.t/0` | `t:Regex.t/0` | `t:Playwright.RegExp.t/0`) - Option to match the [accessible name](https://w3c.github.io/accname/#dfn-accessible-name). By default, matching is case-insensitive and searches for a substring, use `:exact` to control this behavior.

  Learn more about [accessible name](https://w3c.github.io/accname/#dfn-accessible-name).
* `:pressed` (`t:boolean/0`) - An attribute that is usually set by `aria-pressed`.

  Learn more about [`aria-pressed`](https://www.w3.org/TR/wai-aria-1.2/#aria-pressed).
* `:selected` (`t:boolean/0`) - An attribute that is usually set by `aria-selected`.

  Learn more about [`aria-selected`](https://www.w3.org/TR/wai-aria-1.2/#aria-selected).

# `get_by_test_id`

```elixir
@spec get_by_test_id(t(), String.t() | Regex.t() | Playwright.RegExp.t()) :: t()
```

Locate element by the test id.

**Usage**

Consider the following DOM structure.

```html
<button data-testid="directions">Itinéraire</button>
```

You can locate the element by its test id:

```elixir
Page.get_by_test_id(page, "directions") |> Locator.click!()
```

**Details**

By default, the `data-testid` attribute is used as a test id. Use `Playwright.Selectors.set_test_id_attribute/2` to configure a different test id attribute if necessary.

```elixir
# Set a custom test id attribute:
Playwright.selectors(playwright) |> Selectors.set_test_id_attribute("data-pw")
```

*Since Playwright 1.27.*

## Arguments

* `test_id` - Id to locate the element by.

# `get_by_text`

```elixir
@spec get_by_text(
  t(),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  get_by_text_options()
) :: t()
```

Allows locating elements that contain given text.

See also `Playwright.Locator.filter/2` that allows to match by another criteria, like an accessible role, and then filter by the text content.

**Usage**

Consider the following DOM structure:

```html
<div>Hello <span>world</span></div>
<div>Hello</div>
```

You can locate by text substring, exact string, or a regular expression:

```elixir
# Matches <span>
Page.get_by_text(page, "world")

# Matches first <div>
Page.get_by_text(page, "Hello world")

# Matches second <div>
Page.get_by_text(page, "Hello", exact: true)

# Matches both <div>s
Page.get_by_text(page, ~r/Hello/)

# Matches second <div>
Page.get_by_text(page, ~r/^hello$/i)
```

**Details**

Matching by text always normalizes whitespace, even with exact match. For example, it turns multiple spaces into one, turns line breaks into spaces and ignores leading and trailing whitespace.

Input elements of the type `button` and `submit` are matched by their `value` instead of the text content. For example, locating by text `"Log in"` matches `<input type=button value="Log in">`.

*Since Playwright 1.27.*

## Arguments

* `text` - Text to locate the element for.

## Options

* `:exact` (`t:boolean/0`) - Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular expression. Note that exact match still trims whitespace.

# `get_by_title`

```elixir
@spec get_by_title(
  t(),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  get_by_title_options()
) :: t()
```

Allows locating elements by their title attribute.

**Usage**

Consider the following DOM structure.

```html
<span title='Issues count'>25 issues</span>
```

You can check the issues count after locating it by the title text:

```elixir
Page.get_by_title(page, "Issues count") |> Expect.to_have_text!("25 issues")
```

*Since Playwright 1.27.*

## Arguments

* `text` - Text to locate the element for.

## Options

* `:exact` (`t:boolean/0`) - Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular expression. Note that exact match still trims whitespace.

# `hide_highlight`

```elixir
@spec hide_highlight(t()) :: :ok | {:error, Playwright.error()}
```

Hides the element highlight previously added by `Playwright.Locator.highlight/2`.

*Since Playwright 1.60.*

# `hide_highlight!`

```elixir
@spec hide_highlight!(t()) :: :ok
```

Like `hide_highlight/1`, but returns the value and raises on error.

# `highlight`

```elixir
@spec highlight(t(), highlight_options()) ::
  {:ok, Playwright.Disposable.t()} | {:error, Playwright.error()}
```

Highlight the corresponding element(s) on the screen. Useful for debugging, don't commit the code that uses `Playwright.Locator.highlight/2`.

*Since Playwright 1.20.*

## Options

* `:style` (`t:String.t/0` | `%{optional(String.t()) => String.t() | number()}`) - *Since Playwright 1.60.* Inline CSS applied to the highlight overlay, e.g.

  ```elixir
  Locator.highlight!(locator, style: "outline: 2px dashed red")
  Locator.highlight!(locator, style: %{"color" => "red"})
  ```

# `highlight!`

```elixir
@spec highlight!(t(), highlight_options()) :: Playwright.Disposable.t()
```

Like `highlight/2`, but returns the value and raises on error.

# `hover`

```elixir
@spec hover(t(), hover_options()) :: :ok | {:error, Playwright.error()}
```

Hover over the matching element.

**Usage**

```elixir
Page.get_by_role(page, :link) |> Locator.hover!()
```

**Details**

This method hovers over the element by performing the following steps:

1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the element, unless `:force` option is set.
1. Scroll the element into view if needed.
1. Use `Playwright.Page.mouse/1` to hover over the center of the element, or the specified `:position`.

If the element is detached from the DOM at any moment during the action, this method fails.

When all steps combined have not finished during the specified `:timeout`, this method fails with a
[`TimeoutError`](`Playwright.TimeoutError`). Passing zero timeout disables this.

*Since Playwright 1.14.*

## Options

* `:force` (`t:boolean/0`) - Whether to bypass the [actionability](https://playwright.dev/docs/actionability) checks. Defaults to `false`.
* `:modifiers` (list of `:alt` | `:control` | `:control_or_meta` | `:meta` | `:shift`) - Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current
  modifiers back. If not specified, currently pressed modifiers are used. "ControlOrMeta" resolves to "Control" on Windows
  and Linux and to "Meta" on macOS.
* `:no_wait_after` (`t:boolean/0`) - *Since Playwright 1.28.* This option has no effect.
* `:position` (`t:map/0`) - A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
  element.
  * `:x`
  * `:y`
* `:scroll` (`:auto` | `:none`) - *Since Playwright 1.62.* Controls whether Playwright scrolls the element into view before performing the action. Defaults to `:auto`,
  which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to
  `:none`, Playwright does not scroll the element and the action fails if the element is not already in the viewport.
  This is useful to assert that an element is reachable by the user without additional scrolling.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.
* `:trial` (`t:boolean/0`) - When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it. Note that keyboard `:modifiers` will be pressed regardless of `:trial` to allow testing elements which are only visible when those keys are pressed.

# `hover!`

```elixir
@spec hover!(t(), hover_options()) :: :ok
```

Like `hover/2`, but returns the value and raises on error.

# `inner_html`

```elixir
@spec inner_html(t(), inner_html_options()) ::
  {:ok, String.t()} | {:error, Playwright.error()}
```

Returns the [`element.innerHTML`](https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML).

*Since Playwright 1.14.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `inner_html!`

```elixir
@spec inner_html!(t(), inner_html_options()) :: String.t()
```

Like `inner_html/2`, but returns the value and raises on error.

# `inner_text`

```elixir
@spec inner_text(t(), inner_text_options()) ::
  {:ok, String.t()} | {:error, Playwright.error()}
```

Returns the [`element.innerText`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/innerText).

> #### Asserting text {: .warning}
>
> If you need to assert text on the page, prefer `Playwright.Expect.to_have_text/3` with `:use_inner_text` option to avoid flakiness. See [assertions guide](https://playwright.dev/docs/test-assertions) for more details.

*Since Playwright 1.14.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `inner_text!`

```elixir
@spec inner_text!(t(), inner_text_options()) :: String.t()
```

Like `inner_text/2`, but returns the value and raises on error.

# `input_value`

```elixir
@spec input_value(t(), input_value_options()) ::
  {:ok, String.t()} | {:error, Playwright.error()}
```

Returns the value for the matching `<input>` or `<textarea>` or `<select>` element.

> #### Asserting value {: .warning}
>
> If you need to assert input value, prefer `Playwright.Expect.to_have_value/3` to avoid flakiness. See [assertions guide](https://playwright.dev/docs/test-assertions) for more details.

**Usage**

```elixir
value = Page.get_by_role(page, :textbox) |> Locator.input_value!()
```

**Details**

Fails for elements that are not an input, textarea or a select. However, if the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), returns the value of the control.

*Since Playwright 1.14.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `input_value!`

```elixir
@spec input_value!(t(), input_value_options()) :: String.t()
```

Like `input_value/2`, but returns the value and raises on error.

# `is_checked`

```elixir
@spec is_checked(t(), is_checked_options()) ::
  {:ok, boolean()} | {:error, Playwright.error()}
```

Returns whether the element is checked. Fails if the element is not a checkbox or radio input.

> #### Asserting checked state {: .warning}
>
> If you need to assert that checkbox is checked, prefer `Playwright.Expect.to_be_checked/2` to avoid flakiness. See [assertions guide](https://playwright.dev/docs/test-assertions) for more details.

**Usage**

```elixir
checked = Page.get_by_role(page, :checkbox) |> Locator.is_checked!()
```

*Since Playwright 1.14.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `is_checked!`

```elixir
@spec is_checked!(t(), is_checked_options()) :: boolean()
```

Like `is_checked/2`, but returns the value and raises on error.

# `is_disabled`

```elixir
@spec is_disabled(t(), is_disabled_options()) ::
  {:ok, boolean()} | {:error, Playwright.error()}
```

Returns whether the element is disabled, the opposite of [enabled](https://playwright.dev/docs/actionability#enabled).

> #### Asserting disabled state {: .warning}
>
> If you need to assert that an element is disabled, prefer `Playwright.Expect.to_be_disabled/2` to avoid flakiness. See [assertions guide](https://playwright.dev/docs/test-assertions) for more details.

**Usage**

```elixir
disabled = Page.get_by_role(page, :button) |> Locator.is_disabled!()
```

*Since Playwright 1.14.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `is_disabled!`

```elixir
@spec is_disabled!(t(), is_disabled_options()) :: boolean()
```

Like `is_disabled/2`, but returns the value and raises on error.

# `is_editable`

```elixir
@spec is_editable(t(), is_editable_options()) ::
  {:ok, boolean()} | {:error, Playwright.error()}
```

Returns whether the element is [editable](https://playwright.dev/docs/actionability#editable). If the target element is not an `<input>`, `<textarea>`, `<select>`, `[contenteditable]` and does not have a role allowing `[aria-readonly]`, this method fails.

> #### Asserting editable state {: .warning}
>
> If you need to assert that an element is editable, prefer `Playwright.Expect.to_be_editable/2` to avoid flakiness. See [assertions guide](https://playwright.dev/docs/test-assertions) for more details.

**Usage**

```elixir
editable = Page.get_by_role(page, :textbox) |> Locator.is_editable!()
```

*Since Playwright 1.14.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `is_editable!`

```elixir
@spec is_editable!(t(), is_editable_options()) :: boolean()
```

Like `is_editable/2`, but returns the value and raises on error.

# `is_enabled`

```elixir
@spec is_enabled(t(), is_enabled_options()) ::
  {:ok, boolean()} | {:error, Playwright.error()}
```

Returns whether the element is [enabled](https://playwright.dev/docs/actionability#enabled).

> #### Asserting enabled state {: .warning}
>
> If you need to assert that an element is enabled, prefer `Playwright.Expect.to_be_enabled/2` to avoid flakiness. See [assertions guide](https://playwright.dev/docs/test-assertions) for more details.

**Usage**

```elixir
enabled = Page.get_by_role(page, :button) |> Locator.is_enabled!()
```

*Since Playwright 1.14.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `is_enabled!`

```elixir
@spec is_enabled!(t(), is_enabled_options()) :: boolean()
```

Like `is_enabled/2`, but returns the value and raises on error.

# `is_hidden`

```elixir
@spec is_hidden(t(), is_hidden_options()) ::
  {:ok, boolean()} | {:error, Playwright.error()}
```

Returns whether the element is hidden, the opposite of [visible](https://playwright.dev/docs/actionability#visible).

> #### Asserting visibility {: .warning}
>
> If you need to assert that element is hidden, prefer `Playwright.Expect.to_be_hidden/2` to avoid flakiness. See [assertions guide](https://playwright.dev/docs/test-assertions) for more details.

**Usage**

```elixir
hidden = Page.get_by_role(page, :button) |> Locator.is_hidden!()
```

*Since Playwright 1.14.*

## Options

* `:timeout` (`t:number/0` | `:infinity`) - This option is ignored. `Playwright.Locator.is_hidden/2` does not wait for the element to become hidden and returns immediately.

# `is_hidden!`

```elixir
@spec is_hidden!(t(), is_hidden_options()) :: boolean()
```

Like `is_hidden/2`, but returns the value and raises on error.

# `is_visible`

```elixir
@spec is_visible(t(), is_visible_options()) ::
  {:ok, boolean()} | {:error, Playwright.error()}
```

Returns whether the element is [visible](https://playwright.dev/docs/actionability#visible).

> #### Asserting visibility {: .warning}
>
> If you need to assert that element is visible, prefer `Playwright.Expect.to_be_visible/2` to avoid flakiness. See [assertions guide](https://playwright.dev/docs/test-assertions) for more details.

**Usage**

```elixir
visible = Page.get_by_role(page, :button) |> Locator.is_visible!()
```

*Since Playwright 1.14.*

## Options

* `:timeout` (`t:number/0` | `:infinity`) - This option is ignored. `Playwright.Locator.is_visible/2` does not wait for the element to become visible and returns immediately.

# `is_visible!`

```elixir
@spec is_visible!(t(), is_visible_options()) :: boolean()
```

Like `is_visible/2`, but returns the value and raises on error.

# `last`

```elixir
@spec last(t()) :: t()
```

Returns locator to the last matching element.

**Usage**

```elixir
banana = Page.get_by_role(page, :listitem) |> Locator.last()
```

*Since Playwright 1.14.*

# `locator`

```elixir
@spec locator(t(), String.t() | t(), locator_options()) :: t()
```

The method finds an element matching the specified selector in the locator's subtree. It also accepts filter options, similar to `Playwright.Locator.filter/2` method.

[Learn more about locators](https://playwright.dev/docs/locators).

*Since Playwright 1.14.*

## Arguments

* `selector_or_locator` - A selector or locator to use when resolving DOM element.

## Options

* `:has` (`t:Playwright.Locator.t/0`) - Narrows down the results of the method to those which contain elements matching this relative locator.
  For example, `article` that has `text=Playwright` matches `<article><div>Playwright</div></article>`.

  Inner locator **must be relative** to the outer locator and is queried starting with the outer locator match, not the document root. For example, you can find `content` that has `div` in `<article><content><div>Playwright</div></content></article>`. However, looking for `content` that has `article div` will fail, because the inner locator must be relative and should not use any elements outside the `content`.

  Note that outer and inner locators must belong to the same frame. Inner locator must not contain [`FrameLocator`](`Playwright.FrameLocator`)s.
* `:has_not` (`t:Playwright.Locator.t/0`) - *Since Playwright 1.33.* Matches elements that do not contain an element that matches an inner locator. Inner locator is queried against the outer one.
  For example, `article` that does not have `div` matches `<article><span>Playwright</span></article>`.

  Note that outer and inner locators must belong to the same frame. Inner locator must not contain [`FrameLocator`](`Playwright.FrameLocator`)s.
* `:has_not_text` (`t:String.t/0` | `t:Regex.t/0` | `t:Playwright.RegExp.t/0`) - *Since Playwright 1.33.* Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element. When passed a `string`, matching is case-insensitive and searches for a substring.
* `:has_text` (`t:String.t/0` | `t:Regex.t/0` | `t:Playwright.RegExp.t/0`) - Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When passed a `string`, matching is case-insensitive and searches for a substring.
  For example, `"Playwright"` matches `<article><div>Playwright</div></article>`.

# `normalize`

```elixir
@spec normalize(t()) :: {:ok, t()} | {:error, Playwright.error()}
```

Returns a new locator that uses best practices for referencing the matched element, prioritizing test ids,
aria roles, and other user-facing attributes over CSS selectors. This is useful for converting implementation-detail selectors into more resilient, human-readable locators.

**Usage**

An agent can pick an element by its ref from an `Playwright.Page.aria_snapshot/2` taken in the `"ai"` mode. Refs only
work for the latest snapshot. Normalize the ref locator and convert it to a string to get resilient locator code
in your language, the same way `codegen` does.

Consider the following aria snapshot.

```yaml
- button "Submit" [ref=e2]
```

You can turn the ref into locator code:

```elixir
normalized = Page.get_by_ref(page, "e2") |> Locator.normalize!()
# prints Page.get_by_role(page, :button, name: "Submit")
IO.puts(Locator.to_string(normalized))
```

*Since Playwright 1.59.*

# `normalize!`

```elixir
@spec normalize!(t()) :: t()
```

Like `normalize/1`, but returns the value and raises on error.

# `nth`

```elixir
@spec nth(t(), integer()) :: t()
```

Returns locator to the n-th matching element. It's zero based, `nth(0)` selects the first element.

**Usage**

```elixir
banana = Page.get_by_role(page, :listitem) |> Locator.nth(2)
```

*Since Playwright 1.14.*

# `or_`

```elixir
@spec or_(t(), t()) :: t()
```

Creates a locator matching all elements that match one or both of the two locators.

Note that when both locators match something, the resulting locator will have multiple matches, potentially causing a [locator strictness](https://playwright.dev/docs/locators#strictness) violation.

**Usage**

Consider a scenario where you'd like to click on a "New email" button, but sometimes a security settings dialog shows up instead. In this case, you can wait for either a "New email" button, or a dialog and act accordingly.

> #### Note {: .info}
>
> If both "New email" button and security dialog appear on screen, the "or" locator will match both of them,
> possibly failing with the ["strict mode violation" error](https://playwright.dev/docs/locators#strictness). In this case, you can use `Playwright.Locator.first/1` to only match one of them.

```elixir
new_email = Page.get_by_role(page, :button, name: "New")
dialog = Page.get_by_text(page, "Confirm security settings")
new_email |> Locator.or_(dialog) |> Locator.first() |> Expect.to_be_visible!()

if Locator.is_visible!(dialog) do
  Page.get_by_role(page, :button, name: "Dismiss") |> Locator.click!()
end

Locator.click!(new_email)
```

*Since Playwright 1.33.*

## Arguments

* `other_locator` - Alternative locator to match.

# `page`

```elixir
@spec page(t()) :: Playwright.Page.t()
```

A page this locator belongs to.

*Since Playwright 1.19.*

# `press`

```elixir
@spec press(t(), String.t(), press_options()) :: :ok | {:error, Playwright.error()}
```

Focuses the matching element and presses a combination of the keys.

**Usage**

```elixir
Page.get_by_role(page, :textbox) |> Locator.press!("Backspace")
```

**Details**

Focuses the element, and then uses `Playwright.Keyboard.down/2` and `Playwright.Keyboard.up/2`.

`key` can specify the intended
[keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value or a single character to
generate the text for. A superset of the `key` values can be found
[here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values). Examples of the keys are:

`F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`,
`Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`, etc.

Following modification shortcuts are also supported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`, `ControlOrMeta`.
`ControlOrMeta` resolves to `Control` on Windows and Linux and to `Meta` on macOS.

Holding down `Shift` will type the text that corresponds to the `key` in the upper case.

If `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different
respective texts.

Shortcuts such as `key: "Control+o"`, `key: "Control++` or `key: "Control+Shift+T"` are supported as well. When specified with the
modifier, modifier is pressed and being held while the subsequent key is being pressed.

*Since Playwright 1.14.*

## Arguments

* `key` - Name of the key to press or a character to generate, such as `ArrowLeft` or `a`.

## Options

* `:delay` (`t:number/0`) - Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.
* `:no_wait_after` (`t:boolean/0`) - Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
  opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating
  to inaccessible pages. Defaults to `false`.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `press!`

```elixir
@spec press!(t(), String.t(), press_options()) :: :ok
```

Like `press/3`, but returns the value and raises on error.

# `press_sequentially`

```elixir
@spec press_sequentially(t(), String.t(), press_sequentially_options()) ::
  :ok | {:error, Playwright.error()}
```

> #### Tip {: .tip}
>
> In most cases, you should use `Playwright.Locator.fill/3` instead. You only need to press keys one by one if there is special keyboard handling on the page.

Focuses the element, and then sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.

To press a special key, like `Control` or `ArrowDown`, use `Playwright.Locator.press/3`.

**Usage**

```elixir
# Types instantly
Locator.press_sequentially!(locator, "Hello")
# Types slower, like a user
Locator.press_sequentially!(locator, "World", delay: 100)
```

An example of typing into a text field and then submitting the form:

```elixir
locator = Page.get_by_label(page, "Password")
Locator.press_sequentially!(locator, "my password")
Locator.press!(locator, "Enter")
```

*Since Playwright 1.38.*

## Arguments

* `text` - String of characters to sequentially press into a focused element.

## Options

* `:delay` (`t:number/0`) - Time to wait between key presses in milliseconds. Defaults to 0.
* `:no_wait_after` (`t:boolean/0`) - This option has no effect.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `press_sequentially!`

```elixir
@spec press_sequentially!(t(), String.t(), press_sequentially_options()) :: :ok
```

Like `press_sequentially/3`, but returns the value and raises on error.

# `screenshot`

```elixir
@spec screenshot(t(), screenshot_options()) ::
  {:ok, binary()} | {:error, Playwright.error()}
```

Take a screenshot of the element matching the locator.

**Usage**

```elixir
Page.get_by_role(page, :link) |> Locator.screenshot!()
```

Disable animations and save screenshot to a file:

```elixir
Page.get_by_role(page, :link) |> Locator.screenshot!(animations: :disabled, path: "link.png")
```

**Details**

This method captures a screenshot of the page, clipped to the size and position of a particular element matching the locator. If the element is covered by other elements, it will not be actually visible on the screenshot. If the element is a scrollable container, only the currently scrolled content will be visible on the screenshot.

This method waits for the [actionability](https://playwright.dev/docs/actionability) checks, then scrolls element into view before taking a
screenshot. If the element is detached from DOM, the method fails.

Returns the buffer with the captured screenshot.

*Since Playwright 1.14.*

## Options

* `:animations` (`:disabled` | `:allow`) - When set to `:disabled`, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment depending on their duration:

  * finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.
  * infinite animations are canceled to initial state, and then played over after the screenshot.

  Defaults to `:allow` that leaves animations untouched.
* `:caret` (`:hide` | `:initial`) - When set to `:hide`, screenshot will hide text caret. When set to `:initial`, text caret behavior will not be changed.  Defaults to `:hide`.
* `:mask` (list of `t:Playwright.Locator.t/0`) - Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with
  a pink box `#FF00FF` (customized by `:mask_color`) that completely covers its bounding box.
  The mask is also applied to invisible elements, see [Matching only visible elements](https://playwright.dev/docs/locators#matching-only-visible-elements) to disable that.
* `:mask_color` (`t:String.t/0`) - *Since Playwright 1.35.* Specify the color of the overlay box for masked elements, in [CSS color format](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). Default color is pink `#FF00FF`.
* `:omit_background` (`t:boolean/0`) - Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images.
  Defaults to `false`.
* `:path` (`t:String.t/0`) - The file path to save the image to. The screenshot type will be inferred from file extension. If `:path` is a
  relative path, then it is resolved relative to the current working directory. If no path is provided, the image won't be
  saved to the disk.
* `:quality` (`t:integer/0`) - The quality of the image, between 0-100. Not applicable to `png` images. For `jpeg` the default is `80`.
  For `webp`, a quality of `100` (the default) produces a lossless image, while lower values use lossy compression.
* `:scale` (`:css` | `:device`) - When set to `:css`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this will keep screenshots small. Using `:device` option will produce a single pixel per each device pixel, so screenshots of high-dpi devices will be twice as large or even larger.

  Defaults to `:device`.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:style` (`t:String.t/0`) - *Since Playwright 1.41.* Text of the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make elements invisible
  or change their properties to help you creating repeatable screenshots. This stylesheet pierces the Shadow DOM and applies
  to the inner frames.
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.
* `:type` (`:png` | `:jpeg` | `:webp`) - Specify screenshot type, defaults to `:png`.

# `screenshot!`

```elixir
@spec screenshot!(t(), screenshot_options()) :: binary()
```

Like `screenshot/2`, but returns the value and raises on error.

# `scroll_into_view_if_needed`

```elixir
@spec scroll_into_view_if_needed(t(), scroll_into_view_if_needed_options()) ::
  :ok | {:error, Playwright.error()}
```

This method waits for [actionability](https://playwright.dev/docs/actionability) checks, then tries to scroll element into view, unless it is
completely visible as defined by
[IntersectionObserver](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API)'s `ratio`.

See [scrolling](https://playwright.dev/docs/input#scrolling) for alternative ways to scroll.

*Since Playwright 1.14.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `scroll_into_view_if_needed!`

```elixir
@spec scroll_into_view_if_needed!(t(), scroll_into_view_if_needed_options()) :: :ok
```

Like `scroll_into_view_if_needed/2`, but returns the value and raises on error.

# `select_option`

```elixir
@spec select_option(
  t(),
  :null
  | String.t()
  | Playwright.ElementHandle.t()
  | [String.t()]
  | %{
      optional(:value) =&gt; String.t(),
      optional(:label) =&gt; String.t(),
      optional(:index) =&gt; integer(),
      optional(:valueOrLabel) =&gt; String.t()
    }
  | [Playwright.ElementHandle.t()]
  | [
      %{
        optional(:value) =&gt; String.t(),
        optional(:label) =&gt; String.t(),
        optional(:index) =&gt; integer(),
        optional(:valueOrLabel) =&gt; String.t()
      }
    ],
  select_option_options()
) :: {:ok, [String.t()]} | {:error, Playwright.error()}
```

Selects option or options in `<select>`.

**Details**

This method waits for [actionability](https://playwright.dev/docs/actionability) checks, waits until all specified options are present in the `<select>` element and selects these options.

If the target element is not a `<select>` element, this method fails. However, if the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be used instead.

Returns the array of option values that have been successfully selected.

Triggers a `change` and `input` event once all the provided options have been selected.

**Usage**

```html
<select multiple>
  <option value="red">Red</option>
  <option value="green">Green</option>
  <option value="blue">Blue</option>
</select>
```

```elixir
# single selection matching the value or label
Locator.select_option!(element, "blue")

# single selection matching the label
Locator.select_option!(element, %{label: "Blue"})

# multiple selection for red, green and blue options
Locator.select_option!(element, ["red", "green", "blue"])
```

*Since Playwright 1.14.*

## Arguments

* `values` - Options to select. If the `<select>` has the `multiple` attribute, all matching options are selected, otherwise only the
  first option matching one of the passed options is selected. String values are matching both values and labels. Option
  is considered matching if all specified properties match.
  * `:value` - Matches by `option.value`. Optional.
  * `:label` - Matches by `option.label`. Optional.
  * `:index` - Matches by the index. Optional.
  * `:valueOrLabel` - Matches by value or label, as a string does. Combines such a match with `index` in one list.

## Options

* `:force` (`t:boolean/0`) - Whether to bypass the [actionability](https://playwright.dev/docs/actionability) checks. Defaults to `false`.
* `:no_wait_after` (`t:boolean/0`) - This option has no effect.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `select_option!`

```elixir
@spec select_option!(
  t(),
  :null
  | String.t()
  | Playwright.ElementHandle.t()
  | [String.t()]
  | %{
      optional(:value) =&gt; String.t(),
      optional(:label) =&gt; String.t(),
      optional(:index) =&gt; integer(),
      optional(:valueOrLabel) =&gt; String.t()
    }
  | [Playwright.ElementHandle.t()]
  | [
      %{
        optional(:value) =&gt; String.t(),
        optional(:label) =&gt; String.t(),
        optional(:index) =&gt; integer(),
        optional(:valueOrLabel) =&gt; String.t()
      }
    ],
  select_option_options()
) :: [String.t()]
```

Like `select_option/3`, but returns the value and raises on error.

# `select_text`

```elixir
@spec select_text(t(), select_text_options()) :: :ok | {:error, Playwright.error()}
```

This method waits for [actionability](https://playwright.dev/docs/actionability) checks, then focuses the element and selects all its text
content.

If the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), focuses and selects text in the control instead.

*Since Playwright 1.14.*

## Options

* `:force` (`t:boolean/0`) - Whether to bypass the [actionability](https://playwright.dev/docs/actionability) checks. Defaults to `false`.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `select_text!`

```elixir
@spec select_text!(t(), select_text_options()) :: :ok
```

Like `select_text/2`, but returns the value and raises on error.

# `set_checked`

```elixir
@spec set_checked(t(), boolean(), set_checked_options()) ::
  :ok | {:error, Playwright.error()}
```

Set the state of a checkbox or a radio element.

**Usage**

```elixir
Page.get_by_role(page, :checkbox) |> Locator.set_checked!(true)
```

**Details**

This method checks or unchecks an element by performing the following steps:

1. Ensure that matched element is a checkbox or a radio input. If not, this method fails.
1. If the element already has the right checked state, this method returns immediately.
1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `:force` option is
   set. If the element is detached during the checks, the whole action is retried.
1. Scroll the element into view if needed.
1. Use `Playwright.Page.mouse/1` to click in the center of the element.
1. Ensure that the element is now checked or unchecked. If not, this method fails.

When all steps combined have not finished during the specified `:timeout`, this method fails with a
[`TimeoutError`](`Playwright.TimeoutError`). Passing zero timeout disables this.

*Since Playwright 1.15.*

## Arguments

* `checked` - Whether to check or uncheck the checkbox.

## Options

* `:force` (`t:boolean/0`) - Whether to bypass the [actionability](https://playwright.dev/docs/actionability) checks. Defaults to `false`.
* `:no_wait_after` (`t:boolean/0`) - This option has no effect.
* `:position` (`t:map/0`) - A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
  element.
  * `:x`
  * `:y`
* `:scroll` (`:auto` | `:none`) - *Since Playwright 1.62.* Controls whether Playwright scrolls the element into view before performing the action. Defaults to `:auto`,
  which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to
  `:none`, Playwright does not scroll the element and the action fails if the element is not already in the viewport.
  This is useful to assert that an element is reachable by the user without additional scrolling.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.
* `:trial` (`t:boolean/0`) - When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it.

# `set_checked!`

```elixir
@spec set_checked!(t(), boolean(), set_checked_options()) :: :ok
```

Like `set_checked/3`, but returns the value and raises on error.

# `set_input_files`

```elixir
@spec set_input_files(
  t(),
  String.t()
  | [String.t()]
  | %{name: String.t(), mimeType: String.t(), buffer: binary()}
  | [%{name: String.t(), mimeType: String.t(), buffer: binary()}],
  set_input_files_options()
) :: :ok | {:error, Playwright.error()}
```

Upload file or multiple files into `<input type=file>`.
For inputs with a `[webkitdirectory]` attribute, only a single directory path is supported.

**Usage**

```elixir
# Select one file
Page.get_by_label(page, "Upload file") |> Locator.set_input_files!(Path.join(__DIR__, "myfile.pdf"))

# Select multiple files
Page.get_by_label(page, "Upload files")
|> Locator.set_input_files!([Path.join(__DIR__, "file1.txt"), Path.join(__DIR__, "file2.txt")])

# Select a directory
Page.get_by_label(page, "Upload directory") |> Locator.set_input_files!(Path.join(__DIR__, "mydir"))

# Remove all the selected files
Page.get_by_label(page, "Upload file") |> Locator.set_input_files!([])

# Upload buffer from memory
Page.get_by_label(page, "Upload file")
|> Locator.set_input_files!(%{name: "file.txt", mimeType: "text/plain", buffer: "this is test"})
```

**Details**

Sets the value of the file input to these file paths or files. If some of the `files` are relative paths, then they
are resolved relative to the current working directory. For empty array, clears the selected files.

This method expects [`Locator`](`Playwright.Locator`) to point to an
[input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). However, if the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), targets the control instead.

*Since Playwright 1.14.*

## Arguments

* `files`
  * `:name` - File name
  * `:mimeType` - File type
  * `:buffer` - File content

## Options

* `:no_wait_after` (`t:boolean/0`) - This option has no effect.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `set_input_files!`

```elixir
@spec set_input_files!(
  t(),
  String.t()
  | [String.t()]
  | %{name: String.t(), mimeType: String.t(), buffer: binary()}
  | [%{name: String.t(), mimeType: String.t(), buffer: binary()}],
  set_input_files_options()
) :: :ok
```

Like `set_input_files/3`, but returns the value and raises on error.

# `tap`

```elixir
@spec tap(t(), tap_options()) :: :ok | {:error, Playwright.error()}
```

Perform a tap gesture on the element matching the locator. For examples of emulating other gestures by manually dispatching touch events, see the [emulating legacy touch events](https://playwright.dev/docs/touch-events) page.

**Details**

This method taps the element by performing the following steps:

1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the element, unless `:force` option is set.
1. Scroll the element into view if needed.
1. Use `Playwright.Page.touchscreen/1` to tap the center of the element, or the specified `:position`.

If the element is detached from the DOM at any moment during the action, this method fails.

When all steps combined have not finished during the specified `:timeout`, this method fails with a
[`TimeoutError`](`Playwright.TimeoutError`). Passing zero timeout disables this.

> #### Note {: .info}
>
> `Playwright.Locator.tap/2` requires that the `:has_touch` option of the browser context be set to true.

*Since Playwright 1.14.*

## Options

* `:force` (`t:boolean/0`) - Whether to bypass the [actionability](https://playwright.dev/docs/actionability) checks. Defaults to `false`.
* `:modifiers` (list of `:alt` | `:control` | `:control_or_meta` | `:meta` | `:shift`) - Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current
  modifiers back. If not specified, currently pressed modifiers are used. "ControlOrMeta" resolves to "Control" on Windows
  and Linux and to "Meta" on macOS.
* `:no_wait_after` (`t:boolean/0`) - This option has no effect.
* `:position` (`t:map/0`) - A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
  element.
  * `:x`
  * `:y`
* `:scroll` (`:auto` | `:none`) - *Since Playwright 1.62.* Controls whether Playwright scrolls the element into view before performing the action. Defaults to `:auto`,
  which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to
  `:none`, Playwright does not scroll the element and the action fails if the element is not already in the viewport.
  This is useful to assert that an element is reachable by the user without additional scrolling.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.
* `:trial` (`t:boolean/0`) - When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it. Note that keyboard `:modifiers` will be pressed regardless of `:trial` to allow testing elements which are only visible when those keys are pressed.

# `tap!`

```elixir
@spec tap!(t(), tap_options()) :: :ok
```

Like `tap/2`, but returns the value and raises on error.

# `text_content`

```elixir
@spec text_content(t(), text_content_options()) ::
  {:ok, nil | String.t()} | {:error, Playwright.error()}
```

Returns the [`node.textContent`](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent).

> #### Asserting text {: .warning}
>
> If you need to assert text on the page, prefer `Playwright.Expect.to_have_text/3` to avoid flakiness. See [assertions guide](https://playwright.dev/docs/test-assertions) for more details.

*Since Playwright 1.14.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `text_content!`

```elixir
@spec text_content!(t(), text_content_options()) :: nil | String.t()
```

Like `text_content/2`, but returns the value and raises on error.

# `to_string`

```elixir
@spec to_string(t()) :: String.t()
```

Returns a human-readable representation of the locator, using the `Playwright.Locator.description/1` if one exists; otherwise, it generates a string based on the locator's selector.

*Since Playwright 1.57.*

# `type`

> This function is deprecated. In most cases, you should use Playwright.Locator.fill/3 instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use Playwright.Locator.press_sequentially/3.

```elixir
@spec type(t(), String.t(), type_options()) :: :ok | {:error, Playwright.error()}
```

Focuses the element, and then sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.

To press a special key, like `Control` or `ArrowDown`, use `Playwright.Locator.press/3`.

**Usage**

*Since Playwright 1.14.*

## Arguments

* `text` - A text to type into a focused element.

## Options

* `:delay` (`t:number/0`) - Time to wait between key presses in milliseconds. Defaults to 0.
* `:no_wait_after` (`t:boolean/0`) - This option has no effect.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `type!`

> This function is deprecated. In most cases, you should use Playwright.Locator.fill/3 instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use Playwright.Locator.press_sequentially/3.

```elixir
@spec type!(t(), String.t(), type_options()) :: :ok
```

Like `type/3`, but returns the value and raises on error.

# `uncheck`

```elixir
@spec uncheck(t(), uncheck_options()) :: :ok | {:error, Playwright.error()}
```

Ensure that checkbox or radio element is unchecked.

**Usage**

```elixir
Page.get_by_role(page, :checkbox) |> Locator.uncheck!()
```

**Details**

This method unchecks the element by performing the following steps:

1. Ensure that element is a checkbox or a radio input. If not, this method fails. If the element is already
   unchecked, this method returns immediately.
1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the element, unless `:force` option is set.
1. Scroll the element into view if needed.
1. Use `Playwright.Page.mouse/1` to click in the center of the element.
1. Ensure that the element is now unchecked. If not, this method fails.

If the element is detached from the DOM at any moment during the action, this method fails.

When all steps combined have not finished during the specified `:timeout`, this method fails with a
[`TimeoutError`](`Playwright.TimeoutError`). Passing zero timeout disables this.

*Since Playwright 1.14.*

## Options

* `:force` (`t:boolean/0`) - Whether to bypass the [actionability](https://playwright.dev/docs/actionability) checks. Defaults to `false`.
* `:no_wait_after` (`t:boolean/0`) - This option has no effect.
* `:position` (`t:map/0`) - A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
  element.
  * `:x`
  * `:y`
* `:scroll` (`:auto` | `:none`) - *Since Playwright 1.62.* Controls whether Playwright scrolls the element into view before performing the action. Defaults to `:auto`,
  which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to
  `:none`, Playwright does not scroll the element and the action fails if the element is not already in the viewport.
  This is useful to assert that an element is reachable by the user without additional scrolling.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.
* `:trial` (`t:boolean/0`) - When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it.

# `uncheck!`

```elixir
@spec uncheck!(t(), uncheck_options()) :: :ok
```

Like `uncheck/2`, but returns the value and raises on error.

# `visible`

```elixir
@spec visible(t()) :: t()
```

Returns a locator that matches only [visible](https://playwright.dev/docs/actionability#visible) elements, ignoring the invisible ones. This is the recommended way to distinguish elements by visibility, as opposed to the `:visible` CSS pseudo-class.

Note that visibility is checked every time the locator is used, and not at the moment of the `Playwright.Locator.visible/1` call.

**Usage**

Consider a page with two buttons, the first invisible and the second visible.

```html
<button style='display: none'>Invisible</button>
<button>Visible</button>
```

This will only find the second button, because it is visible, and then click it.

```elixir
Page.locator(page, "button") |> Locator.visible() |> Locator.click!()
```

To match invisible elements instead, use `Playwright.Locator.filter/2` with the `visible` option set to `false`.

*Since Playwright 1.63.*

# `wait_for`

```elixir
@spec wait_for(t(), wait_for_options()) :: :ok | {:error, Playwright.error()}
```

Returns when element specified by locator satisfies the `:state` option.

If target element already satisfies the condition, the method returns immediately. Otherwise, waits for up to
`:timeout` milliseconds until the condition is met.

**Usage**

```elixir
order_sent = Page.locator(page, "#order-sent")
Locator.wait_for!(order_sent)
```

*Since Playwright 1.16.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:state` (`:attached` | `:detached` | `:visible` | `:hidden`) - Defaults to `:visible`. Can be either:

  * `:attached` - wait for element to be present in DOM.
  * `:detached` - wait for element to not be present in DOM.
  * `:visible` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element without
    any content or with `display:none` has an empty bounding box and is not considered visible.
  * `:hidden` - wait for element to be either detached from DOM, or have an empty bounding box or `visibility:hidden`.
    This is opposite to the `:visible` option.
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by
  using the `Playwright.BrowserContext.set_default_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `wait_for!`

```elixir
@spec wait_for!(t(), wait_for_options()) :: :ok
```

Like `wait_for/2`, but returns the value and raises on error.

# `wait_for_function`

```elixir
@spec wait_for_function(t(), String.t(), term() | nil, wait_for_function_options()) ::
  :ok | {:error, Playwright.error()}
```

Returns when `expression` returns a truthy value, called with the matching element as a first argument, and `arg` as a second argument.

This is a generic way to wait for an element to reach a custom condition without asserting it. The locator is re-resolved on each retry, so it tolerates the element being re-rendered while waiting.

If `expression` returns a `Promise`, this method will wait for the promise to resolve before checking its value.

If `expression` throws or rejects, this method fails.

**Usage**

Wait for an attribute to appear:

```elixir
toggle = Page.get_by_role(page, :button, name: "Menu")
Locator.click!(toggle)
Locator.wait_for_function!(toggle, "element => element.hasAttribute('aria-expanded')")
```

Passing argument to `expression`:

```elixir
Page.get_by_test_id(page, "status")
|> Locator.wait_for_function!("(element, value) => element.textContent === value", "Ready")
```

*Since Playwright 1.62.*

## Arguments

* `expression` - Function to be evaluated in the page context.
* `arg` - Optional argument to pass to `expression`.

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default
  value can be changed by using the `Playwright.BrowserContext.set_default_timeout/2` or `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `wait_for_function!`

```elixir
@spec wait_for_function!(t(), String.t(), term() | nil, wait_for_function_options()) ::
  :ok
```

Like `wait_for_function/4`, but returns the value and raises on error.

# `within`

```elixir
@spec within(t(), t()) :: t()
```

Returns a locator that matches this locator's elements inside each element matched by `other_locator`.

Note that relative locators, such as `Playwright.Locator.nth/2` or `Playwright.Locator.first/1`, are resolved separately inside each matched parent. In the example below, `Page.get_by_role(page, :cell) |> Locator.nth(2)` picks the third cell of every row, not the third cell in the whole table.

**Usage**

```elixir
third_column = Page.get_by_role(page, :cell) |> Locator.nth(2) |> Locator.within(Page.get_by_role(page, :row))
Expect.to_have_text!(third_column, ["Apple", "Banana", "Cherry"])
```

*Since Playwright 1.64.*

## Arguments

* `other_locator` - Locator matching the parent elements to search within.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
