Skip to content

No documentation for using Browser from Python without Robot Framework #5164

Description

@aaltat

Browser keywords can be called from a plain Python script with no Robot Framework run anywhere, and argument conversion makes this a supported way to use the library. There is no documentation for it.

Two behaviours are specific to this context, and both are already measured:

  • browser.outputdir is the current working directory. Browser/browser.py:829 falls back to self._output_dir when EXECUTION_CONTEXTS.current is empty, so screenshots, videos, traces and the Playwright log land wherever the script was started from.
  • validate and then raise RobotNotRunningError: Cannot access execution context. All 31 keywords taking an AssertionOperator still accept and convert the operator — only these two operators' execution needs a Robot Framework run. This is pre-existing and outside the library's control.

Neither holds under Robot Framework. In particular they do not hold when a user's own library owns the Browser instance: Robot Framework is still running, so ${OUTPUTDIR} resolves and BuiltIn().evaluate works. Conflating "no Robot Framework" with "not imported by Robot Framework" is the mistake this issue exists to prevent.

Where it belongs

One closing section on /docs/extending/browser-as-a-base, once that page exists. The two pages covering the Robot Framework-hosted cases are specced in the site repository as docs/superpowers/specs/2026-08-16-python-extension-docs.md, and this case is explicitly out of scope there.

Parking it costs nothing today: the argument-conversion behaviour is documented by those two pages regardless, because it applies to any call reaching a keyword through attributes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions