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

At every point of time, page exposes its current frame tree via the `Playwright.Page.main_frame/1` and
`Playwright.Frame.child_frames/1` methods.

[`Frame`](`Playwright.Frame`) object's lifecycle is controlled by three events, dispatched on the page object:

* [`Page.on(:frame_attached)`](Playwright.Page.html#module-frame_attached) - fired when the frame gets attached to the page. A Frame can be attached to the page
  only once.
* [`Page.on(:frame_navigated)`](Playwright.Page.html#module-frame_navigated) - fired when the frame commits navigation to a different URL.
* [`Page.on(:frame_detached)`](Playwright.Page.html#module-frame_detached) - fired when the frame gets detached from the page.  A Frame can be detached from the
  page only once.

An example of dumping frame tree:

```elixir
dump_frame_tree = fn dump_frame_tree, frame, indent ->
  IO.puts(indent <> Frame.url(frame))
  for child <- Frame.child_frames(frame), do: dump_frame_tree.(dump_frame_tree, child, indent <> "  ")
end

# Or Playwright.chromium/1 or Playwright.webkit/1.
browser = Playwright.firefox(playwright) |> BrowserType.launch!()
page = Browser.new_page!(browser)
Page.goto!(page, "https://www.google.com/chrome/browser/canary.html")
dump_frame_tree.(dump_frame_tree, Page.main_frame(page), "")
Browser.close!(browser)
```

*Since Playwright 1.8.*

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

# `add_script_tag_options`

```elixir
@type add_script_tag_options() ::
  [content: String.t(), path: String.t(), type: String.t(), url: String.t()]
  | %{
      optional(:content) =&gt; String.t(),
      optional(:path) =&gt; String.t(),
      optional(:type) =&gt; String.t(),
      optional(:url) =&gt; String.t()
    }
```

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

# `add_style_tag_options`

```elixir
@type add_style_tag_options() ::
  [content: String.t(), path: String.t(), url: String.t()]
  | %{
      optional(:content) =&gt; String.t(),
      optional(:path) =&gt; String.t(),
      optional(:url) =&gt; String.t()
    }
```

Options of `add_style_tag/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(),
    strict: boolean(),
    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(:strict) =&gt; boolean(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:trial) =&gt; boolean()
    }
```

Options of `check/3`, 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(),
    strict: boolean(),
    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(:strict) =&gt; boolean(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:trial) =&gt; boolean()
    }
```

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

# `content_options`

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

Options of `content/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(),
    strict: boolean(),
    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(:strict) =&gt; boolean(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:trial) =&gt; boolean()
    }
```

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

# `dispatch_event_options`

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

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

# `drag_and_drop_options`

```elixir
@type drag_and_drop_options() ::
  [
    force: boolean(),
    no_wait_after: boolean(),
    scroll: :auto | :none,
    signal: Playwright.AbortSignal.t(),
    source_position: %{x: number(), y: number()},
    steps: integer(),
    strict: boolean(),
    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(:strict) =&gt; boolean(),
      optional(:target_position) =&gt; %{x: number(), y: number()},
      optional(:timeout) =&gt; number() | :infinity,
      optional(:trial) =&gt; boolean()
    }
```

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

# `evaluate_handle_options`

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

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

# `evaluate_options`

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

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

# `expect_navigation_options`

```elixir
@type expect_navigation_options() ::
  [
    timeout: number() | :infinity,
    url:
      String.t() | Regex.t() | Playwright.RegExp.t() | (URI.t() -&gt; boolean()),
    wait_until: :load | :domcontentloaded | :networkidle | :commit,
    signal: Playwright.AbortSignal.t()
  ]
  | %{
      optional(:timeout) =&gt; number() | :infinity,
      optional(:url) =&gt;
        String.t() | Regex.t() | Playwright.RegExp.t() | (URI.t() -&gt; boolean()),
      optional(:wait_until) =&gt;
        :load | :domcontentloaded | :networkidle | :commit,
      optional(:signal) =&gt; Playwright.AbortSignal.t()
    }
```

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

# `fill_options`

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

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

# `focus_options`

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

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

# `get_attribute_options`

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

Options of `get_attribute/4`, 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.

# `goto_options`

```elixir
@type goto_options() ::
  [
    referer: String.t(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity,
    wait_until: :load | :domcontentloaded | :networkidle | :commit
  ]
  | %{
      optional(:referer) =&gt; String.t(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:wait_until) =&gt;
        :load | :domcontentloaded | :networkidle | :commit
    }
```

Options of `goto/3`, 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(),
    strict: boolean(),
    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(:strict) =&gt; boolean(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:trial) =&gt; boolean()
    }
```

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

# `inner_html_options`

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

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

# `inner_text_options`

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

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

# `input_value_options`

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

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

# `is_checked_options`

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

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

# `is_disabled_options`

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

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

# `is_editable_options`

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

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

# `is_enabled_options`

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

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

# `is_hidden_options`

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

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

# `is_visible_options`

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

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

# `locator_options`

```elixir
@type locator_options() ::
  [
    has: Playwright.Locator.t(),
    has_not: Playwright.Locator.t(),
    has_not_text: String.t() | Regex.t() | Playwright.RegExp.t(),
    has_text: String.t() | Regex.t() | Playwright.RegExp.t()
  ]
  | %{
      optional(:has) =&gt; Playwright.Locator.t(),
      optional(:has_not) =&gt; Playwright.Locator.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(),
    strict: boolean(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:delay) =&gt; number(),
      optional(:no_wait_after) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:strict) =&gt; boolean(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

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

# `query_selector_options`

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

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

# `select_option_options`

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

Options of `select_option/4`, 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(),
    strict: boolean(),
    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(:strict) =&gt; boolean(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:trial) =&gt; boolean()
    }
```

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

# `set_content_options`

```elixir
@type set_content_options() ::
  [
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity,
    wait_until: :load | :domcontentloaded | :networkidle | :commit
  ]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:wait_until) =&gt;
        :load | :domcontentloaded | :networkidle | :commit
    }
```

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

# `set_input_files_options`

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

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

# `t`

```elixir
@type t() :: %Playwright.Frame{
  conn: term(),
  guid: term(),
  initializer: term(),
  table: term(),
  type: term()
}
```

A `Frame` 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(),
    strict: boolean(),
    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(:strict) =&gt; boolean(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:trial) =&gt; boolean()
    }
```

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

# `text_content_options`

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

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

# `type_options`

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

Options of `type/4`, 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(),
    strict: boolean(),
    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(:strict) =&gt; boolean(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:trial) =&gt; boolean()
    }
```

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

# `wait_for_function_options`

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

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

# `wait_for_load_state_options`

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

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

# `wait_for_navigation_options`

```elixir
@type wait_for_navigation_options() ::
  [
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity,
    url:
      String.t() | Regex.t() | Playwright.RegExp.t() | (URI.t() -&gt; boolean()),
    wait_until: :load | :domcontentloaded | :networkidle | :commit
  ]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:url) =&gt;
        String.t() | Regex.t() | Playwright.RegExp.t() | (URI.t() -&gt; boolean()),
      optional(:wait_until) =&gt;
        :load | :domcontentloaded | :networkidle | :commit
    }
```

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

# `wait_for_selector_options`

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

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

# `wait_for_url_options`

```elixir
@type wait_for_url_options() ::
  [
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity,
    wait_until: :load | :domcontentloaded | :networkidle | :commit
  ]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:wait_until) =&gt;
        :load | :domcontentloaded | :networkidle | :commit
    }
```

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

# `add_script_tag`

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

Returns the added tag when the script's onload fires or when the script content was injected into frame.

Adds a `<script>` tag into the page with the desired url or content.

*Since Playwright 1.8.*

## Options

* `:content` (`t:String.t/0`) - Raw JavaScript content to be injected into frame.
* `:path` (`t:String.t/0`) - Path to the JavaScript file to be injected into frame. If `:path` is a relative path, then it is resolved relative to the
  current working directory.
* `:type` (`t:String.t/0`) - Script type. Use 'module' in order to load a JavaScript ES6 module. See
  [script](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) for more details.
* `:url` (`t:String.t/0`) - URL of a script to be added.

# `add_script_tag!`

```elixir
@spec add_script_tag!(t(), add_script_tag_options()) :: Playwright.ElementHandle.t()
```

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

# `add_style_tag`

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

Returns the added tag when the stylesheet's onload fires or when the CSS content was injected into frame.

Adds a `<link rel="stylesheet">` tag into the page with the desired url or a `<style type="text/css">` tag with the
content.

*Since Playwright 1.8.*

## Options

* `:content` (`t:String.t/0`) - Raw CSS content to be injected into frame.
* `:path` (`t:String.t/0`) - Path to the CSS file to be injected into frame. If `:path` is a relative path, then it is resolved relative to the
  current working directory.
* `:url` (`t:String.t/0`) - URL of the `<link>` tag.

# `add_style_tag!`

```elixir
@spec add_style_tag!(t(), add_style_tag_options()) :: Playwright.ElementHandle.t()
```

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

# `check`

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

This method checks an element matching `selector` by performing the following steps:

1. Find an element matching `selector`. If there is none, wait until a matching element is attached to
   the DOM.
1. Ensure that matched 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 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. 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.

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Locator.check/2` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.8.*

## Arguments

* `selector` - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.

## 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`) - *Since Playwright 1.11.* 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`).
* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `: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`) - *Since Playwright 1.11.* 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(), String.t(), check_options()) :: :ok
```

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

