From 6125bc5ad1f1be800ba67cc3db07799e00b1a5e5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 19 Aug 2026 20:08:36 +0000 Subject: [PATCH 1/2] content: Browser 20.4.0 Generated by .github/workflows/library-release.yml. --- app/generated/versions.json | 5 +- content/contributors.json | 16 +- content/libdoc/Browser-20.4.0.json | 18627 +++++++++++++++++++++++++ content/libdoc/LATEST | 2 +- content/project.json | 6 +- content/releases/20.4.0.md | 130 + public/avatars/Alpha-Centauri-00.jpg | Bin 0 -> 2917 bytes 7 files changed, 18778 insertions(+), 8 deletions(-) create mode 100644 content/libdoc/Browser-20.4.0.json create mode 100644 content/releases/20.4.0.md create mode 100644 public/avatars/Alpha-Centauri-00.jpg diff --git a/app/generated/versions.json b/app/generated/versions.json index 22b2bb9..da83967 100644 --- a/app/generated/versions.json +++ b/app/generated/versions.json @@ -1,6 +1,7 @@ { - "browser": "20.3.0", + "browser": "20.4.0", "documented": [ + "20.4.0", "20.3.0", "20.2.0", "20.1.0", @@ -14,7 +15,7 @@ "19.12.5", "19.12.4" ], - "browserMinor": "20.3", + "browserMinor": "20.4", "browserMajor": "20", "playwright": "1.62.1", "node": "24.19.0", diff --git a/content/contributors.json b/content/contributors.json index b50c604..b31fe08 100644 --- a/content/contributors.json +++ b/content/contributors.json @@ -1,7 +1,7 @@ { "source": ".all-contributorsrc, maintained by the all-contributors bot", - "generated": "2026-08-09", - "total": 206, + "generated": "2026-08-19", + "total": 207, "core": [ { "login": "aaltat", @@ -2627,6 +2627,18 @@ "contributions": [ "code" ] + }, + { + "login": "Alpha-Centauri-00", + "name": "M.Kherki", + "avatar": "/avatars/Alpha-Centauri-00.jpg", + "profile": "https://github.com/Alpha-Centauri-00", + "ways": [ + "report" + ], + "contributions": [ + "bug" + ] } ] } diff --git a/content/libdoc/Browser-20.4.0.json b/content/libdoc/Browser-20.4.0.json new file mode 100644 index 0000000..d167865 --- /dev/null +++ b/content/libdoc/Browser-20.4.0.json @@ -0,0 +1,18627 @@ +{ + "specversion": 3, + "name": "Browser", + "doc": "

Browser library is a browser automation library for Robot Framework.

\n

This is the keyword documentation for Browser library. For installation, guides and everything else, see robotframework-browser.org. For more information about Robot Framework itself, see robotframework.org.

\n

Browser library uses Playwright Node module to automate Chromium, Firefox and WebKit with a single library.

\n

Table of contents

\n\n

Browser, Context and Page

\n

Browser library works in three layers that build on each other.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
LayerIsOpened with
BrowserA browser process: chromium, firefox or webkit.New Browser
ContextAn isolated session in that process: its own cookies, storage and permissions. Contexts share nothing with each other.New Context
PageA tab, with its own content and history. Selectors resolve here.New Page
\n

Playwright brings its own browser binaries, so no separate driver is needed. A browser starts headless unless New Browser's headless argument is set to False.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
EngineShips in
chromiumGoogle Chrome, Microsoft Edge, Opera
firefoxMozilla Firefox
webkitSafari on macOS and iOS
\n

The layers fill themselves in downwards: New Page with nothing open starts a browser and a context first, using defaults. Open Browser opens all three at once and is meant for experiments and debugging rather than for suites.

\n

A context is the cheap unit of isolation \u2014 opening one is roughly a thousand times cheaper than starting a browser, so a clean session per test does not mean a new process. Context-level settings include viewport, geolocation, locale, colorScheme and httpCredentials; downloads are accepted unless acceptDownloads=False is given.

\n

Each browser, context and page has an id. Get Browser Catalog returns everything currently open.

\n

Which layer to open for which job, and the cost of each: https://robotframework-browser.org/docs/concepts/browser-context-page

\n

Automatic page and context closing

\n

Controls when contexts and pages are closed during the test execution.

\n

If automatic closing level is TEST, contexts and pages that are created during a single test are automatically closed when the test ends. Contexts and pages that are created during suite setup are closed when the suite teardown ends.

\n

If automatic closing level is SUITE, all contexts and pages that are created during the test suite are closed when the suite teardown ends.

\n

If automatic closing level is MANUAL, nothing is closed automatically while the test execution is ongoing. All browsers, context and pages are automatically closed when test execution ends.

\n

If automatic closing level is KEEP, nothing is closed automatically while the test execution is ongoing. Also, nothing is closed when test execution ends, including the node process. Therefore, it is users responsibility to close all browsers, context and pages and ensure that all process that are left running after the test execution end are closed. This level is only intended for test case development and must not be used when running tests in CI or similar environments.

\n

Automatic closing can be configured or switched off with the auto_closing_level library import parameter.

\n

See: Importing

\n

Finding elements

\n

Keywords that act on an element take a selector argument. A selector is one or more clauses, each naming a strategy, chained with >>.

\n

Under strict mode a selector matching more than one element fails the keyword. It is on by default, changeable in the library importing or with Set Strict Mode, and each keyword's documentation states whether it applies.

\n

Strategies

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
StrategyMatches onExample
roleARIA role, with optional accessible name.role=button[name=\"Login\"]
data-testiddata-testid attribute.data-testid=login
textText content. See Text matching.text=Login
idElement ID attribute.id=login_btn
cssCSS selector.css=.class > \\#login_btn
xpathXPath expression.xpath=//input[@id=\"login_btn\"]
data-test-iddata-test-id attribute.data-test-id=login
data-testdata-test attribute.data-test=login
css:lightAs css, but does not pierce shadow DOM.css:light=.class
\n

An attribute engine is equivalent to the matching css attribute selector: data-test-id=foo is css=[data-test-id=\"foo\"].

\n

css:light is the only non-piercing engine still supported. All other locator, except xpath, pierce shadow DOM automatically.

\n

Two filters narrow what a clause already matched. Filter order changes the result.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
FilterSelectsExample
nthThe nth match, zero based. 0 first, -1 last.css=button >> nth=1
visibleOnly visible, or only hidden, matches.css=button >> visible=true
\n

Playwright's CSS pseudo-classes (:has(), :has-text(), :nth-match()) and its layout selectors (:right-of(), :below()) are available inside a css clause. Which strategy to prefer, and the full list with examples: https://robotframework-browser.org/docs/concepts/selectors

\n

Explicit and implicit strategy

\n

A strategy is named with a strategy=value prefix. Spaces around the separator are ignored, so css=foo, css= foo and css = foo are the same.

\n

Without a prefix the strategy is inferred:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Selector starts withRead asExample
// or ..xpath//span/button is xpath=//span/button
\" or 'text, exact\"Login\" is text=\"Login\"
anything elsecssspan > button is css=span > button
\n

Because # starts a comment in Robot Framework data, an id selector must be escaped as \\#id.

\n

css follows the CSS selector specification and xpath the XPath specification; neither is re-documented here.

\n

Text matching

\n

The text engine matches a text node, and the value of button and submit inputs. In keywords that insert text it also matches a field by its label.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
FormMatches
text=LoginSubstring, case-insensitive, leading and trailing whitespace ignored.
text=\"Login \"Exact: case, whitespace and all. Escape a quote as \\\".
text=/^Hi .*!$/iJavaScript-style regular expression with flags: e.g. i for case-insensitive.
\n

Chaining

\n

Clauses are separated by >> and each searches inside the result of the previous one. The chain returns what the last clause matched; prefix a clause with * to return that one instead. A value containing >> must be quoted, as in text=\"some >> text\".

\n
\nClick    css=.checkout >> text=Confirm\nGet Element    *css=article >> text=Hello    # returns the article\n
\n

iFrames

\n

A chain does not cross a frame boundary. >>> combines a selector for the frame element with a selector inside it; the clause immediately before >>> must select the frame itself.

\n
\nClick    id=iframe >>> id=btn\n
\n

For several keywords inside one frame, set a prefix with Set Selector Prefix.

\n

Shadow DOM

\n

All engines, except css:light and xpath, pierce open shadow roots automatically: every descendant combinator, including the implicit one at the start of a selector, crosses any number of them. Light DOM is searched first, then open shadow roots, in document order. Closed shadow roots and iframes are never entered.

\n

Use css:light to stop at the shadow boundary. Worked examples of what each matches: https://robotframework-browser.org/docs/concepts/selectors

\n

Element references

\n

Get Element returns a selector string for what it matched, and Get Elements returns a list of them. They are ordinary selectors, so they go in the first clause of another selector, chained with >>:

\n
\n${ref}=    Get Element    .some_class\n           Click          ${ref} >> .some_child\n           Click          ${ref} >> .other_child\n
\n

Clauses after the reference are relative to it. Because the value is a selector rather than a captured DOM node, it is resolved from the page again on every use. A reference works like any other first clause, >>> included: if it points at an iframe, ${ref} >>> h1 crosses into it.

\n

Assertions

\n

Keywords taking assertion_operator <AssertionOperator> and assertion_expected can assert on the value they return, and still return it. An assertion retries until it passes or retry_assertions_for expires; see Importing for that setting, which defaults to 1 second.

\n

Currently supported assertion operators are:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
OperatorAlternative OperatorsDescriptionValidate Equivalent
==equal, equals, should beChecks if returned value is equal to expected value.value == expected
!=inequal, should not beChecks if returned value is not equal to expected value.value != expected
>greater thanChecks if returned value is greater than expected value.value > expected
>=Checks if returned value is greater than or equal to expected value.value >= expected
<less thanChecks if returned value is less than expected value.value < expected
<=Checks if returned value is less than or equal to expected value.value <= expected
*=containsChecks if returned value contains expected value as substring.expected in value
not containsChecks if returned value does not contain expected value as substring.expected in value
^=should start with, startsChecks if returned value starts with expected value.re.search(f\"^{expected}\", value)
$=should end with, endsChecks if returned value ends with expected value.re.search(f\"{expected}$\", value)
matchesChecks if given RegEx matches minimum once in returned value.re.search(expected, value)
validateChecks if given Python expression evaluates to True.
evaluatethenWhen using this operator, the keyword does return the evaluated Python expression.
\n

There are three different possibilities what keyword returns when matches operator is used: string, tuple or dictionary. What keyword returns depends on how the RegEx is formed. If RegEx does not contain group(s), then keyword will return the string without modifications. If RegEx contains groups, meaning (...), then keyword will return a tuple. Each tuple item contains the text which is matched by the group. If there is group and group has a name, (?P<name>...) syntax, then keyword returns a dictionary. In this case dictionary key is the group name and value contains the matched text. If there mix of groups and groups with names, then tuple is returned.

\n

Currently supported formatters for assertions are:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
FormatterDescription
normalize spacesSubstitutes multiple spaces to single space from the value
stripRemoves spaces from the beginning and end of the value
case insensitiveConverts value to lower case before comparing
apply to expectedApplies rules also for the expected value
\n

Formatters are applied to the value before assertion is performed and keywords returns a value where rule is applied. Formatter is only applied to the value which keyword returns and not all rules are valid for all assertion operators. If apply to expected formatter is defined, then formatters are then formatter are also applied to expected value.

\n

Expected values are generally used as given, so they must already have the type returned by the keyword. Keywords returning numbers are an exception and convert the expected value.

\n

Examples:

\n\n

Comparing strings with < or > compares code points character by character and stops at the first difference; length is never considered. Example: A < Z, Z < a, ac < dc, 'abcde' < 'abd'.

\n

validate takes a Python expression over value. then and evaluate do not assert: they return the result of an expression over value.

\n
\nGet Text             h1      validate    value.startswith(\"Welcome\")\n${id}=    Get Property    a#link    href    then    value.split(\"/\")[-1]\n
\n

A failing assertion has a default message, replaceable with message. It accepts the format fields {value}, {expected}, {value_type} and {expected_type}.

\n

What each operator is for, why a type mismatch is the usual failure, and the formatters that normalise a value before comparison: https://robotframework-browser.org/docs/concepts/assertions

\n

Implicit waiting

\n

Browser library and Playwright have many mechanisms to help in waiting for elements. Playwright will auto-wait before performing actions on elements. Please see Auto-waiting on Playwright documentation for more information.

\n

On top of Playwright auto-waiting Browser assertions will wait and retry for specified time before failing any Assertions. Time is specified in Browser library initialization with retry_assertions_for.

\n

Browser library also includes explicit waiting keywords such as Wait for Elements State if more control for waiting is needed.

\n

Experimental: Re-using same node process

\n

The Node.js side can be started as a standalone process and shared by every Browser library running on the same machine, instead of each one starting its own. This can speed up parallel runs. Start it from the directory where the Browser package is installed with ` PLAYWRIGHT_BROWSERS_PATH=0 node Browser/wrapper/index.js HOST PORT ` , for example ... index.js 127.0.0.1 12345. Both arguments are required: the script reads the host first and exits with No port defined if only one is given. Point runs at it with the playwright_process_port import parameter or the ROBOT_FRAMEWORK_BROWSER_NODE_PORT environment variable, for example ROBOT_FRAMEWORK_BROWSER_NODE_PORT=PORT pabot ...

\n

What this costs, how to run it under Pabot, and how to pass Node flags such as --inspect: https://robotframework-browser.org/docs/operations/node-process

\n

Scope Setting

\n

Some keywords which manipulates library settings have a scope argument. With that scope argument one can set the \"live time\" of that setting. Available Scopes are: Global, Suite and `Test/Task See Scope`. Is a scope finished, this scoped setting, like timeout, will no longer be used.

\n

Live Times:

\n\n

A new set higher order scope will always remove the lower order scope which may be in charge. So the setting of a Suite scope from a test, will set that scope to the robot file suite where that test is and removes the Test scope that may have been in place.

\n

Using Browser from Python

\n

Browser keywords can be called directly from Python, from your own Robot Framework library. Arguments convert the same way Robot Framework converts them, so browser.click(\"//button\", \"middle\") works, and a Python None is passed through unchanged. Robot Framework's own features do not all follow: Automatic page and context closing and Scope Setting need Browser's listener to be registered, and run_on_failure never applies to a keyword your library calls from Python.

\n

Getting started, and what your own library gets in each case: https://robotframework-browser.org/docs/extending/python-libraries

\n

Language

\n

Keyword names and their documentation can be translated. Install a Python package whose name starts with robotframework_browser_translation and set the language import parameter to the language that the package declares; Browser discovers it on the module search path through the Python plugin API.

\n

A template for a new translation, containing every keyword in the correct format, is produced by rfbrowser translation /path/to/translation.json. Keywords coming from library plugins and JavaScript extensions can be included with the --plugings and --jsextension arguments.

\n

Writing and packaging a translation: https://robotframework-browser.org/docs/extending/translations

\n

ENVIRONMENT VARIABLES

\n

These environment variables modify the behaviour of the library. Two of them are development features and must not be set in production; they are listed here so that nobody uses them by accident.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Environment variableDescription
ROBOT_FRAMEWORK_BROWSER_NODE_PORTPort number for connecting to an existing node process. This is an alternative to playwright_process_port import argument.
ROBOT_FRAMEWORK_BROWSER_NODE_COVERAGEIf set to 1, will collect code coverage for the node process. This must not be used in production environments and is not supported on Windows.
ROBOT_FRAMEWORK_BROWSER_NODE_DEBUG_OPTIONSDebug options for the node process. This is a comma-separated list of arguments, for example --inspect. This must not be used in production environments.
\n

Which of these to prefer over an import parameter, and how they behave with BrowserBatteries: https://robotframework-browser.org/docs/operations/environment-variables

", + "version": "20.4.0", + "generated": "2026-08-19T20:07:51+00:00", + "type": "LIBRARY", + "scope": "GLOBAL", + "docFormat": "HTML", + "source": "Browser/browser.py", + "lineno": 130, + "tags": [ + "Assertion", + "BrowserControl", + "Clock", + "Config", + "Coverage", + "Crawling", + "Credential", + "Experimental", + "Getter", + "HTTP", + "PageContent", + "Setter", + "Wait" + ], + "inits": [ + { + "name": "__init__", + "args": [ + { + "name": "_", + "type": null, + "defaultValue": null, + "kind": "VAR_POSITIONAL", + "required": false, + "repr": "*_" + }, + { + "name": "auto_closing_level", + "type": { + "name": "AutoClosingLevel", + "typedoc": "AutoClosingLevel", + "nested": [], + "union": false + }, + "defaultValue": "TEST", + "kind": "NAMED_ONLY", + "required": false, + "repr": "auto_closing_level: AutoClosingLevel = TEST" + }, + { + "name": "auto_delete_passed_tracing", + "type": { + "name": "bool", + "typedoc": "boolean", + "nested": [], + "union": false + }, + "defaultValue": "False", + "kind": "NAMED_ONLY", + "required": false, + "repr": "auto_delete_passed_tracing: bool = False" + }, + { + "name": "enable_playwright_debug", + "type": { + "name": "Union", + "typedoc": null, + "nested": [ + { + "name": "PlaywrightLogTypes", + "typedoc": "PlaywrightLogTypes", + "nested": [], + "union": false + }, + { + "name": "bool", + "typedoc": "boolean", + "nested": [], + "union": false + } + ], + "union": true + }, + "defaultValue": "library", + "kind": "NAMED_ONLY", + "required": false, + "repr": "enable_playwright_debug: PlaywrightLogTypes | bool = library" + }, + { + "name": "enable_presenter_mode", + "type": { + "name": "Union", + "typedoc": null, + "nested": [ + { + "name": "HighLightElement", + "typedoc": "HighLightElement", + "nested": [], + "union": false + }, + { + "name": "bool", + "typedoc": "boolean", + "nested": [], + "union": false + } + ], + "union": true + }, + "defaultValue": "False", + "kind": "NAMED_ONLY", + "required": false, + "repr": "enable_presenter_mode: HighLightElement | bool = False" + }, + { + "name": "external_browser_executable", + "type": { + "name": "Union", + "typedoc": null, + "nested": [ + { + "name": "dict", + "typedoc": "dictionary", + "nested": [ + { + "name": "SupportedBrowsers", + "typedoc": "SupportedBrowsers", + "nested": [], + "union": false + }, + { + "name": "str", + "typedoc": "string", + "nested": [], + "union": false + } + ], + "union": false + }, + { + "name": "None", + "typedoc": "None", + "nested": [], + "union": false + } + ], + "union": true + }, + "defaultValue": "None", + "kind": "NAMED_ONLY", + "required": false, + "repr": "external_browser_executable: dict[SupportedBrowsers, str] | None = None" + }, + { + "name": "highlight_on_failure", + "type": { + "name": "bool", + "typedoc": "boolean", + "nested": [], + "union": false + }, + "defaultValue": "False", + "kind": "NAMED_ONLY", + "required": false, + "repr": "highlight_on_failure: bool = False" + }, + { + "name": "jsextension", + "type": { + "name": "Union", + "typedoc": null, + "nested": [ + { + "name": "list", + "typedoc": "list", + "nested": [ + { + "name": "str", + "typedoc": "string", + "nested": [], + "union": false + } + ], + "union": false + }, + { + "name": "str", + "typedoc": "string", + "nested": [], + "union": false + }, + { + "name": "None", + "typedoc": "None", + "nested": [], + "union": false + } + ], + "union": true + }, + "defaultValue": "None", + "kind": "NAMED_ONLY", + "required": false, + "repr": "jsextension: list[str] | str | None = None" + }, + { + "name": "language", + "type": { + "name": "Union", + "typedoc": null, + "nested": [ + { + "name": "str", + "typedoc": "string", + "nested": [], + "union": false + }, + { + "name": "None", + "typedoc": "None", + "nested": [], + "union": false + } + ], + "union": true + }, + "defaultValue": "None", + "kind": "NAMED_ONLY", + "required": false, + "repr": "language: str | None = None" + }, + { + "name": "playwright_process_host", + "type": { + "name": "Union", + "typedoc": null, + "nested": [ + { + "name": "str", + "typedoc": "string", + "nested": [], + "union": false + }, + { + "name": "None", + "typedoc": "None", + "nested": [], + "union": false + } + ], + "union": true + }, + "defaultValue": "None", + "kind": "NAMED_ONLY", + "required": false, + "repr": "playwright_process_host: str | None = None" + }, + { + "name": "playwright_process_port", + "type": { + "name": "Union", + "typedoc": null, + "nested": [ + { + "name": "int", + "typedoc": "integer", + "nested": [], + "union": false + }, + { + "name": "None", + "typedoc": "None", + "nested": [], + "union": false + } + ], + "union": true + }, + "defaultValue": "None", + "kind": "NAMED_ONLY", + "required": false, + "repr": "playwright_process_port: int | None = None" + }, + { + "name": "plugins", + "type": { + "name": "Union", + "typedoc": null, + "nested": [ + { + "name": "list", + "typedoc": "list", + "nested": [ + { + "name": "str", + "typedoc": "string", + "nested": [], + "union": false + } + ], + "union": false + }, + { + "name": "str", + "typedoc": "string", + "nested": [], + "union": false + }, + { + "name": "None", + "typedoc": "None", + "nested": [], + "union": false + } + ], + "union": true + }, + "defaultValue": "None", + "kind": "NAMED_ONLY", + "required": false, + "repr": "plugins: list[str] | str | None = None" + }, + { + "name": "retry_assertions_for", + "type": { + "name": "timedelta", + "typedoc": "timedelta", + "nested": [], + "union": false + }, + "defaultValue": "0:00:01", + "kind": "NAMED_ONLY", + "required": false, + "repr": "retry_assertions_for: timedelta = 0:00:01" + }, + { + "name": "run_on_failure", + "type": { + "name": "str", + "typedoc": "string", + "nested": [], + "union": false + }, + "defaultValue": "Take Screenshot \\ fail-screenshot-{index}", + "kind": "NAMED_ONLY", + "required": false, + "repr": "run_on_failure: str = Take Screenshot \\ fail-screenshot-{index}" + }, + { + "name": "selector_prefix", + "type": { + "name": "Union", + "typedoc": null, + "nested": [ + { + "name": "str", + "typedoc": "string", + "nested": [], + "union": false + }, + { + "name": "None", + "typedoc": "None", + "nested": [], + "union": false + } + ], + "union": true + }, + "defaultValue": "None", + "kind": "NAMED_ONLY", + "required": false, + "repr": "selector_prefix: str | None = None" + }, + { + "name": "show_keyword_call_banner", + "type": { + "name": "Union", + "typedoc": null, + "nested": [ + { + "name": "bool", + "typedoc": "boolean", + "nested": [], + "union": false + }, + { + "name": "None", + "typedoc": "None", + "nested": [], + "union": false + } + ], + "union": true + }, + "defaultValue": "None", + "kind": "NAMED_ONLY", + "required": false, + "repr": "show_keyword_call_banner: bool | None = None" + }, + { + "name": "strict", + "type": { + "name": "bool", + "typedoc": "boolean", + "nested": [], + "union": false + }, + "defaultValue": "True", + "kind": "NAMED_ONLY", + "required": false, + "repr": "strict: bool = True" + }, + { + "name": "timeout", + "type": { + "name": "timedelta", + "typedoc": "timedelta", + "nested": [], + "union": false + }, + "defaultValue": "0:00:10", + "kind": "NAMED_ONLY", + "required": false, + "repr": "timeout: timedelta = 0:00:10" + }, + { + "name": "tracing_group_mode", + "type": { + "name": "TracingGroupMode", + "typedoc": "TracingGroupMode", + "nested": [], + "union": false + }, + "defaultValue": "Full", + "kind": "NAMED_ONLY", + "required": false, + "repr": "tracing_group_mode: TracingGroupMode = Full" + } + ], + "returnType": null, + "doc": "

Browser library can be taken into use with optional arguments:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
ArgumentDescription
auto_closing_levelConfigure context and page automatic closing. Default is TEST, for more details, see AutoClosingLevel
auto_delete_passed_tracingIf auto_closing_level is set to SUITE or TEST and tracing of New Context active, traces of passed tests or suites, depending on the context scope, not be saved. Also temp files will all be deleted after the whole execution ends.
enable_playwright_debugEnable low level debug information from the playwright to playwright-log.txt file. For more details, see PlaywrightLogTypes.
enable_presenter_modeAutomatic highlights the interacted components, slowMo and a small pause at the end. Can be enabled by giving True or can be customized by giving a dictionary: {\"duration\": \"2 seconds\", \"width\": \"2px\", \"style\": \"dotted\", \"color\": \"blue\"} Where duration is time format in Robot Framework format, defaults to 2 seconds. width is width of the marker in pixels, defaults the 2px. style is the style of border, defaults to dotted. color is the color of the marker, defaults to blue. By default, the call banner keyword is also enabled unless explicitly disabled.
external_browser_executableDict mapping name of browser to path of executable of a browser. Will make opening new browsers of the given type use the set executablePath. Currently only configuring of chromium to a separate executable (chrome, chromium and Edge executables all work with recent versions) works.
highlight_on_failureIf set to True, will highlight the element in the screenshot when a keyword fails, by highlighting the selector used in the failed keyword. If set to False, will not highlight the element.
jsextensionPath to JavaScript modules exposed as extra keywords. The modules must be in CommonJS format; exported functions become keywords and an fn.rfdoc string becomes a keyword's documentation. The argument names page, context, browser, logger and playwright are filled in by the library rather than taken from the keyword call. Can be a single path, a comma-separated list of paths or a real list of strings. See https://robotframework-browser.org/docs/extending/javascript-extensions
languageDefines language which is used to translate keyword names and documentation.
playwright_process_hostHostname / Host address which should be used when spawning the Playwright process. Defaults to 127.0.0.1.
playwright_process_portExperimental reusing of playwright process. playwright_process_port is preferred over environment variable ROBOT_FRAMEWORK_BROWSER_NODE_PORT. See Experimental: Re-using same node process for more details.
pluginsAllows extending the Browser library with external Python classes, which can add keywords and modify some internal behaviour without forking the library. Can be a single class/module, a comma-separated list or a real list of strings. See https://robotframework-browser.org/docs/extending/python-plugins
retry_assertions_forTimeout for retrying assertions on keywords before failing the keywords. This timeout starts counting from the first failure. Global timeout will still be in effect. This allows stopping execution faster to assertion failure when element is found fast.
run_on_failureSets the keyword to execute in case of a failing Browser keyword. It can be the name of any keyword. If the keyword has arguments those must be separated with two spaces for example My keyword \\ arg1 \\ arg2. If no extra action should be done after a failure, set it to None or any other robot falsy value. Run on failure is not applied when library methods are executed directly from Python.
selector_prefixPrefix for all selectors. This is useful when you need to use add an iframe selector before each selector.
show_keyword_call_bannerIf set to True, will show a banner with the keyword name and arguments before the keyword is executed at the bottom of the page. If set to False, will not show the banner. If set to None, which is the default, will show the banner only if the presenter mode is enabled. Get Page Source and Take Screenshot will not show the banner, because that could negatively affect your test cases/tasks. This feature may be super helpful when you are debugging your tests and using tracing from New Context or Video recording features.
strictIf keyword selector points multiple elements and keywords should interact with one element, keyword will fail if strict mode is true. Strict mode can be changed individually in keywords or by Set Strict Mode keyword.
timeoutTimeout for keywords that operate on elements. The keywords will wait for this time for the element to appear into the page. Defaults to \"10s\" => 10 seconds.
tracing_group_modeDefines how Robot Framework keyword calls are logged in Playwright trace log. Default is Full. For more details, see TracingGroupMode.
", + "shortdoc": "Browser library can be taken into use with optional arguments:", + "tags": [], + "source": "Browser/browser.py", + "lineno": 447 + } + ], + "keywords": [ + { + "name": "Add Cookie", + "args": [ + { + "name": "name", + "type": { + "name": "str", + "typedoc": "string", + "nested": [], + "union": false + }, + "defaultValue": null, + "kind": "POSITIONAL_OR_NAMED", + "required": true, + "repr": "name: str" + }, + { + "name": "value", + "type": { + "name": "str", + "typedoc": "string", + "nested": [], + "union": false + }, + "defaultValue": null, + "kind": "POSITIONAL_OR_NAMED", + "required": true, + "repr": "value: str" + }, + { + "name": "url", + "type": { + "name": "Union", + "typedoc": null, + "nested": [ + { + "name": "str", + "typedoc": "string", + "nested": [], + "union": false + }, + { + "name": "None", + "typedoc": "None", + "nested": [], + "union": false + } + ], + "union": true + }, + "defaultValue": "None", + "kind": "POSITIONAL_OR_NAMED", + "required": false, + "repr": "url: str | None = None" + }, + { + "name": "domain", + "type": { + "name": "Union", + "typedoc": null, + "nested": [ + { + "name": "str", + "typedoc": "string", + "nested": [], + "union": false + }, + { + "name": "None", + "typedoc": "None", + "nested": [], + "union": false + } + ], + "union": true + }, + "defaultValue": "None", + "kind": "POSITIONAL_OR_NAMED", + "required": false, + "repr": "domain: str | None = None" + }, + { + "name": "path", + "type": { + "name": "Union", + "typedoc": null, + "nested": [ + { + "name": "str", + "typedoc": "string", + "nested": [], + "union": false + }, + { + "name": "None", + "typedoc": "None", + "nested": [], + "union": false + } + ], + "union": true + }, + "defaultValue": "None", + "kind": "POSITIONAL_OR_NAMED", + "required": false, + "repr": "path: str | None = None" + }, + { + "name": "expires", + "type": { + "name": "Union", + "typedoc": null, + "nested": [ + { + "name": "str", + "typedoc": "string", + "nested": [], + "union": false + }, + { + "name": "datetime", + "typedoc": "datetime", + "nested": [], + "union": false + }, + { + "name": "None", + "typedoc": "None", + "nested": [], + "union": false + } + ], + "union": true + }, + "defaultValue": "None", + "kind": "POSITIONAL_OR_NAMED", + "required": false, + "repr": "expires: str | datetime | None = None" + }, + { + "name": "httpOnly", + "type": { + "name": "Union", + "typedoc": null, + "nested": [ + { + "name": "bool", + "typedoc": "boolean", + "nested": [], + "union": false + }, + { + "name": "None", + "typedoc": "None", + "nested": [], + "union": false + } + ], + "union": true + }, + "defaultValue": "None", + "kind": "POSITIONAL_OR_NAMED", + "required": false, + "repr": "httpOnly: bool | None = None" + }, + { + "name": "secure", + "type": { + "name": "Union", + "typedoc": null, + "nested": [ + { + "name": "bool", + "typedoc": "boolean", + "nested": [], + "union": false + }, + { + "name": "None", + "typedoc": "None", + "nested": [], + "union": false + } + ], + "union": true + }, + "defaultValue": "None", + "kind": "POSITIONAL_OR_NAMED", + "required": false, + "repr": "secure: bool | None = None" + }, + { + "name": "sameSite", + "type": { + "name": "Union", + "typedoc": null, + "nested": [ + { + "name": "CookieSameSite", + "typedoc": "CookieSameSite", + "nested": [], + "union": false + }, + { + "name": "None", + "typedoc": "None", + "nested": [], + "union": false + } + ], + "union": true + }, + "defaultValue": "None", + "kind": "POSITIONAL_OR_NAMED", + "required": false, + "repr": "sameSite: CookieSameSite | None = None" + } + ], + "returnType": null, + "doc": "

Adds a cookie to the currently active browser context.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
ArgumentsDescription
nameName of the cookie.
valueGiven value for the cookie.
urlGiven url for the cookie. Defaults to None. Either url or the domain / path pair must be set, but not both.
domainGiven domain for the cookie. Defaults to None. Either url or the domain / path pair must be set, but not both.
pathGiven path for the cookie. Defaults to None. Either url or the domain / path pair must be set, but not both.
expiresGiven expiry for the cookie. Can be a date, a unix time or a datetime object. Supports the same formats as the DateTime library or an epoch timestamp. Example: 2027-09-28 16:21:35
httpOnlySets the httpOnly token.
secureSets the secure token.
sameSiteSets the sameSite mode. Can be Strict, Lax or None.
\n

Example:

\n
\nAdd Cookie   foo   bar   http://address.com/path/to/site                                     # Using url argument.\nAdd Cookie   foo   bar   domain=example.com                path=/foo/bar                     # Using domain and path arguments.\nAdd Cookie   foo   bar   http://address.com/path/to/site   expires=2027-09-28 16:21:35       # Expires as timestamp.\nAdd Cookie   foo   bar   http://address.com/path/to/site   expires=1822137695                # Expires as epoch seconds.\n
\n

Comment >>

", + "shortdoc": "Adds a cookie to the currently active browser context.", + "tags": [ + "BrowserControl", + "Setter" + ], + "source": "Browser/keywords/cookie.py", + "lineno": 90 + }, + { + "name": "Add Locator Handler Click", + "args": [ + { + "name": "selector", + "type": { + "name": "str", + "typedoc": "string", + "nested": [], + "union": false + }, + "defaultValue": null, + "kind": "POSITIONAL_OR_NAMED", + "required": true, + "repr": "selector: str" + }, + { + "name": "click_selector", + "type": { + "name": "str", + "typedoc": "string", + "nested": [], + "union": false + }, + "defaultValue": null, + "kind": "POSITIONAL_OR_NAMED", + "required": true, + "repr": "click_selector: str" + }, + { + "name": "", + "type": null, + "defaultValue": null, + "kind": "NAMED_ONLY_MARKER", + "required": false, + "repr": "*" + }, + { + "name": "noWaitAfter", + "type": { + "name": "bool", + "typedoc": "boolean", + "nested": [], + "union": false + }, + "defaultValue": "True", + "kind": "NAMED_ONLY", + "required": false, + "repr": "noWaitAfter: bool = True" + }, + { + "name": "times", + "type": { + "name": "Union", + "typedoc": null, + "nested": [ + { + "name": "int", + "typedoc": "integer", + "nested": [], + "union": false + }, + { + "name": "None", + "typedoc": "None", + "nested": [], + "union": false + } + ], + "union": true + }, + "defaultValue": "None", + "kind": "NAMED_ONLY", + "required": false, + "repr": "times: int | None = None" + }, + { + "name": "click_clickCount", + "type": { + "name": "int", + "typedoc": "integer", + "nested": [], + "union": false + }, + "defaultValue": "1", + "kind": "NAMED_ONLY", + "required": false, + "repr": "click_clickCount: int = 1" + }, + { + "name": "click_delay", + "type": { + "name": "int", + "typedoc": "integer", + "nested": [], + "union": false + }, + "defaultValue": "0", + "kind": "NAMED_ONLY", + "required": false, + "repr": "click_delay: int = 0" + }, + { + "name": "click_force", + "type": { + "name": "bool", + "typedoc": "boolean", + "nested": [], + "union": false + }, + "defaultValue": "False", + "kind": "NAMED_ONLY", + "required": false, + "repr": "click_force: bool = False" + } + ], + "returnType": null, + "doc": "

Add a handler function which will activate when selector is visible and click.

\n

The handler will click the element indicated by click_selector.

\n

When testing a web page, sometimes unexpected overlays, for example an \"Accept Cookies\" dialog, might appear and block the interaction with the page, like the Click keyword. These overlays can be problematic to handle, because they might appear randomly in the page. This keyword allows to create an automatic method, which will close those overlays by clicking the element indicated by click_selector. The handler is activated when the element indicated by selector is visible. For further information, see Playwright's addLocatorHandler method.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
ArgumentsDescription
selectorIs the selector to the element which indicates that the locator handler should be called.
noWaitAfterDefaults to True, which means that the overlay may stay visible after the handler has run. If set to False, Playwright waits until the overlay becomes hidden, and only then the library continues with the action/assertion that triggered the handler.
timesIs how many times the locator handler is called. None, the default, means unlimited.
click_selectorIs the selector to the element to be clicked.
click_clickCountIs the number of times to click the element. Defaults to 1.
click_delayTime to wait between mousedown and mouseup in milliseconds. Defaults to 0.
click_forceWhether to bypass checks and dispatch the event directly. Defaults to false.
\n

The arguments click_selector, click_clickCount, click_delay and click_force correspond to the arguments of the Click With Options keyword, but click_delay is given as a plain number of milliseconds. The selector, noWaitAfter and times are for the locator handler. The handler is tied to the active page, if there is need to add handler to another page, this keyword needs to be called separately for each page. If the times argument is set to a positive value, the locator handler is removed after the handler has been called the specified number of times.

\n

Example add locator handler to click button with id=\"ButtonInOverlay\" when id=Overlay is visible:

\n
\nNew Page    ${URL}\nAdd Locator Handler Click    id=Overlay    id=ButtonInOverlay     # Add locator handler to page\nType Text    id:username    user    # If element with id=Overlay appears, the handler will click the button id=ButtonInOverlay\nType Text    id:password    password    # Or if overlay is visible here, then handler is called here\nClick    id:login\nRemove Locator Handler    id=Overlay    # Removes the locator handler from page\n
", + "shortdoc": "Add a handler function which will activate when ``selector`` is visible and click.", + "tags": [ + "PageContent", + "Setter" + ], + "source": "Browser/keywords/locator_handler.py", + "lineno": 24 + }, + { + "name": "Add Locator Handler Custom", + "args": [ + { + "name": "selector", + "type": { + "name": "str", + "typedoc": "string", + "nested": [], + "union": false + }, + "defaultValue": null, + "kind": "POSITIONAL_OR_NAMED", + "required": true, + "repr": "selector: str" + }, + { + "name": "handler_spec", + "type": { + "name": "list", + "typedoc": "list", + "nested": [ + { + "name": "dict", + "typedoc": "dictionary", + "nested": [], + "union": false + } + ], + "union": false + }, + "defaultValue": null, + "kind": "POSITIONAL_OR_NAMED", + "required": true, + "repr": "handler_spec: list[dict]" + }, + { + "name": "noWaitAfter", + "type": { + "name": "bool", + "typedoc": "boolean", + "nested": [], + "union": false + }, + "defaultValue": "True", + "kind": "POSITIONAL_OR_NAMED", + "required": false, + "repr": "noWaitAfter: bool = True" + }, + { + "name": "times", + "type": { + "name": "Union", + "typedoc": null, + "nested": [ + { + "name": "int", + "typedoc": "integer", + "nested": [], + "union": false + }, + { + "name": "None", + "typedoc": "None", + "nested": [], + "union": false + } + ], + "union": true + }, + "defaultValue": "None", + "kind": "POSITIONAL_OR_NAMED", + "required": false, + "repr": "times: int | None = None" + } + ], + "returnType": null, + "doc": "

Add a handler function which will activate when selector is visible and performs handler specification.

\n

When the element indicated by selector is visible, the handler will perform the actions specified in the handler_spec.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
ArgumentsDescription
selectorIs the selector to the element which indicates that the locator handler should be called.
handler_specIs a list of dictionaries which defines the actions to be performed.
noWaitAfterDefaults to True, which means that the overlay may stay visible after the handler has run. If set to False, Playwright waits until the overlay becomes hidden, and only then the library continues with the action/assertion that triggered the handler.
timesIs how many times the locator handler is called. None, the default, means unlimited.
\n

The handler_spec is a list of dictionaries, where each dictionary defines one action. The dictionary must contain the key action which defines the action to be performed. The action can be one of the following: click, fill, check and uncheck. Action is also case insensitive. The dictionary must also contain the key selector which defines the element to be interacted with. The fill action must also contain the key value which defines the value to be filled in the element. For the other actions the key value must not be defined. Additional keys are passed to the action as keyword arguments. For example for the click action refer to Playwright's documentation to see which options are possible.

\n

The selectors in the handler_spec are not resolved in strict mode. If a selector matches more than one element, the first matching element is used. If an action in the handler fails, the error is only logged on the Browser library node side and the keyword which triggered the handler does not fail because of it.

\n

The selector, noWaitAfter and times are for the locator handler method. The handler is tied to the active page, if there is need to add handler to another page, this keyword needs to be called separately for each page. If the times argument is set to a positive value, the locator handler is removed after the handler has been called the specified number of times.

\n

Running the handler will alter your page state mid-test. For example it will change the currently focused element and move the mouse. Make sure that keywords that run after the handler are self-contained and do not rely on the focus and mouse state being unchanged.

\n

Please note that the automatic argument conversion is not done for the handler_spec dictionary. This is because Robot Framework does not convert values inside the dictionary that are actually arguments to a separate Playwright API call. Therefore the user is responsible for converting the values to the correct type. For example if a timeout is needed, the value must be converted to a number on the Robot Framework test data side.

\n

Example adds locator handler to fill input id=overlayInput with value \"Hello\" and click element id=OverlayCloseButton when id=Overlay is visible:

\n
\nNew Page    ${URL}\nVAR    &{handler_spec_fill}\n...    action=Fill\n...    selector=id=overlayInput\n...    value=Hello\nVAR    &{handler_spec_click}\n...    action=click\n...    selector=id=OverlayCloseButton\nAdd Locator Handler Custom\n...    id=overlay\n...    [${handler_spec_fill}, ${handler_spec_click}]\nType Text    id:username    user    # If element with id=overlay appears, the handler fills id=overlayInput and clicks id=OverlayCloseButton\nType Text    id:password    password    # Or if overlay is visible here, then handler is called here\nClick    id:login\n
\n

Example with click and different options and types:

\n
\nVAR    &{handler_spec}\n...    action=CLICK    # Action is case insensitive\n...    selector=id=OverlayCloseButton\n...    button=left\n...    clickCount=${1}\n...    delay=${0.1}\n...    force=${True}\nAdd Locator Handler Custom    id=overlay    [${handler_spec}]\n
\n

The keyword can only handle click, fill, check and uncheck Playwright API calls. If there is a need for more complex interactions, it is recommended to create a custom js extension to handle the interactions.

\n

Example:

\n
\nasync function customLocatorHandler(locator, pageLocator, clickLocator, page) {\n    console.log(\"Adding custom locator handler for: \" + locator);\n    const pageLocator = page.locator(locator).first();\n    await page.addLocatorHandler(\n        pageLocator,\n        async () => {\n            console.log(\"Handling custom locator: \" + clickLocator);\n            // More complex interactions can be added here\n            await page.locator(clickLocator).click();\n        }\n    );\n}\nexports.__esModule = true;\nexports.customLocatorHandler = customLocatorHandler;\n
", + "shortdoc": "Add a handler function which will activate when ``selector`` is visible and performs handler specification.", + "tags": [ + "PageContent", + "Setter" + ], + "source": "Browser/keywords/locator_handler.py", + "lineno": 108 + }, + { + "name": "Add Style Tag", + "args": [ + { + "name": "content", + "type": { + "name": "str", + "typedoc": "string", + "nested": [], + "union": false + }, + "defaultValue": null, + "kind": "POSITIONAL_OR_NAMED", + "required": true, + "repr": "content: str" + } + ], + "returnType": null, + "doc": "

Adds a <style type=\"text/css\"> tag with the content.

\n

The tag is added to the currently active page and it is lost when the page is navigated to a new url.

\n\n\n\n\n\n\n\n\n\n
ArgumentsDescription
contentRaw CSS content to be injected into the current page.
\n

Example:

\n
\nAdd Style Tag    \\#username_field:focus {background-color: aqua;}\n
\n

Comment >>

", + "shortdoc": "Adds a