LiveLoad.Browser.Context (LiveLoad v0.0.1-rc.38)

Copy Markdown View Source

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 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 or WebDriver 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.

Summary

Functions

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

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

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

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

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

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

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

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

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

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

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

Types

t()

@type t() :: %LiveLoad.Browser.Context{
  browser: LiveLoad.Browser.t(),
  private: %{optional(atom()) => term()}
}

Functions

blur(context, selector)

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

check(context, selector)

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

checked?(context, selector)

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

click(context, selector)

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

context_storage_snapshot(context)

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

drag_and_drop(context, source, target)

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

fill(context, selector, value)

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

focus(context, selector)

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

get_attribute(context, selector, name)

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

hover(context, selector)

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

inner_html(context, selector)

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

inner_text(context, selector)

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

input_value(context, selector)

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

page_content(context)

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

press(context, selector, key)

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

put_private(context, key, value)

@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(context)

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

reset_context_storage(context)

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

restore_context_storage(context, snapshot)

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

select_multiple_options(context, selector, values)

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

select_option(context, selector, value)

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

stop(context)

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

text_content(context, selector)

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

uncheck(context, selector)

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

visible?(context, selector)

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

wait_for_selector(context, selector)

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