# `child_frames`

```elixir
@spec child_frames(t()) :: [t()]
```

*Since Playwright 1.8.*

# `click`

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

This method clicks an element matching `selector` by performing the following steps:

1. Find an element matching `selector`. If there is none, wait until a matching element is attached to
   the DOM.
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, or the specified `:position`.
1. Wait for initiated navigations to either succeed or fail, unless `:no_wait_after` option is set.

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

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Locator.click/2` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.8.*

## Arguments

* `selector` - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.

## 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`).
* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `: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`) - *Since Playwright 1.11.* 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(), String.t(), click_options()) :: :ok
```

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

# `content`

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

Gets the full HTML contents of the frame, including the doctype.

*Since Playwright 1.8.*

## Options

* `:include_shadow` (`t:boolean/0`) - *Since Playwright 1.64.* When true, contents of open shadow roots are included as [declarative shadow DOM](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_shadow_DOM#declaratively_with_html),
  i.e. `<template shadowrootmode="open">` elements nested inside their host elements. Closed shadow roots are never included. Defaults to `false`.

# `content!`

```elixir
@spec content!(t(), content_options()) :: String.t()
```

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

# `dblclick`

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

This method double clicks an element matching `selector` by performing the following steps:

1. Find an element matching `selector`. If there is none, wait until a matching element is attached to
   the DOM.
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 double click in the center of the element, or the specified `:position`.
   if the first click of the `dblclick()` triggers a navigation event, this method will fail.

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.Frame.dblclick/3` dispatches two `click` events and a single `dblclick` event.

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Locator.dblclick/2` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.8.*

## Arguments

* `selector` - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.

## 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`).
* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `: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`) - *Since Playwright 1.11.* 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(), String.t(), dblclick_options()) :: :ok
```

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

# `dispatch_event`

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

The snippet below 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).

**Usage**

```elixir
Frame.dispatch_event!(frame, "button#submit", "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
# Note you can only create DataTransfer in Chromium and Firefox
data_transfer = Frame.evaluate_handle!(frame, "() => new DataTransfer()")
Frame.dispatch_event!(frame, "#source", "dragstart", %{dataTransfer: data_transfer})
```

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Locator.dispatch_event/4` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.8.*

## Arguments

* `selector` - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
* `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`).
* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `: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(),
  String.t(),
  term() | nil,
  dispatch_event_options()
) :: :ok
```

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

