# `LiveLoad.Browser.Context`
[🔗](https://github.com/probably-not/live-load/blob/v0.1.1/lib/live_load/browser/context.ex#L1)

`LiveLoad.Browser.Context` is an isolated context where all operations of a `LiveLoad.Scenario` take place.
It has a parent `LiveLoad.Browser`, and whatever private data is related to the current connection's underlying context.

A context is generated by the `c:LiveLoad.Browser.Connection.new_context/1` callback in the `LiveLoad.Browser.Connection` behaviour.
Contexts must be isolated in terms of session - each user process in the load test gets its own `LiveLoad.Browser.Context`,
and all of that user's operations will run on this context.

Contexts may reuse browser processes, but their session data must be private. As an example, Playwright exposes contexts
in order to optimize, however, alternate implementations like [LightPanda](https://lightpanda.io/) or [WebDriver](https://www.w3.org/TR/webdriver1/)
do not have an equivalent (as of the time of writing, December 2025). So if one were to write a WebDriver based `LiveLoad.Browser.Connection` implementation,
they would have to ensure that each `LiveLoad.Browser.Context` is mapped to a full isolated WebDriver browser instance.

# `t`

```elixir
@type t() :: %LiveLoad.Browser.Context{
  browser: LiveLoad.Browser.t(),
  private: %{optional(atom()) =&gt; term()}
}
```

# `blur`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.blur/2` callback
found on the implementation.

# `check`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.check/2` callback
found on the implementation.

# `checked?`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.checked?/2` callback
found on the implementation.

# `click`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.click/2` callback
found on the implementation.

# `context_storage_snapshot`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.context_storage_snapshot/1` callback
found on the implementation.

# `drag_and_drop`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.drag_and_drop/3` callback
found on the implementation.

# `fill`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.fill/3` callback
found on the implementation.

# `focus`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.focus/2` callback
found on the implementation.

# `get_attribute`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.get_attribute/3` callback
found on the implementation.

# `hover`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.hover/2` callback
found on the implementation.

# `inner_html`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.inner_html/2` callback
found on the implementation.

# `inner_text`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.inner_text/2` callback
found on the implementation.

# `input_value`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.input_value/2` callback
found on the implementation.

# `navigate`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.navigate/2` callback
found on the implementation.

# `page_content`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.page_content/1` callback
found on the implementation.

# `press`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.press/3` callback
found on the implementation.

# `put_private`

```elixir
@spec put_private(context :: t(), key :: atom(), value :: term()) :: t()
```

Set a value on the private field on the context struct.
This is useful for Connection implementations to add private data
that they need access to while running.

# `reload`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.reload/1` callback
found on the implementation.

# `reset_context_storage`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.reset_context_storage/1` callback
found on the implementation.

# `restore_context_storage`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.restore_context_storage/2` callback
found on the implementation.

# `select_multiple_options`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.select_multiple_options/3` callback
found on the implementation.

# `select_option`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.select_option/3` callback
found on the implementation.

# `stop`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.stop_context/1` callback
found on the implementation.

# `text_content`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.text_content/2` callback
found on the implementation.

# `uncheck`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.uncheck/2` callback
found on the implementation.

# `visible?`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.visible?/2` callback
found on the implementation.

# `wait_for_selector`

Delegates to the connection implementation on the context and
runs the `c:LiveLoad.Browser.Connection.wait_for_selector/2` callback
found on the implementation.

