Skip to content

Context

A WWW::Playwright::Context is an isolated browser session. Get one from Browser.new-context.

new-page(--> Page)

Opens a new page in the context and returns a Page.

1
my $page = $context.new-page;

start-tracing(--> Nil)

Starts recording a trace (screenshots and DOM snapshots) for the context.

1
$context.start-tracing;

stop-tracing(Str :$path --> Nil)

Stops tracing. With :path, writes the trace zip to that path.

1
$context.stop-tracing(path => '/tmp/trace.zip');

See Diagnostics for the full tracing workflow.

close(--> Nil)

Closes the context and its pages.

1
$context.close;