# `drag_and_drop`

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

*Since Playwright 1.13.*

## Arguments

* `source` - A selector to search for an element to drag. If there are multiple elements satisfying the selector, the first will be used.
* `target` - A selector to search for an element to drop onto. If there are multiple elements satisfying the selector, the first will be used.

## 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`) - *Since Playwright 1.14.* 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.
* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `:target_position` (`t:map/0`) - *Since Playwright 1.14.* 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_and_drop!`

```elixir
@spec drag_and_drop!(t(), String.t(), String.t(), drag_and_drop_options()) :: :ok
```

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

# `eval_on_selector`

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

Returns the return value of `expression`.

The method finds an element matching the specified selector within the frame and passes it as a first argument to
`expression`. If no
elements match the selector, the method fails.

If `expression` returns a `Promise`, then `Playwright.Frame.eval_on_selector/4` would wait for the promise to resolve and return its
value.

**Usage**

```elixir
search_value = Frame.eval_on_selector!(frame, "#search", "el => el.value")
preload_href = Frame.eval_on_selector!(frame, "link[rel=preload]", "el => el.href")
html = Frame.eval_on_selector!(frame, ".main-container", "(e, suffix) => e.outerHTML + suffix", "hello")
```

> #### Discouraged {: .warning}
>
> This method does not wait for the element to pass the actionability
> checks and therefore can lead to the flaky tests. Use `Playwright.Locator.evaluate/4`, other [`Locator`](`Playwright.Locator`) helper methods or web-first assertions instead.

*Since Playwright 1.9.*

## Arguments

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

# `eval_on_selector!`

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

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

# `eval_on_selector_all`

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

Returns the return value of `expression`.

The method finds all elements matching the specified selector within the frame and passes an array of matched elements
as a first argument to `expression`.

If `expression` returns a `Promise`, then `Playwright.Frame.eval_on_selector_all/4` would wait for the promise to resolve and return its
value.

**Usage**

```elixir
divs_counts = Frame.eval_on_selector_all!(frame, "div", "(divs, min) => divs.length >= min", 10)
```

> #### Discouraged {: .warning}
>
> In most cases, `Playwright.Locator.evaluate_all/3`,
> other [`Locator`](`Playwright.Locator`) helper methods and web-first assertions do a better job.

*Since Playwright 1.9.*

## Arguments

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

# `eval_on_selector_all!`

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

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

# `evaluate`

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

Returns the return value of `expression`.

If the function passed to the `Playwright.Frame.evaluate/4` returns a `Promise`, then `Playwright.Frame.evaluate/4` would wait for the promise to
resolve and return its value.

If the function passed to the `Playwright.Frame.evaluate/4` returns a non-`Serializable` value, then
`Playwright.Frame.evaluate/4` returns `nil`. Playwright also supports transferring some
additional values that are not serializable by `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`.

**Usage**

```elixir
result = Frame.evaluate!(frame, "([x, y]) => Promise.resolve(x * y)", [7, 8])
# prints "56"
IO.puts(result)
```

A string can also be passed in instead of a function.

```elixir
# prints "3"
IO.puts(Frame.evaluate!(frame, "1 + 2"))
```

[`ElementHandle`](`Playwright.ElementHandle`) instances can be passed as an argument to the `Playwright.Frame.evaluate/4`:

```elixir
body_handle = Frame.evaluate_handle!(frame, "document.body")
html = Frame.evaluate!(frame, "([body, suffix]) => body.innerHTML + suffix", [body_handle, "hello"])
JSHandle.dispose!(body_handle)
```

*Since Playwright 1.8.*

## 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.

# `evaluate!`

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

Like `evaluate/4`, 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()}
```

Returns the return value of `expression` as a [`JSHandle`](`Playwright.JSHandle`).

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

If the function, passed to the `Playwright.Frame.evaluate_handle/4`, returns a `Promise`, then
`Playwright.Frame.evaluate_handle/4` would wait for the promise to resolve and return its value.

**Usage**

```elixir
# Handle for the window object
a_window_handle = Frame.evaluate_handle!(frame, "() => Promise.resolve(window)")
```

A string can also be passed in instead of a function.

```elixir
# Handle for the 'document'.
a_handle = Frame.evaluate_handle!(frame, "document")
```

[`JSHandle`](`Playwright.JSHandle`) instances can be passed as an argument to the `Playwright.Frame.evaluate_handle/4`:

```elixir
a_handle = Frame.evaluate_handle!(frame, "() => document.body")
result_handle = Frame.evaluate_handle!(frame, "([body, suffix]) => body.innerHTML + suffix", [a_handle, "hello"])
IO.puts(JSHandle.json_value!(result_handle))
JSHandle.dispose!(result_handle)
```

*Since Playwright 1.8.*

## 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.

# `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.

# `expect_navigation`

> This function is deprecated. This method is inherently racy, please use Playwright.Frame.wait_for_url/3 instead.

```elixir
@spec expect_navigation(t(), (-&gt; term()), expect_navigation_options()) ::
  {:ok, nil | Playwright.Response.t()} | {:error, Playwright.error()}
```

Waits for the frame navigation and returns the main resource response. In case of multiple redirects, the navigation
returns the response of the last redirect. In case of navigation to a different anchor or navigation due to
History API usage, the navigation returns `nil`.

**Usage**

This method waits for the frame to navigate to a new URL. It is useful for when you run code which will indirectly cause
the frame to navigate. Consider this example:

```elixir
# Start waiting for navigation before clicking: a promise, awaited after.
navigation_promise = Page.wait_for_navigation(page)
Page.get_by_text(page, "Navigate after timeout") |> Locator.click!()
Promise.await!(navigation_promise)
```

> #### Note {: .info}
>
> Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to change the URL is considered
> a navigation.

*Since Playwright 1.8.*

## Arguments

* `action` - A function that performs the action triggering the wait. It runs once the wait is set up; its result is ignored and what it raises propagates.

## Options

* `:timeout` (`t:number/0` | `:infinity`) - Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
  The default value can be changed by using the
  `Playwright.BrowserContext.set_default_navigation_timeout/2`,
  `Playwright.BrowserContext.set_default_timeout/2`,
  `Playwright.Page.set_default_navigation_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.
* `:url` (`t:String.t/0` | `t:Regex.t/0` | `t:Playwright.RegExp.t/0` | `(URI.t() -> boolean())`) - A glob pattern, regex pattern, or predicate receiving `URI` to match while waiting for the navigation. Note that if
  the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly
  equal to the string.
* `:wait_until` (`:load` | `:domcontentloaded` | `:networkidle` | `:commit`) - When to consider operation succeeded, defaults to `:load`. Events can be either:

  * `:domcontentloaded` - consider operation to be finished when the `DOMContentLoaded` event is fired.
  * `:load` - consider operation to be finished when the `load` event is fired.
  * `:networkidle` - **DISCOURAGED** consider operation to be finished when there are no network connections for at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.
  * `:commit` - consider operation to be finished when network response is received and the document started loading.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the waiting using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the waiting will be aborted and the operation will fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.set_default_timeout/2`; pass `timeout: 0` to disable the timeout entirely.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).

# `expect_navigation!`

> This function is deprecated. This method is inherently racy, please use Playwright.Frame.wait_for_url/3 instead.

```elixir
@spec expect_navigation!(t(), (-&gt; term()), expect_navigation_options()) ::
  nil | Playwright.Response.t()
```

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

# `fill`

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

This method waits for an element matching `selector`, 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`.

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Locator.fill/3` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.8.*

## Arguments

* `selector` - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
* `value` - Value to fill for the `<input>`, `<textarea>` or `[contenteditable]` element.

## Options

* `:force` (`t:boolean/0`) - *Since Playwright 1.13.* 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`).
* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `: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(), String.t(), fill_options()) :: :ok
```

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

# `focus`

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

This method fetches an element with `selector` and focuses it. If there's no element matching
`selector`, the method waits until a matching element appears in the DOM.

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Locator.focus/2` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.8.*

## Arguments

* `selector` - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.

## 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`).
* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `: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(), String.t(), focus_options()) :: :ok
```

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

# `frame_element`

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

Returns the `frame` or `iframe` element handle which corresponds to this frame.

This is an inverse of `Playwright.ElementHandle.content_frame/1`. Note that returned handle actually belongs to the parent
frame.

This method fails if the frame has been detached before `frameElement()` returns.

**Usage**

```elixir
frame_element = Frame.frame_element!(frame)
content_frame = ElementHandle.content_frame!(frame_element)
# -> true
IO.puts(frame == content_frame)
```

*Since Playwright 1.8.*

# `frame_element!`

```elixir
@spec frame_element!(t()) :: Playwright.ElementHandle.t()
```

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

# `frame_locator`

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

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

When called without `selector`, the search starts in this frame or in any of the iframes inside it,
so that you don't need to locate each iframe first. Note that the rest of the locator is resolved inside a single
frame, just like any other locator. If it matches elements inside multiple frames, the call fails.

**Usage**

Following snippet locates element with text "Submit" in the iframe with id `my-frame`, like `<iframe id="my-frame">`:

```elixir
locator = Frame.frame_locator(frame, "#my-iframe") |> FrameLocator.get_by_text("Submit")
Locator.click!(locator)
```

Following snippet locates a button, either in the frame or in one of the iframes inside it:

```elixir
locator = Frame.frame_locator(frame) |> FrameLocator.get_by_role(:button)
Locator.click!(locator)
```

*Since Playwright 1.17.*

## Arguments

* `selector` - A selector that matches the frame element. When not specified, locator is matched in this frame or in any of the iframes inside it.

# `get_attribute`

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

Returns element attribute value.

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Locator.get_attribute/3` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.8.*

## Arguments

* `selector` - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
* `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`).
* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `: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(), String.t(), get_attribute_options()) ::
  nil | String.t()
```

Like `get_attribute/4`, 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()
) ::
  Playwright.Locator.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()
) ::
  Playwright.Locator.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()
) :: Playwright.Locator.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()
) :: Playwright.Locator.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()) ::
  Playwright.Locator.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()
) ::
  Playwright.Locator.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()
) ::
  Playwright.Locator.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.

# `goto`

```elixir
@spec goto(t(), String.t(), goto_options()) ::
  {:ok, nil | Playwright.Response.t()} | {:error, Playwright.error()}
```

Returns the main resource response. In case of multiple redirects, the navigation returns the response of the
last redirect.

The method will fail if:

* there's an SSL error (e.g. in case of self-signed certificates).
* target URL is invalid.
* the `:timeout` is exceeded during navigation.
* the remote server does not respond or is unreachable.
* the main resource failed to load.

The method will not fail when any valid HTTP status code is returned by the remote server, including 404
"Not Found" and 500 "Internal Server Error".  The status code for such responses can be retrieved by calling
`Playwright.Response.status/1`.

> #### Note {: .info}
>
> The method either fails or returns a main resource response. The only exceptions are navigation to
> `about:blank` or navigation to the same URL with a different hash, which would succeed and return `nil`.

> #### Note {: .info}
>
> Headless mode doesn't support navigation to a PDF document. See the
> [upstream issue](https://bugs.chromium.org/p/chromium/issues/detail?id=761295).

*Since Playwright 1.8.*

## Arguments

* `url` - URL to navigate frame to. The url should include scheme, e.g. `https://`.

## Options

* `:referer` (`t:String.t/0`) - Referer header value. If provided it will take preference over the referer header value set by
  `Playwright.Page.set_extra_http_headers/2`.
* `: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 operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
  The default value can be changed by using the
  `Playwright.BrowserContext.set_default_navigation_timeout/2`,
  `Playwright.BrowserContext.set_default_timeout/2`,
  `Playwright.Page.set_default_navigation_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.
* `:wait_until` (`:load` | `:domcontentloaded` | `:networkidle` | `:commit`) - When to consider operation succeeded, defaults to `:load`. Events can be either:

  * `:domcontentloaded` - consider operation to be finished when the `DOMContentLoaded` event is fired.
  * `:load` - consider operation to be finished when the `load` event is fired.
  * `:networkidle` - **DISCOURAGED** consider operation to be finished when there are no network connections for at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.
  * `:commit` - consider operation to be finished when network response is received and the document started loading.

# `goto!`

```elixir
@spec goto!(t(), String.t(), goto_options()) :: nil | Playwright.Response.t()
```

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

# `hover`

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

This method hovers over an element matching `selector` by performing the following steps:

1. Find an element matching `selector`. If there is none, wait until a matching element is attached to
   the DOM.
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 hover over the center of the element, or the specified `:position`.

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

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Locator.hover/2` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.8.*

## Arguments

* `selector` - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.

## 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`).
* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `: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`) - *Since Playwright 1.11.* 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(), String.t(), hover_options()) :: :ok
```

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

# `inner_html`

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

Returns `element.innerHTML`.

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Locator.inner_html/2` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.8.*

## Arguments

* `selector` - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.

## 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`).
* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `: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(), String.t(), inner_html_options()) :: String.t()
```

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

# `inner_text`

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

Returns `element.innerText`.

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Locator.inner_text/2` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.8.*

## Arguments

* `selector` - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.

## 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`).
* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `: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(), String.t(), inner_text_options()) :: String.t()
```

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

# `input_value`

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

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

Fails for non-input elements. 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.

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Locator.input_value/2` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.13.*

## Arguments

* `selector` - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.

## 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`).
* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `: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(), String.t(), input_value_options()) :: String.t()
```

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

# `is_checked`

```elixir
@spec is_checked(t(), String.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.

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Locator.is_checked/2` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.8.*

## Arguments

* `selector` - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.

## 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`).
* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `: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(), String.t(), is_checked_options()) :: boolean()
```

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

# `is_detached`

```elixir
@spec is_detached(t()) :: boolean()
```

Returns `true` if the frame has been detached, or `false` otherwise.

*Since Playwright 1.8.*

# `is_disabled`

```elixir
@spec is_disabled(t(), String.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).

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Locator.is_disabled/2` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.8.*

## Arguments

* `selector` - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.

## 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`).
* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `: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(), String.t(), is_disabled_options()) :: boolean()
```

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

# `is_editable`

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

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

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Locator.is_editable/2` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.8.*

## Arguments

* `selector` - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.

## 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`).
* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `: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(), String.t(), is_editable_options()) :: boolean()
```

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

# `is_enabled`

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

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

*Since Playwright 1.8.*

## Arguments

* `selector` - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.

## 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`).
* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `: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(), String.t(), is_enabled_options()) :: boolean()
```

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

# `is_hidden`

```elixir
@spec is_hidden(t(), String.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).  `selector` that does not match any elements is considered hidden.

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Locator.is_hidden/2` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.8.*

## Arguments

* `selector` - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.

## Options

* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `:timeout` (`t:number/0` | `:infinity`) - This option is ignored. `Playwright.Frame.is_hidden/3` does not wait for the element to become hidden and returns immediately.

# `is_hidden!`

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

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

# `is_visible`

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

Returns whether the element is [visible](https://playwright.dev/docs/actionability#visible). `selector` that does not match any elements is considered not visible.

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Locator.is_visible/2` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.8.*

## Arguments

* `selector` - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.

## Options

* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `:timeout` (`t:number/0` | `:infinity`) - This option is ignored. `Playwright.Frame.is_visible/3` does not wait for the element to become visible and returns immediately.

# `is_visible!`

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

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

# `locator`

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

The method returns an element locator that can be used to perform actions on this page / frame.
Locator is resolved to the element immediately before performing an action, so a series of actions on the same locator can in fact be performed on different DOM elements. That would happen if the DOM structure between those actions has changed.

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

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

*Since Playwright 1.14.*

## Arguments

* `selector` - A selector 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>`.

# `name`

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

Returns frame's name attribute as specified in the tag.

If the name is empty, returns the id attribute instead.

> #### Note {: .info}
>
> This value is calculated once when the frame is created, and will not update if the attribute is changed later.

*Since Playwright 1.8.*

# `page`

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

Returns the page containing this frame.

*Since Playwright 1.8.*

# `parent_frame`

```elixir
@spec parent_frame(t()) :: nil | t()
```

Parent frame, if any. Detached frames and main frames return `nil`.

*Since Playwright 1.8.*

# `press`

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

`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.

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Locator.press/3` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.8.*

## Arguments

* `selector` - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
* `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`).
* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `: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(), String.t(), press_options()) :: :ok
```

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

# `query_selector`

```elixir
@spec query_selector(t(), String.t(), query_selector_options()) ::
  {:ok, nil | Playwright.ElementHandle.t()} | {:error, Playwright.error()}
```

Returns the ElementHandle pointing to the frame element.

> #### Caution {: .warning}
>
> The use of [`ElementHandle`](`Playwright.ElementHandle`) is discouraged, use [`Locator`](`Playwright.Locator`) objects and web-first assertions instead.

The method finds an element matching the specified selector within the frame. If no elements match the selector,
returns `nil`.

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Frame.locator/3` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.9.*

## Arguments

* `selector` - A selector to query for.

## Options

* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.

# `query_selector!`

```elixir
@spec query_selector!(t(), String.t(), query_selector_options()) ::
  nil | Playwright.ElementHandle.t()
```

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

# `query_selector_all`

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

Returns the ElementHandles pointing to the frame elements.

> #### Caution {: .warning}
>
> The use of [`ElementHandle`](`Playwright.ElementHandle`) is discouraged, use [`Locator`](`Playwright.Locator`) objects instead.

The method finds all elements matching the specified selector within the frame. If no elements match the selector,
returns empty array.

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Frame.locator/3` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.9.*

## Arguments

* `selector` - A selector to query for.

# `query_selector_all!`

```elixir
@spec query_selector_all!(t(), String.t()) :: [Playwright.ElementHandle.t()]
```

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

# `select_option`

```elixir
@spec select_option(
  t(),
  String.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()}
```

This method waits for an element matching `selector`, 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**

```elixir
# Single selection matching the value or label
Frame.select_option!(frame, "select#colors", "blue")

# single selection matching both the value and the label
Frame.select_option!(frame, "select#colors", %{label: "Blue"})

# multiple selection
Frame.select_option!(frame, "select#colors", ["red", "green", "blue"])
```

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Locator.select_option/3` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.8.*

## Arguments

* `selector` - A selector to query for.
* `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`) - *Since Playwright 1.13.* 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`).
* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `: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(),
  String.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/4`, but returns the value and raises on error.

# `set_checked`

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

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

1. Find an element matching `selector`. If there is none, wait until a matching element is attached to
   the DOM.
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.

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Locator.set_checked/3` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.15.*

## Arguments

* `selector` - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
* `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`).
* `:strict` (`t:boolean/0`) - When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `: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(), String.t(), boolean(), set_checked_options()) :: :ok
```

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

# `set_content`

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

This method internally calls [document.write()](https://developer.mozilla.org/en-US/docs/Web/API/Document/write), inheriting all its specific characteristics and behaviors.

*Since Playwright 1.8.*

## Arguments

* `html` - HTML markup to assign to the page.

## 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 operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
  The default value can be changed by using the
  `Playwright.BrowserContext.set_default_navigation_timeout/2`,
  `Playwright.BrowserContext.set_default_timeout/2`,
  `Playwright.Page.set_default_navigation_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.
* `:wait_until` (`:load` | `:domcontentloaded` | `:networkidle` | `:commit`) - When to consider operation succeeded, defaults to `:load`. Events can be either:

  * `:domcontentloaded` - consider operation to be finished when the `DOMContentLoaded` event is fired.
  * `:load` - consider operation to be finished when the `load` event is fired.
  * `:networkidle` - **DISCOURAGED** consider operation to be finished when there are no network connections for at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.
  * `:commit` - consider operation to be finished when network response is received and the document started loading.

# `set_content!`

```elixir
@spec set_content!(t(), String.t(), set_content_options()) :: :ok
```

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

# `set_input_files`

```elixir
@spec set_input_files(
  t(),
  String.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()}
```

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 `selector` 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.

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Locator.set_input_files/3` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.8.*

## Arguments

* `selector` - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
* `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`).
* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `: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()
  | [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/4`, but returns the value and raises on error.

# `tap`

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

This method taps an element matching `selector` by performing the following steps:

1. Find an element matching `selector`. If there is none, wait until a matching element is attached to
   the DOM.
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.touchscreen/1` to tap the center of the element, or the specified `:position`.

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.Frame.tap/3` requires that the `:has_touch` option of the browser context be set to true.

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Locator.tap/2` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.8.*

## Arguments

* `selector` - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.

## 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`).
* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `: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`) - *Since Playwright 1.11.* 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(), String.t(), tap_options()) :: :ok
```

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

# `text_content`

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

Returns `element.textContent`.

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Locator.text_content/2` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.8.*

## Arguments

* `selector` - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.

## 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`).
* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `: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(), String.t(), text_content_options()) :: nil | String.t()
```

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

# `title`

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

Returns the page title.

*Since Playwright 1.8.*

# `title!`

```elixir
@spec title!(t()) :: String.t()
```

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

# `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(), String.t(), type_options()) ::
  :ok | {:error, Playwright.error()}
```

Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text. `Playwright.Frame.type/4` can be used to
send fine-grained keyboard events. To fill values in form fields, use `Playwright.Frame.fill/4`.

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

**Usage**

*Since Playwright 1.8.*

## Arguments

* `selector` - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
* `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`).
* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `: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(), String.t(), type_options()) :: :ok
```

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

# `uncheck`

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

This method checks an element matching `selector` by performing the following steps:

1. Find an element matching `selector`. If there is none, wait until a matching element is attached to
   the DOM.
1. Ensure that matched 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 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 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.

> #### Discouraged {: .warning}
>
> Use locator-based `Playwright.Locator.uncheck/2` instead. Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.8.*

## Arguments

* `selector` - A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.

## 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`) - *Since Playwright 1.11.* 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`).
* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `: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`) - *Since Playwright 1.11.* 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(), String.t(), uncheck_options()) :: :ok
```

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

# `url`

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

Returns frame's url.

*Since Playwright 1.8.*

# `wait_for_function`

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

Returns when the `expression` returns a truthy value, returns that value.

**Usage**

The `Playwright.Frame.wait_for_function/4` can be used to observe viewport size change:

```elixir
# Or Playwright.chromium/1 or Playwright.webkit/1.
browser = Playwright.firefox(playwright) |> BrowserType.launch!()
page = Browser.new_page!(browser)
watch_dog = Task.async(fn -> Page.main_frame(page) |> Frame.wait_for_function!("window.innerWidth < 100") end)
Page.set_viewport_size!(page, %{width: 50, height: 50})
Task.await(watch_dog)
Browser.close!(browser)
```

To pass an argument to the predicate of `Playwright.Frame.wait_for_function/4` function:

```elixir
selector = ".foo"
Frame.wait_for_function!(frame, "selector => !!document.querySelector(selector)", selector)
```

*Since Playwright 1.8.*

## Arguments

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

## Options

* `:polling` (`t:number/0` | `:raf`) - If `:polling` is `:raf`, then `expression` is constantly executed in `requestAnimationFrame`
  callback. If `:polling` is a number, then it is treated as an interval in milliseconds at which the function
  would be executed. Defaults to `:raf`.
* `: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 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()) ::
  Playwright.JSHandle.t()
```

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

# `wait_for_load_state`

```elixir
@spec wait_for_load_state(
  t(),
  :load | :domcontentloaded | :networkidle | nil,
  wait_for_load_state_options()
) :: :ok | {:error, Playwright.error()}
```

Waits for the required load state to be reached.

This returns when the frame reaches a required load state, `load` by default. The navigation must have been committed
when this method is called. If current document has already reached the required state, resolves immediately.

> #### Note {: .info}
>
> Most of the time, this method is not needed because Playwright [auto-waits before every action](https://playwright.dev/docs/actionability).

**Usage**

```elixir
# Click triggers navigation.
Frame.click!(frame, "button")
# Waits for 'load' state by default.
Frame.wait_for_load_state!(frame)
```

*Since Playwright 1.8.*

## Arguments

* `state` - Optional load state to wait for, defaults to `:load`. If the state has been already reached while loading current document, the
  method resolves immediately. Can be one of:

  * `:load` - wait for the `load` event to be fired.
  * `:domcontentloaded` - wait for the `DOMContentLoaded` event to be fired.
  * `:networkidle` - **DISCOURAGED** wait until there are no network connections for at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.

## Options

The options may take the place of `state`, which is then `nil`.

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the waiting using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the waiting will be aborted and the operation will fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.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 operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
  The default value can be changed by using the
  `Playwright.BrowserContext.set_default_navigation_timeout/2`,
  `Playwright.BrowserContext.set_default_timeout/2`,
  `Playwright.Page.set_default_navigation_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

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

# `wait_for_load_state!`

```elixir
@spec wait_for_load_state!(
  t(),
  :load | :domcontentloaded | :networkidle | nil,
  wait_for_load_state_options()
) :: :ok
```

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

# `wait_for_navigation`

> This function is deprecated. This method is inherently racy, please use Playwright.Frame.wait_for_url/3 instead.

```elixir
@spec wait_for_navigation(t(), wait_for_navigation_options()) ::
  Playwright.Promise.t()
```

Waits for the frame navigation and returns the main resource response. In case of multiple redirects, the navigation
returns the response of the last redirect. In case of navigation to a different anchor or navigation due to
History API usage, the navigation returns `nil`.

**Usage**

This method waits for the frame to navigate to a new URL. It is useful for when you run code which will indirectly cause
the frame to navigate. Consider this example:

```elixir
# Start waiting for navigation before clicking: a promise, awaited after.
navigation_promise = Page.wait_for_navigation(page)
Page.get_by_text(page, "Navigate after timeout") |> Locator.click!()
Promise.await!(navigation_promise)
```

> #### Note {: .info}
>
> Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to change the URL is considered
> a navigation.

*Since Playwright 1.8.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the waiting using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the waiting will be aborted and the operation will fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.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 operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
  The default value can be changed by using the
  `Playwright.BrowserContext.set_default_navigation_timeout/2`,
  `Playwright.BrowserContext.set_default_timeout/2`,
  `Playwright.Page.set_default_navigation_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.
* `:url` (`t:String.t/0` | `t:Regex.t/0` | `t:Playwright.RegExp.t/0` | `(URI.t() -> boolean())`) - A glob pattern, regex pattern, URL pattern, or predicate receiving `URI` to match while waiting for the navigation. Note that if
  the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly
  equal to the string.
* `:wait_until` (`:load` | `:domcontentloaded` | `:networkidle` | `:commit`) - When to consider operation succeeded, defaults to `:load`. Events can be either:

  * `:domcontentloaded` - consider operation to be finished when the `DOMContentLoaded` event is fired.
  * `:load` - consider operation to be finished when the `load` event is fired.
  * `:networkidle` - **DISCOURAGED** consider operation to be finished when there are no network connections for at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.
  * `:commit` - consider operation to be finished when network response is received and the document started loading.

Returns a `Playwright.Promise` at once, with the wait already set up. Start it before the action that triggers it and await it after with `Playwright.Promise.await/1`:

```elixir
promise = Playwright.Frame.wait_for_navigation(frame)
Playwright.Locator.click!(button)
response = Playwright.Promise.await!(promise)
```

The callback form `expect_navigation/3` runs the action:

```elixir
response = Playwright.Frame.expect_navigation!(frame, fn -> Playwright.Locator.click!(button) end)
```

# `wait_for_navigation!`

> This function is deprecated. This method is inherently racy, please use Playwright.Frame.wait_for_url/3 instead.

```elixir
@spec wait_for_navigation!(t(), wait_for_navigation_options()) ::
  nil | Playwright.Response.t()
```

Like `wait_for_navigation/2`, but awaits the promise: `Playwright.Promise.await!(wait_for_navigation(...))`, the value or a raise.

> #### Start waiting before the action {: .warning}
>
> This waits from the time it is called, so it misses what the code before it triggered. Start the wait with `wait_for_navigation/2` before the action and await it after, or use the callback form `expect_navigation!/3`:
>
> ```elixir
> promise = Playwright.Frame.wait_for_navigation(frame)
> Playwright.Locator.click!(button)
> response = Playwright.Promise.await!(promise)
> ```
>
> ```elixir
> response = Playwright.Frame.expect_navigation!(frame, fn -> Playwright.Locator.click!(button) end)
> ```

# `wait_for_selector`

```elixir
@spec wait_for_selector(t(), String.t(), wait_for_selector_options()) ::
  {:ok, nil | Playwright.ElementHandle.t()} | {:error, Playwright.error()}
```

Returns when element specified by selector satisfies `:state` option. Returns `nil` if waiting for `hidden` or
`detached`.

> #### Note {: .info}
>
> Playwright automatically waits for element to be ready before performing an action. Using
> [`Locator`](`Playwright.Locator`) objects and web-first assertions make the code wait-for-selector-free.

Wait for the `selector` to satisfy `:state` option (either appear/disappear from dom, or become
visible/hidden). If at the moment of calling the method `selector` already satisfies the condition, the method
will return immediately. If the selector doesn't satisfy the condition for the `:timeout` milliseconds, the
function will fail.

**Usage**

This method works across navigations:

```elixir
# Or Playwright.firefox/1 or Playwright.webkit/1.
browser = Playwright.chromium(playwright) |> BrowserType.launch!()
page = Browser.new_page!(browser)

for current_url <- ["https://google.com", "https://bbc.com"] do
  Page.goto!(page, current_url)
  element = Page.main_frame(page) |> Frame.wait_for_selector!("img")
  IO.puts("Loaded image: " <> ElementHandle.get_attribute!(element, "src"))
end

Browser.close!(browser)
```

> #### Discouraged {: .warning}
>
> Use web assertions that assert visibility or a locator-based `Playwright.Locator.wait_for/2` instead.
> Read more about [locators](https://playwright.dev/docs/locators).

*Since Playwright 1.8.*

## Arguments

* `selector` - A selector to query 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`).
* `: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.
* `:strict` (`t:boolean/0`) - *Since Playwright 1.14.* When true, the call requires selector to resolve to a single element. If given selector resolves to more
  than one element, the call fails.
* `: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_selector!`

```elixir
@spec wait_for_selector!(t(), String.t(), wait_for_selector_options()) ::
  nil | Playwright.ElementHandle.t()
```

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

# `wait_for_timeout`

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

Waits for the given `timeout` in milliseconds. It rejects `:infinity`.

Note that `Playwright.Frame.wait_for_timeout/2` should only be used for debugging. Tests using the timer in production are going to
be flaky. Use signals such as network events, selectors becoming visible and others instead.

> #### Discouraged {: .warning}
>
> Never wait for timeout in production. Tests that wait for time are
> inherently flaky. Use [`Locator`](`Playwright.Locator`) actions and web assertions that wait automatically.

*Since Playwright 1.8.*

## Arguments

* `timeout` - A timeout to wait for

# `wait_for_timeout!`

```elixir
@spec wait_for_timeout!(t(), number()) :: :ok
```

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

# `wait_for_url`

```elixir
@spec wait_for_url(
  t(),
  String.t() | Regex.t() | Playwright.RegExp.t() | (URI.t() -&gt; boolean()),
  wait_for_url_options()
) :: :ok | {:error, Playwright.error()}
```

Waits for the frame to navigate to the given URL.

**Usage**

```elixir
# Clicking the link will indirectly cause a navigation
Frame.click!(frame, "a.delayed-navigation")
Frame.wait_for_url!(frame, "**/target.html")
```

*Since Playwright 1.11.*

## Arguments

* `url` - A glob pattern, regex pattern, URL pattern, or predicate receiving `URI` to match while waiting for the navigation. Note that if
  the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly
  equal to the string.

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* Allows to cancel the waiting using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the waiting will be aborted and the operation will fail.
  Note that providing a signal does not disable the default timeout, which can be changed using `Playwright.BrowserContext.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 operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
  The default value can be changed by using the
  `Playwright.BrowserContext.set_default_navigation_timeout/2`,
  `Playwright.BrowserContext.set_default_timeout/2`,
  `Playwright.Page.set_default_navigation_timeout/2` or
  `Playwright.Page.set_default_timeout/2` methods.

  In Elixir, `:infinity` is the same as `0`: no timeout.
* `:wait_until` (`:load` | `:domcontentloaded` | `:networkidle` | `:commit`) - When to consider operation succeeded, defaults to `:load`. Events can be either:

  * `:domcontentloaded` - consider operation to be finished when the `DOMContentLoaded` event is fired.
  * `:load` - consider operation to be finished when the `load` event is fired.
  * `:networkidle` - **DISCOURAGED** consider operation to be finished when there are no network connections for at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.
  * `:commit` - consider operation to be finished when network response is received and the document started loading.

# `wait_for_url!`

```elixir
@spec wait_for_url!(
  t(),
  String.t() | Regex.t() | Playwright.RegExp.t() | (URI.t() -&gt; boolean()),
  wait_for_url_options()
) :: :ok
```

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

# `webmcp`

```elixir
@spec webmcp(t()) :: Playwright.WebMCP.t()
```

Tools that the frame registers through the experimental [`WebMCP`](`Playwright.WebMCP`) browser API. See [`WebMCP`](`Playwright.WebMCP`) for details.

*Since Playwright 1.64.*

---

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