diff --git a/Browser/browser.py b/Browser/browser.py
index 73bfa15a8..1c296910f 100755
--- a/Browser/browser.py
+++ b/Browser/browser.py
@@ -466,27 +466,90 @@ def __init__( # noqa: PLR0915
timeout: timedelta = timedelta(seconds=10),
tracing_group_mode: TracingGroupMode = TracingGroupMode.Full,
):
- """Browser library can be taken into use with optional arguments:
-
- | =Argument= | =Description= |
- | ``auto_closing_level`` | Configure context and page automatic closing. Default is ``TEST``, for more details, see `AutoClosingLevel` |
- | ``auto_delete_passed_tracing`` | If ``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_debug`` | Enable low level debug information from the playwright to playwright-log.txt file. For more details, see `PlaywrightLogTypes`. |
- | ``enable_presenter_mode`` | Automatic 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_executable`` | Dict 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_failure`` | If 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. |
- | ``jsextension`` | Path 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 |
- | ``language`` | Defines language which is used to translate keyword names and documentation. |
- | ``playwright_process_host`` | Hostname / Host address which should be used when spawning the Playwright process. Defaults to 127.0.0.1. |
- | ``playwright_process_port`` | Experimental 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. |
- | ``plugins`` | Allows 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_for`` | Timeout 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_failure`` | Sets 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_prefix`` | Prefix for all selectors. This is useful when you need to use add an iframe selector before each selector. |
- | ``show_keyword_call_banner`` | If 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. |
- | ``strict`` | If 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. |
- | ``timeout`` | Timeout 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_mode`` | Defines how Robot Framework keyword calls are logged in Playwright trace log. Default is `Full`. For more details, see `TracingGroupMode`. |
+ """Browser library can be taken into use with optional arguments.
+
+ *Arguments:*
+ - ``_``: Positional arguments are ignored. All arguments must be passed as named arguments.
+ - ``auto_closing_level``: Configure context and page automatic closing.
+ Default is ``TEST``, for more details, see `AutoClosingLevel`
+ - ``auto_delete_passed_tracing``: If ``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_debug``: Enable low level debug information from the
+ playwright to playwright-log.txt file. For more details, see
+ `PlaywrightLogTypes`.
+ - ``enable_presenter_mode``: Automatic 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_executable``: Dict 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_failure``: If 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.
+ - ``jsextension``: Path 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
+ - ``language``: Defines language which is used to translate keyword names and
+ documentation.
+ - ``playwright_process_host``: Hostname / Host address which should be used
+ when spawning the Playwright process. Defaults to 127.0.0.1.
+ - ``playwright_process_port``: Experimental 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.
+ - ``plugins``: Allows 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_for``: Timeout 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_failure``: Sets 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_prefix``: Prefix for all selectors. This is useful when you need
+ to use add an iframe selector before each selector.
+ - ``show_keyword_call_banner``: If 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.
+ - ``strict``: If 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.
+ - ``timeout``: Timeout 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_mode``: Defines how Robot Framework keyword calls are logged
+ in Playwright trace log. Default is ``Full``.
+
"""
if _:
raise ValueError("Browser library does not accept positional arguments.")
diff --git a/Browser/keywords/assertion_formatter.py b/Browser/keywords/assertion_formatter.py
index b2b170867..ffe7ea7bd 100644
--- a/Browser/keywords/assertion_formatter.py
+++ b/Browser/keywords/assertion_formatter.py
@@ -81,9 +81,16 @@ def set_assertion_formatters(
) -> dict[str, list[str]]:
"""Set keywords formatters for assertions.
- | =Arguments= | =Description= |
- | ``formatters`` | Dictionary of keywords and formatters, where the key is the name of the keyword where the formatters are applied. The dictionary value is a list of formatters which are applied. Formatters for a defined keyword are always overwritten. An empty list will clear all formatters for the keyword. If ``formatters`` is an empty dictionary, then all formatters are cleared from all keywords, in the Global scope, regardless of the ``scope`` argument. |
- | ``scope`` | Defines the lifetime of the formatter, possible values are Global, Suite and Test. |
+ *Arguments:*
+ - ``formatters``: Dictionary of keywords and formatters, where the key is the
+ name of the keyword where the formatters are applied. The dictionary
+ value is a list of formatters which are applied. Formatters for a
+ defined keyword are always overwritten. An empty list will clear all
+ formatters for the keyword. If ``formatters`` is an empty dictionary,
+ then all formatters are cleared from all keywords, in the Global scope,
+ regardless of the ``scope`` argument.
+ - ``scope``: Defines the lifetime of the formatter, possible values are
+ Global, Suite and Test.
Returns the formatters which were in use before this keyword was called.
Formatters defined as lambda functions are not included in the returned value.
diff --git a/Browser/keywords/browser_control.py b/Browser/keywords/browser_control.py
index 1bc87c0b7..5772b5ef7 100644
--- a/Browser/keywords/browser_control.py
+++ b/Browser/keywords/browser_control.py
@@ -77,10 +77,18 @@ def go_to(
):
"""Navigates to the given ``url``.
- | =Arguments= | =Description= |
- | ``url`` | URL to be navigated to. |
- | ``timeout`` | Time to wait for the page to load. If not defined, the library default timeout is used. |
- | ``wait_until`` | When to consider the operation succeeded, defaults to ``load``. The event can be either: ``domcontentloaded`` - consider the operation to be finished when the DOMContentLoaded event is fired. ``load`` - consider the operation to be finished when the load event is fired. ``networkidle`` - consider the operation to be finished when there are no network connections for at least 500 ms. ``commit`` - consider the operation to be finished when the network response is received and the document started loading. |
+ *Arguments:*
+ - ``url``: URL to be navigated to.
+ - ``timeout``: Time to wait for the page to load. If not defined, the library
+ default timeout is used.
+ - ``wait_until``: When to consider the operation succeeded, defaults to
+ ``load``. The event can be either: ``domcontentloaded`` - consider the
+ operation to be finished when the DOMContentLoaded event is fired.
+ ``load`` - consider the operation to be finished when the load event is
+ fired. ``networkidle`` - consider the operation to be finished when
+ there are no network connections for at least 500 ms. ``commit`` -
+ consider the operation to be finished when the network response is
+ received and the document started loading.
Returns the HTTP status code of the navigation request as an integer, or 0 if no response was received.
@@ -155,22 +163,66 @@ def take_screenshot(
) -> str | bytes | Path | None:
"""Takes a screenshot of the current window or element and saves it to disk.
- | =Arguments= | =Description= |
- | ``filename`` | Filename into which to save. The file will be saved into the Robot Framework ${OUTPUTDIR}/browser/screenshot directory by default, but it can be overwritten by providing a custom path or filename. String ``{index}`` in the filename will be replaced with a rolling number. Use this to not overwrite filenames. If filename equals to UUID (case insensitive), then the filename is created by Python uuid; https://docs.python.org/3/library/uuid.html. If filename equals to EMBED (case insensitive) or ${NONE}, then the screenshot is embedded as a Base64 image into the log.html. The image is saved temporarily to the disk and a warning is displayed if removing the temporary file fails. The ${OUTPUTDIR}/browser/screenshot directory is removed at the first suite startup. |
- | ``selector`` | Take a screenshot of the element matched by selector. See the `Finding elements` section for details about the selectors. If not provided, take a screenshot of the current viewport. |
- | ``crop`` | Crops the taken screenshot to the given box. It takes the same dictionary as returned from `Get BoundingBox`. Cropping only works on a page screenshot, so when no selector is given. |
- | ``disableAnimations`` | When set to ``True``, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment depending on their duration: - finite animations are fast-forwarded to completion, so they'll fire the transitionend event. - infinite animations are cancelled to initial state, and then played over after the screenshot. |
- | ``fileType`` | ``png`` or ``jpeg``. Specifies the screenshot type, defaults to ``png``. |
- | ``fullPage`` | When ``True``, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Defaults to ``False``. |
- | ``highlight_selector`` | Highlights elements while taking the screenshot. Highlight method is ``playwright``. This highlighting also automatically happens if the Robot Framework variable ``${ROBOT_FRAMEWORK_BROWSER_FAILING_SELECTOR}`` is set to a selector string and is available on page. This is the case if ``highlight_on_failure`` has been set to ``True`` when importing Browser library. |
- | ``log_screenshot`` | When set to ``False`` the screenshot is taken but not logged into log.html. |
- | ``mask`` | Specify selectors that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box ``#FF00FF`` that completely covers their bounding box. The argument can take a single selector string or a list of selector strings if multiple different elements should be masked. |
- | ``maskColor`` | Specify the color of the overlay box for masked elements, in CSS color format. Default color is pink #FF00FF. |
- | ``omitBackground`` | Hides the default white background and allows capturing screenshots with transparency. Not applicable to jpeg images. |
- | ``quality`` | The quality of the image, between 0-100. Not applicable to png images. |
- | ``scale`` | ``css`` or ``device``. ``css`` will reduce the image size and ``device`` keeps the image in its original size. Defaults to ``device``. |
- | ``return_as`` | Defines what this keyword returns. Possible values are documented in `ScreenshotReturnType`. It can be either a path to the screenshot file as string or Path object, or the image data as bytes or base64 encoded string. When the screenshot is embedded into the log, ``path_string`` returns the string ``EMBED``. |
- | ``timeout`` | Maximum time how long taking the screenshot can last, defaults to the library timeout. Supports Robot Framework time format, like 10s or 1 min, pass 0 to disable the timeout. The default value can be changed by using the `Set Browser Timeout` keyword. |
+ *Arguments:*
+ - ``filename``: Filename into which to save. The file will be saved into the
+ Robot Framework ${OUTPUTDIR}/browser/screenshot directory by default,
+ but it can be overwritten by providing a custom path or filename. String
+ ``{index}`` in the filename will be replaced with a rolling number. Use
+ this to not overwrite filenames. If filename equals to UUID (case
+ insensitive), then the filename is created by Python uuid;
+ https://docs.python.org/3/library/uuid.html. If filename equals to EMBED
+ (case insensitive) or ${NONE}, then the screenshot is embedded as a
+ Base64 image into the log.html. The image is saved temporarily to the
+ disk and a warning is displayed if removing the temporary file fails.
+ The ${OUTPUTDIR}/browser/screenshot directory is removed at the first
+ suite startup.
+ - ``selector``: Take a screenshot of the element matched by selector. See the
+ `Finding elements` section for details about the selectors. If not
+ provided, take a screenshot of the current viewport.
+ - ``crop``: Crops the taken screenshot to the given box. It takes the same
+ dictionary as returned from `Get BoundingBox`. Cropping only works on a
+ page screenshot, so when no selector is given.
+ - ``disableAnimations``: When set to ``True``, stops CSS animations, CSS
+ transitions and Web Animations. Animations get different treatment
+ depending on their duration: - finite animations are fast-forwarded to
+ completion, so they'll fire the transitionend event. - infinite
+ animations are cancelled to initial state, and then played over after
+ the screenshot.
+ - ``fileType``: ``png`` or ``jpeg``. Specifies the screenshot type, defaults
+ to ``png``.
+ - ``fullPage``: When ``True``, takes a screenshot of the full scrollable page,
+ instead of the currently visible viewport. Defaults to ``False``.
+ - ``highlight_selector``: Highlights elements while taking the screenshot.
+ Highlight method is ``playwright``. This highlighting also automatically
+ happens if the Robot Framework variable
+ ``${ROBOT_FRAMEWORK_BROWSER_FAILING_SELECTOR}`` is set to a selector
+ string and is available on page. This is the case if
+ ``highlight_on_failure`` has been set to ``True`` when importing Browser
+ library.
+ - ``log_screenshot``: When set to ``False`` the screenshot is taken but not
+ logged into log.html.
+ - ``mask``: Specify selectors that should be masked when the screenshot is
+ taken. Masked elements will be overlaid with a pink box ``#FF00FF`` that
+ completely covers their bounding box. The argument can take a single
+ selector string or a list of selector strings if multiple different
+ elements should be masked.
+ - ``maskColor``: Specify the color of the overlay box for masked elements, in
+ CSS color format. Default color is pink #FF00FF.
+ - ``omitBackground``: Hides the default white background and allows capturing
+ screenshots with transparency. Not applicable to jpeg images.
+ - ``quality``: The quality of the image, between 0-100. Not applicable to png
+ images.
+ - ``scale``: ``css`` or ``device``. ``css`` will reduce the image size and
+ ``device`` keeps the image in its original size. Defaults to ``device``.
+ - ``return_as``: Defines what this keyword returns. Possible values are
+ documented in `ScreenshotReturnType`. It can be either a path to the
+ screenshot file as string or Path object, or the image data as bytes or
+ base64 encoded string. When the screenshot is embedded into the log,
+ ``path_string`` returns the string ``EMBED``.
+ - ``timeout``: Maximum time how long taking the screenshot can last, defaults
+ to the library timeout. Supports Robot Framework time format, like 10s
+ or 1 min, pass 0 to disable the timeout. The default value can be
+ changed by using the `Set Browser Timeout` keyword.
Keyword uses strict mode if selector is defined. See `Finding elements` for more details
about strict mode.
@@ -372,9 +424,13 @@ def set_browser_timeout(
) -> str:
"""Sets the timeout used by most input and getter keywords.
- | =Arguments= | =Description= |
- | ``timeout`` | The timeout is set for the current Playwright context and for new contexts. Supports Robot Framework [https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#time-format|time format]. |
- | ``scope`` | Scope defines the live time of that setting. Available values are ``Global``, ``Suite`` or ``Test`` / ``Task``. See `Scope Setting` for more details. |
+ *Arguments:*
+ - ``timeout``: The timeout is set for the current Playwright context and for
+ new contexts. Supports Robot Framework
+ [https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#time-format | time format].
+ - ``scope``: Scope defines the live time of that setting. Available values are
+ ``Global``, ``Suite`` or ``Test`` / ``Task``. See `Scope Setting` for
+ more details.
Returns the previous value of the timeout.
@@ -409,9 +465,12 @@ def set_retry_assertions_for(
) -> str:
"""Sets the timeout used in retrying assertions when they fail.
- | =Arguments= | =Description= |
- | ``timeout`` | Assertion retry timeout will determine how long Browser library will retry an assertion to be true. |
- | ``scope`` | Scope defines the live time of that setting. Available values are ``Global``, ``Suite`` or ``Test`` / ``Task``. See `Scope` for more details. |
+ *Arguments:*
+ - ``timeout``: Assertion retry timeout will determine how long Browser library
+ will retry an assertion to be true.
+ - ``scope``: Scope defines the live time of that setting. Available values are
+ ``Global``, ``Suite`` or ``Test`` / ``Task``. See `Scope` for more
+ details.
The other keyword `Set Browser Timeout` controls how long Playwright
will wait on the node side for elements to fulfill the
@@ -440,9 +499,13 @@ def set_selector_prefix(
) -> str:
"""Sets the prefix for all selectors in the given scope.
- | =Arguments= | =Description= |
- | ``prefix`` | Prefix for all selectors. Prefix and selector will be separated by a single space. Use ``${None}`` or ``${EMPTY}`` to disable the prefix. |
- | ``scope`` | Scope defines the live time of that setting. Available values are ``Global``, ``Suite`` or ``Test`` / ``Task``. See `Scope` for more details. |
+ *Arguments:*
+ - ``prefix``: Prefix for all selectors. Prefix and selector will be separated
+ by a single space. Use ``${None}`` or ``${EMPTY}`` to disable the
+ prefix.
+ - ``scope``: Scope defines the live time of that setting. Available values are
+ ``Global``, ``Suite`` or ``Test`` / ``Task``. See `Scope` for more
+ details.
Returns the previous value of the prefix.
@@ -473,9 +536,13 @@ def set_highlight_on_failure(
) -> bool:
"""Controls if the element is highlighted on failure.
- | =Arguments= | =Description= |
- | ``highlight`` | If ``True``, the element is highlighted when a screenshot is taken on failure. If ``False``, the element is not highlighted in the screenshot. |
- | ``scope`` | Scope defines the live time of that setting. Available values are ``Global``, ``Suite`` or ``Test`` / ``Task``. See `Scope` for more details. |
+ *Arguments:*
+ - ``highlight``: If ``True``, the element is highlighted when a screenshot is
+ taken on failure. If ``False``, the element is not highlighted in the
+ screenshot.
+ - ``scope``: Scope defines the live time of that setting. Available values are
+ ``Global``, ``Suite`` or ``Test`` / ``Task``. See `Scope` for more
+ details.
Returns the previous value of the setting.
@@ -500,10 +567,15 @@ def show_keyword_banner(
The banner can also be controlled by an import setting of the Browser library. (see `Importing` section)
- | =Arguments= | =Description= |
- | ``show`` | If ``True``, the banner is shown on the page. If ``False``, the banner is not shown on the page. If ``${None}``, the banner is shown on the page only when running in presenter mode. |
- | ``style`` | Additional CSS styles to be applied to the banner. These styles may override the existing ones for the banner. |
- | ``scope`` | Scope defines the live time of that setting. Available values are ``Global``, ``Suite`` or ``Test`` / ``Task``. See `Scope` for more details. |
+ *Arguments:*
+ - ``show``: If ``True``, the banner is shown on the page. If ``False``, the
+ banner is not shown on the page. If ``${None}``, the banner is shown on
+ the page only when running in presenter mode.
+ - ``style``: Additional CSS styles to be applied to the banner. These styles
+ may override the existing ones for the banner.
+ - ``scope``: Scope defines the live time of that setting. Available values are
+ ``Global``, ``Suite`` or ``Test`` / ``Task``. See `Scope` for more
+ details.
Returns the previous settings as a dictionary with the keys ``show`` and ``style``.
@@ -535,9 +607,9 @@ def set_viewport_size(self, width: int, height: int):
so you should set the viewport size with `New Context`
before opening the page itself.
- | =Arguments= | =Description= |
- | ``width`` | Sets the width in pixels. |
- | ``height`` | Sets the height in pixels. |
+ *Arguments:*
+ - ``width``: Sets the width in pixels.
+ - ``height``: Sets the height in pixels.
[https://forum.robotframework.org/t//4333|Comment >>]
"""
@@ -551,8 +623,9 @@ def set_viewport_size(self, width: int, height: int):
def set_offline(self, offline: bool = True):
"""Toggles the current context's offline emulation.
- | =Arguments= | =Description= |
- | ``offline`` | Toggles the offline mode. Set to ``False`` to switch back to online mode. Defaults to ``True``. |
+ *Arguments:*
+ - ``offline``: Toggles the offline mode. Set to ``False`` to switch back to
+ online mode. Defaults to ``True``.
[https://forum.robotframework.org/t//4330|Comment >>]
"""
@@ -570,10 +643,10 @@ def set_geolocation(
The accuracy of the location must be a non-negative number and defaults to 0. When
creating the context, grant the ``geolocation`` permission so that pages can read the geolocation.
- | =Arguments= | =Description= |
- | ``latitude`` | Latitude between -90 and 90. |
- | ``longitude`` | Longitude between -180 and 180. |
- | ``accuracy`` | Non-negative accuracy value. Defaults to 0. |
+ *Arguments:*
+ - ``latitude``: Latitude between -90 and 90.
+ - ``longitude``: Longitude between -180 and 180.
+ - ``accuracy``: Non-negative accuracy value. Defaults to 0.
Example:
| ${permissions} = Create List geolocation
@@ -599,9 +672,11 @@ def reload(
):
"""Reloads current active page.
- | =Arguments= | =Description= |
- | ``timeout`` | Maximum time for the reload to succeed. If not given, the currently set browser timeout is used. |
- | ``waitUntil`` | When to consider the operation succeeded, defaults to ``load``. |
+ *Arguments:*
+ - ``timeout``: Maximum time for the reload to succeed. If not given, the
+ currently set browser timeout is used.
+ - ``waitUntil``: When to consider the operation succeeded, defaults to
+ ``load``.
``waitUntil`` events can be either:
``domcontentloaded`` - consider the operation to be finished when the DOMContentLoaded event is fired.
@@ -622,9 +697,13 @@ def reload(
def grant_permissions(self, *permissions: Permission, origin: str | None = None):
"""Grants permissions to the current context.
- | =Arguments= | =Description= |
- | ``permissions`` | Permissions to grant, given as separate arguments. See `Permission` for the available values, for example ``geolocation``, ``notifications``, ``camera`` or ``microphone``. |
- | ``origin`` | The origin to grant the permissions to, e.g. "https://example.com". If not given, the permissions are granted for all origins. |
+ *Arguments:*
+ - ``permissions``: Permissions to grant, given as separate arguments. See
+ `Permission` for the available values, for example ``geolocation``,
+ ``notifications``, ``camera`` or ``microphone``.
+ - ``origin``: The origin to grant the permissions to, e.g.
+ "https://example.com". If not given, the permissions are granted for all
+ origins.
Example:
| `New Context`
@@ -660,8 +739,13 @@ def set_presenter_mode(
When enabled, the element is scrolled into view and highlighted with a border for a while
to visually show what the keyword found.
- | =Arguments= | =Description= |
- | ``mode`` | When set to ``True``, enables presenter mode with default settings. When set to ``False``, disables presenter mode. Can also be a dictionary containing the highlighting configuration options as defined in `HighLightElement`. Fields which are not given use their default values: ``duration`` 2 seconds, ``width`` 2px, ``style`` dotted and ``color`` blue. |
+ *Arguments:*
+ - ``mode``: When set to ``True``, enables presenter mode with default
+ settings. When set to ``False``, disables presenter mode. Can also be a
+ dictionary containing the highlighting configuration options as defined
+ in `HighLightElement`. Fields which are not given use their default
+ values: ``duration`` 2 seconds, ``width`` 2px, ``style`` dotted and
+ ``color`` blue.
The keyword returns the previous presenter mode value, allowing you to restore it later.
diff --git a/Browser/keywords/clock.py b/Browser/keywords/clock.py
index 5f3d129bc..357480ef3 100644
--- a/Browser/keywords/clock.py
+++ b/Browser/keywords/clock.py
@@ -23,9 +23,9 @@ class Clock(LibraryComponent):
def set_time(self, time: datetime, clock_type: ClockType = ClockType.install):
"""Sets the time of the browser's internal clock.
- | =Arguments= | =Description= |
- | time | The time to set. Supports Robot Framework date and time format |
- | clock_type | The clock type to set. Default is ``install``. |
+ *Arguments:*
+ - ``time``: The time to set. Supports Robot Framework date and time format
+ - ``clock_type``: The clock type to set. Default is ``install``.
``fixed`` makes ``Date.now`` and ``new Date()`` always return the same
fake time, while all timers keep running.
@@ -69,8 +69,8 @@ def resume_clock(self):
def pause_at(self, time: datetime):
"""Advances the clock by jumping forward in time and pauses it.
- | =Arguments= | =Description= |
- | time | The time to pause the clock at. |
+ *Arguments:*
+ - ``time``: The time to pause the clock at.
Fires due timers at most once. This is equivalent to a user
closing the laptop lid for a while and reopening it at the specified
@@ -99,9 +99,9 @@ def advance_clock(
):
"""Advances the clock by a specified amount of time.
- | =Arguments= | =Description= |
- | time | The time to advance. Supports Robot Framework time format |
- | advance_type | The type of advance. Default is ``fast_forward``. |
+ *Arguments:*
+ - ``time``: The time to advance. Supports Robot Framework time format
+ - ``advance_type``: The type of advance. Default is ``fast_forward``.
``run_for`` advances the clock by firing all the time-related callbacks.
diff --git a/Browser/keywords/cookie.py b/Browser/keywords/cookie.py
index 67e4c069b..4291620a2 100644
--- a/Browser/keywords/cookie.py
+++ b/Browser/keywords/cookie.py
@@ -101,17 +101,23 @@ def add_cookie( # ruff: ignore[PLR0917]
):
"""Adds a cookie to the currently active browser context.
-
- | =Arguments= | =Description= |
- | ``name`` | Name of the cookie. |
- | ``value`` | Given value for the cookie. |
- | ``url`` | Given url for the cookie. Defaults to None. Either ``url`` or the ``domain`` / ``path`` pair must be set, but not both. |
- | ``domain`` | Given domain for the cookie. Defaults to None. Either ``url`` or the ``domain`` / ``path`` pair must be set, but not both. |
- | ``path`` | Given path for the cookie. Defaults to None. Either ``url`` or the ``domain`` / ``path`` pair must be set, but not both. |
- | ``expires`` | Given expiry for the cookie. Can be a date, a unix time or a datetime object. Supports the same formats as the [http://robotframework.org/robotframework/latest/libraries/DateTime.html|DateTime] library or an epoch timestamp. Example: 2027-09-28 16:21:35 |
- | ``httpOnly`` | Sets the httpOnly token. |
- | ``secure`` | Sets the secure token. |
- | ``sameSite`` | Sets the sameSite mode. Can be ``Strict``, ``Lax`` or ``None``. |
+ *Arguments:*
+ - ``name``: Name of the cookie.
+ - ``value``: Given value for the cookie.
+ - ``url``: Given url for the cookie. Defaults to None. Either ``url`` or the
+ ``domain`` / ``path`` pair must be set, but not both.
+ - ``domain``: Given domain for the cookie. Defaults to None. Either ``url`` or
+ the ``domain`` / ``path`` pair must be set, but not both.
+ - ``path``: Given path for the cookie. Defaults to None. Either ``url`` or the
+ ``domain`` / ``path`` pair must be set, but not both.
+ - ``expires``: Given expiry for the cookie. Can be a date, a unix time or a
+ datetime object. Supports the same formats as the
+ [http://robotframework.org/robotframework/latest/libraries/DateTime.html | DateTime]
+ library or an epoch timestamp. Example: ``2027-09-28 16:21:35``
+ - ``httpOnly``: Sets the httpOnly token.
+ - ``secure``: Sets the secure token.
+ - ``sameSite``: Sets the sameSite mode. Can be ``Strict``, ``Lax`` or
+ ``None``.
Example:
| `Add Cookie` foo bar http://address.com/path/to/site # Using url argument.
@@ -182,9 +188,10 @@ def get_cookie(
) -> DotDict | str:
"""Returns information about the cookie named ``cookie`` as a Robot Framework dot dictionary or a string.
- | =Arguments= | =Description= |
- | ``cookie`` | Name of the cookie to be retrieved. |
- | ``return_type`` | Type of the return value. Can be either ``dictionary`` or ``string``. Defaults to ``dictionary``. |
+ *Arguments:*
+ - ``cookie``: Name of the cookie to be retrieved.
+ - ``return_type``: Type of the return value. Can be either ``dictionary`` or
+ ``string``. Defaults to ``dictionary``.
If ``return_type`` is ``dictionary`` or ``dict``, then the keyword returns a Robot Framework
[https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#accessing-list-and-dictionary-items|dot dictionary].
diff --git a/Browser/keywords/coverage.py b/Browser/keywords/coverage.py
index ae6503b17..8bb5f9f6a 100644
--- a/Browser/keywords/coverage.py
+++ b/Browser/keywords/coverage.py
@@ -37,13 +37,19 @@ def start_coverage(
) -> str:
"""Starts the coverage for the current page.
- | =Arguments= | =Description= |
- | ``config_file`` | Optional path to [https://www.npmjs.com/package/monocart-coverage-reports#options|options file]. If the file does not exist, it is ignored. |
- | ``coverage_type`` | Type of coverage to start. Default is ``all``. |
- | ``path`` | Absolute or relative directory path (relative to ``${OUTPUT_DIR}/browser/coverage/``) where the coverage is stored in a directory with the page id name. |
- | ``raw`` | Whether to save raw coverage data. Default is ``False``. |
- | ``reportAnonymousScripts`` | Whether to report anonymous scripts. Default is ``False``. Only valid for JS coverage. |
- | ``resetOnNavigation`` | Whether to reset coverage on navigation. Default is ``True``. |
+ *Arguments:*
+ - ``config_file``: Optional path to
+ [https://www.npmjs.com/package/monocart-coverage-reports#options |
+ options file]. If the file does not exist, it is ignored.
+ - ``coverage_type``: Type of coverage to start. Default is ``all``.
+ - ``path``: Absolute or relative directory path (relative to
+ ``${OUTPUT_DIR}/browser/coverage/``) where the coverage is stored in a
+ directory with the page id name.
+ - ``raw``: Whether to save raw coverage data. Default is ``False``.
+ - ``reportAnonymousScripts``: Whether to report anonymous scripts. Default is
+ ``False``. Only valid for JS coverage.
+ - ``resetOnNavigation``: Whether to reset coverage on navigation. Default is
+ ``True``.
The ``coverage_type`` can be one of the following:
- ``all``: Both [https://playwright.dev/docs/api/class-coverage/#coverage-start-css-coverage|CSS] and [https://playwright.dev/docs/api/class-coverage/#coverage-start-js-coverage|JS].
@@ -135,12 +141,15 @@ def merge_coverage_reports(
) -> Path:
"""Combines multiple raw coverage reports into a single report.
- | =Arguments= | =Description= |
- | ``input_folder`` | Path to the base folder where the raw coverage reports are located. |
- | ``output_folder`` | Path to the folder where the combined report is stored. |
- | ``config_file`` | Optional path to [https://www.npmjs.com/package/monocart-coverage-reports#options|options file] |
- | ``name`` | Optional name for the combined report. |
- | ``reports`` | Optional list of reporters to create. Default is ``v8``. |
+ *Arguments:*
+ - ``input_folder``: Path to the base folder where the raw coverage reports are
+ located.
+ - ``output_folder``: Path to the folder where the combined report is stored.
+ - ``config_file``: Optional path to
+ [https://www.npmjs.com/package/monocart-coverage-reports#options |
+ options file]
+ - ``name``: Optional name for the combined report.
+ - ``reports``: Optional list of reporters to create. Default is ``v8``.
Returns the path to the ``output_folder``.
diff --git a/Browser/keywords/crawling.py b/Browser/keywords/crawling.py
index 4041f37b2..603641f49 100644
--- a/Browser/keywords/crawling.py
+++ b/Browser/keywords/crawling.py
@@ -25,11 +25,18 @@ def crawl_site(
Returns the list of crawled urls. The order of the returned urls is not
guaranteed to be the order in which the pages were crawled.
- | =Arguments= | =Description= |
- | ``url`` | is the page to start crawling from. If it is given, a `New Page` is opened with that url. If it is not given, crawling starts from the url of the current page. |
- | ``page_crawl_keyword`` | is the keyword that will be executed on every page. It is run without arguments. By default it will take a screenshot on every page. |
- | ``max_number_of_page_to_crawl`` | is the upper limit of pages to crawl. Crawling will stop when this number of pages has been crawled. |
- | ``max_depth_to_crawl`` | is the upper limit of consecutive links followed from the start page. The start page has depth ``0`` and links deeper than this limit are not followed. |
+ *Arguments:*
+ - ``url``: is the page to start crawling from. If it is given, a `New Page` is
+ opened with that url. If it is not given, crawling starts from the url
+ of the current page.
+ - ``page_crawl_keyword``: is the keyword that will be executed on every page.
+ It is run without arguments. By default it will take a screenshot on
+ every page.
+ - ``max_number_of_page_to_crawl``: is the upper limit of pages to crawl.
+ Crawling will stop when this number of pages has been crawled.
+ - ``max_depth_to_crawl``: is the upper limit of consecutive links followed
+ from the start page. The start page has depth ``0`` and links deeper
+ than this limit are not followed.
[https://forum.robotframework.org/t//4243|Comment >>]
"""
diff --git a/Browser/keywords/credential.py b/Browser/keywords/credential.py
index d722e3bb1..6ad137230 100644
--- a/Browser/keywords/credential.py
+++ b/Browser/keywords/credential.py
@@ -38,12 +38,14 @@ def create_credential(
pages that are created from that context. There must be an open context, otherwise
the keyword fails.
- | =Arguments= | =Description= |
- | rpId | Relying party id (typically the site's effective domain). |
- | id_ | Base64url-encoded credential id. Auto-generated if omitted. |
- | privateKey | Base64url-encoded PKCS#8 (DER) private key. Auto-generated if omitted. |
- | publicKey | Base64url-encoded SPKI (DER) public key. Auto-generated if omitted. |
- | userHandle | Base64url-encoded user handle. Auto-generated if omitted. |
+ *Arguments:*
+ - ``rpId``: Relying party id (typically the site's effective domain).
+ - ``id_``: Base64url-encoded credential id. Auto-generated if omitted.
+ - ``privateKey``: Base64url-encoded PKCS#8 (DER) private key. Auto-generated
+ if omitted.
+ - ``publicKey``: Base64url-encoded SPKI (DER) public key. Auto-generated if
+ omitted.
+ - ``userHandle``: Base64url-encoded user handle. Auto-generated if omitted.
Because ``privateKey`` and ``publicKey`` are sensitive information, it is recommended
to wrap their values in the Secret type. The Secret type requires Robot Framework 7.4
@@ -146,9 +148,9 @@ def get_credential(
credential matches, the first match is returned. When no credential matches, the
keyword fails.
- | =Arguments= | =Description= |
- | id_ | Base64url-encoded credential id. |
- | rpId | Relying party id (typically the site's effective domain). |
+ *Arguments:*
+ - ``id_``: Base64url-encoded credential id.
+ - ``rpId``: Relying party id (typically the site's effective domain).
The returned credential is a dictionary with the following keys:
| =Key= | =Description= |
@@ -200,8 +202,8 @@ def get_credential(
def delete_credential(self, id_: str):
"""Deletes the credential with the given id.
- | =Arguments= | =Description= |
- | id_ | Base64url-encoded credential id. |
+ *Arguments:*
+ - ``id_``: Base64url-encoded credential id.
Deleting a credential which does not exist does not fail. There must be an open
context, otherwise the keyword fails.
diff --git a/Browser/keywords/device_descriptors.py b/Browser/keywords/device_descriptors.py
index effb92ef3..26c3688ff 100644
--- a/Browser/keywords/device_descriptors.py
+++ b/Browser/keywords/device_descriptors.py
@@ -42,8 +42,9 @@ def get_devices(self) -> dict:
def get_device(self, name: str) -> dict:
"""Returns a single device descriptor whose name matches ``name`` exactly.
- | =Arguments= | =Description= |
- | ``name`` | Name of the requested device. See Playwright's [https://github.com/microsoft/playwright/blob/master/packages/playwright-core/src/server/deviceDescriptorsSource.json|deviceDescriptorsSource.json] for a formatted list. |
+ *Arguments:*
+ - ``name``: Name of the requested device. See Playwright's
+ [https://github.com/microsoft/playwright/blob/master/packages/playwright-core/src/server/deviceDescriptorsSource.json|deviceDescriptorsSource.json] for a formatted list.
The keyword fails if there is no device with that name. The matching is
case sensitive.
diff --git a/Browser/keywords/evaluation.py b/Browser/keywords/evaluation.py
index 2d5e7f311..c4093c28e 100644
--- a/Browser/keywords/evaluation.py
+++ b/Browser/keywords/evaluation.py
@@ -45,11 +45,22 @@ def evaluate_javascript(
available, but Robot Framework variables and Python objects are not. Only ``arg``
and the resolved element(s) are passed into the page.
- | =Arguments= | =Description= |
- | ``selector`` | Selector to resolve and pass to the JavaScript function. This will be the first argument the function receives if not ``${None}``. ``selector`` is optional and can be omitted. If given a selector, a function is necessary, with an argument to capture the element. For example ``(element) => document.activeElement === element`` See the `Finding elements` section for details about the selectors. |
- | ``*function`` | A valid javascript function or a javascript function body. These arguments can be used to write readable multiline JavaScript. |
- | ``arg`` | an additional argument that can be handed over to the JavaScript function. It is the second argument of the function when a ``selector`` is given, otherwise the first one. This argument must be JSON serializable. ElementHandles are not supported. |
- | ``all_elements`` | defines if only the single element found by ``selector`` is handed over to the function or if set to ``True`` all found elements are handed over as array. |
+ *Arguments:*
+ - ``selector``: Selector to resolve and pass to the JavaScript function. This
+ will be the first argument the function receives if not ``${None}``.
+ ``selector`` is optional and can be omitted. If given a selector, a
+ function is necessary, with an argument to capture the element.
+
+ For example ``(element) => document.activeElement === element``
+ - ``*function``: A valid javascript function or a javascript function body.
+ These arguments can be used to write readable multiline JavaScript.
+ - ``arg``: an additional argument that can be handed over to the JavaScript
+ function. It is the second argument of the function when a ``selector``
+ is given, otherwise the first one. This argument must be JSON
+ serializable. ElementHandles are not supported.
+ - ``all_elements``: defines if only the single element found by ``selector``
+ is handed over to the function or if set to ``True`` all found elements
+ are handed over as array.
The value returned by the JavaScript is transferred as JSON and must therefore be
JSON serializable. DOM nodes and other non serializable objects can not be returned.
@@ -110,13 +121,21 @@ def highlight_elements(
elements in the page. Keyword does not scroll elements to viewport and highlighted element might be
outside the viewport. Use `Scroll To Element` keyword to scroll element in viewport.
- | =Arguments= | =Description= |
- | ``selector`` | Selectors which shall be highlighted. See the `Finding elements` section for details about the selectors. |
- | ``duration`` | Sets for how long the selector shall be highlighted. Defaults to ``5s`` => 5 seconds. If set to 0 seconds, the highlighting is not deleted. |
- | ``width`` | Sets the width of the highlight border. Defaults to 2px. |
- | ``style`` | Sets the style of the border. Defaults to dotted. |
- | ``color`` | Sets the color of the border. Valid colors i.e. are: ``red``, ``blue``, ``yellow``, ``pink``, ``black`` |
- | ``mode`` | Sets the mode of the highlight. Valid modes are: ``border`` (classic mode), ``playwright`` (Playwright's native one) and ``both``. Defaults to ``border``. If ``playwright`` is used, ``width``, ``style`` and ``color`` are ignored and only one highlighting can happen at the same time. |
+ *Arguments:*
+ - ``selector``: Selectors which shall be highlighted. See the `Finding
+ elements` section for details about the selectors.
+ - ``duration``: Sets for how long the selector shall be highlighted. Defaults
+ to ``5s`` => 5 seconds. If set to 0 seconds, the highlighting is not
+ deleted.
+ - ``width``: Sets the width of the highlight border. Defaults to 2px.
+ - ``style``: Sets the style of the border. Defaults to dotted.
+ - ``color``: Sets the color of the border. Valid colors i.e. are: ``red``,
+ ``blue``, ``yellow``, ``pink``, ``black``
+ - ``mode``: Sets the mode of the highlight. Valid modes are: ``border``
+ (classic mode), ``playwright`` (Playwright's native one) and ``both``.
+ Defaults to ``border``. If ``playwright`` is used, ``width``, ``style``
+ and ``color`` are ignored and only one highlighting can happen at the
+ same time.
Keyword does not fail if selector resolves to multiple elements.
@@ -161,8 +180,8 @@ def add_style_tag(self, content: str):
The tag is added to the currently active page and it is lost when the page is
navigated to a new url.
- | =Arguments= | =Description= |
- | ``content`` | Raw CSS content to be injected into the current page. |
+ *Arguments:*
+ - ``content``: Raw CSS content to be injected into the current page.
Example:
| `Add Style Tag` \\#username_field:focus {background-color: aqua;}
@@ -183,11 +202,19 @@ def download(
) -> DownloadInfo:
"""Download given url content.
- | =Arguments= | =Description= |
- | ``url`` | URL to the file that shall be downloaded. |
- | ``saveAs`` | Path where the file shall be saved persistently. If empty, generated unique path (GUID) is used and file is deleted when the context is closed. |
- | ``wait_for_finished`` | If set to ``False`` keyword returns immediately after the download has started. Defaults to ``True``. |
- | ``download_timeout`` | Maximum total time for the file to be fetched and saved. If the file is not fetched within this time, the keyword fails. If it is fetched but not saved, the download is cancelled and the keyword fails. If ``wait_for_finished`` is ``False``, only the fetching is limited. If not set, the file must be fetched within the browser timeout, see `Set Browser Timeout`, and there is no limit for saving it. |
+ *Arguments:*
+ - ``url``: URL to the file that shall be downloaded.
+ - ``saveAs``: Path where the file shall be saved persistently. If empty,
+ generated unique path (GUID) is used and file is deleted when the
+ context is closed.
+ - ``wait_for_finished``: If set to ``False`` keyword returns immediately after
+ the download has started. Defaults to ``True``.
+ - ``download_timeout``: Maximum total time for the file to be fetched and
+ saved. If the file is not fetched within this time, the keyword fails.
+ If it is fetched but not saved, the download is cancelled and the
+ keyword fails. If ``wait_for_finished`` is ``False``, only the fetching
+ is limited. If not set, the file must be fetched within the browser
+ timeout, see `Set Browser Timeout`, and there is no limit for saving it.
Keyword returns dictionary of type `DownloadInfo`.
diff --git a/Browser/keywords/getters.py b/Browser/keywords/getters.py
index a0f62e947..790352ebb 100644
--- a/Browser/keywords/getters.py
+++ b/Browser/keywords/getters.py
@@ -78,15 +78,25 @@ def get_aria_snapshot(
) -> str | dict | list | tuple:
"""Returns the aria snapshot of the element found by ``selector``. See `AriaSnapshotReturnType` for more details and examples.
- | =Arguments= | =Description= |
- | ``selector`` | Selector from which the info is to be retrieved. See the `Finding elements` section for details about the selectors. |
- | ``return_type`` | Defines the return type. Possible values are ``yaml`` (default), ``dict`` and ``parsed``. If ``yaml`` is selected, the returned value is a string in YAML format. If ``dict`` is selected, the returned value is a dictionary. If ``parsed`` is selected, the returned value is a tree of node dictionaries. |
- | ``assertion_operator`` | See `Assertions` for further details. Defaults to None. |
- | ``assertion_expected`` | Expected value for the state |
- | ``message`` | overrides the default error message for assertion. |
- | ``mode`` | Defines the snapshot mode. Possible values are ``default`` (default) and ``ai``. See `AriaSnapshotMode` for more details. |
- | ``depth`` | Limits the snapshot to the given number of tree levels. Must be a positive integer. Defaults to ``None``, which does not limit the depth. |
- | ``boxes`` | If ``True``, the bounding box of each element is appended to its line as ``[box=x,y,width,height]``. Coordinates are relative to the viewport, in CSS pixels. Defaults to ``False``. |
+ *Arguments:*
+ - ``selector``: Selector from which the info is to be retrieved. See the
+ `Finding elements` section for details about the selectors.
+ - ``return_type``: Defines the return type. Possible values are ``yaml``
+ (default), ``dict`` and ``parsed``. If ``yaml`` is selected, the
+ returned value is a string in YAML format. If ``dict`` is selected, the
+ returned value is a dictionary. If ``parsed`` is selected, the returned
+ value is a tree of node dictionaries.
+ - ``assertion_operator``: See `Assertions` for further details. Defaults to
+ None.
+ - ``assertion_expected``: Expected value for the state
+ - ``message``: overrides the default error message for assertion.
+ - ``mode``: Defines the snapshot mode. Possible values are ``default``
+ (default) and ``ai``. See `AriaSnapshotMode` for more details.
+ - ``depth``: Limits the snapshot to the given number of tree levels. Must be a
+ positive integer. Defaults to ``None``, which does not limit the depth.
+ - ``boxes``: If ``True``, the bounding box of each element is appended to its
+ line as ``[box=x,y,width,height]``. Coordinates are relative to the
+ viewport, in CSS pixels. Defaults to ``False``.
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -153,10 +163,11 @@ def get_url(
) -> str | dict | tuple:
"""Returns the current URL.
- | =Arguments= | =Description= |
- | ``assertion_operator`` | See `Assertions` for further details. Defaults to None. |
- | ``assertion_expected`` | Expected value for the state |
- | ``message`` | overrides the default error message for assertion. |
+ *Arguments:*
+ - ``assertion_operator``: See `Assertions` for further details. Defaults to
+ None.
+ - ``assertion_expected``: Expected value for the state
+ - ``message``: overrides the default error message for assertion.
Optionally asserts that it matches the specified assertion. See `Assertions` for further details
for the assertion arguments. By default assertion is not done.
@@ -183,10 +194,11 @@ def get_page_source(
) -> str | dict | tuple:
"""Gets the page's HTML source as a string.
- | =Arguments= | =Description= |
- | ``assertion_operator`` | See `Assertions` for further details. Defaults to None. |
- | ``assertion_expected`` | Expected value for the state |
- | ``message`` | overrides the default error message for assertion. |
+ *Arguments:*
+ - ``assertion_operator``: See `Assertions` for further details. Defaults to
+ None.
+ - ``assertion_expected``: Expected value for the state
+ - ``message``: overrides the default error message for assertion.
Optionally does a string assertion. See `Assertions` for further details for
the assertion arguments. By default assertion is not done.
@@ -225,10 +237,11 @@ def get_title(
) -> str | dict | tuple:
"""Returns the title of the current page.
- | =Arguments= | =Description= |
- | ``assertion_operator`` | See `Assertions` for further details. Defaults to None. |
- | ``assertion_expected`` | Expected value for the state |
- | ``message`` | overrides the default error message for assertion. |
+ *Arguments:*
+ - ``assertion_operator``: See `Assertions` for further details. Defaults to
+ None.
+ - ``assertion_expected``: Expected value for the state
+ - ``message``: overrides the default error message for assertion.
Optionally asserts that title matches the specified assertion. See `Assertions`
for further details for the assertion arguments. By default assertion is not done.
@@ -267,12 +280,17 @@ def get_text(
Keyword can also return the value property text of ``input`` or ``textarea`` elements.
See the `Finding elements` section for details about the selectors.
- | =Arguments= | =Description= |
- | ``selector`` | Selector from which the text is to be retrieved. See the `Finding elements` section for details about the selectors. |
- | ``assertion_operator`` | See `Assertions` for further details. Defaults to None. |
- | ``assertion_expected`` | Expected value for the state |
- | ``message`` | overrides the default error message for assertion. |
- | ``text_type`` | How text is returned. Possible values are ``allInnerTexts``, ``allTextContents``, ``innerText``, ``inputValue``, and ``innerHTML``. Defaults to ``None``, which returns the value of ``input`` and ``textarea`` elements and the inner text of all other elements. |
+ *Arguments:*
+ - ``selector``: Selector from which the text is to be retrieved. See the
+ `Finding elements` section for details about the selectors.
+ - ``assertion_operator``: See `Assertions` for further details. Defaults to
+ None.
+ - ``assertion_expected``: Expected value for the state
+ - ``message``: overrides the default error message for assertion.
+ - ``text_type``: How text is returned. Possible values are ``allInnerTexts``,
+ ``allTextContents``, ``innerText``, ``inputValue``, and ``innerHTML``.
+ Defaults to ``None``, which returns the value of ``input`` and
+ ``textarea`` elements and the inner text of all other elements.
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
The ``text_type`` argument determines how text is returned. The ``allInnerTexts`` and
@@ -336,12 +354,14 @@ def get_property(
) -> Any:
"""Returns the ``property`` of the element found by ``selector``.
- | =Arguments= | =Description= |
- | ``selector`` | Selector from which the info is to be retrieved. See the `Finding elements` section for details about the selectors. |
- | ``property`` | Requested property name. |
- | ``assertion_operator`` | See `Assertions` for further details. Defaults to None. |
- | ``assertion_expected`` | Expected value for the state |
- | ``message`` | overrides the default error message for assertion. |
+ *Arguments:*
+ - ``selector``: Selector from which the info is to be retrieved. See the
+ `Finding elements` section for details about the selectors.
+ - ``property``: Requested property name.
+ - ``assertion_operator``: See `Assertions` for further details. Defaults to
+ None.
+ - ``assertion_expected``: Expected value for the state
+ - ``message``: overrides the default error message for assertion.
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -396,12 +416,14 @@ def get_attribute(
) -> str | tuple | dict | None:
"""Returns the HTML ``attribute`` of the element found by ``selector``.
- | =Arguments= | =Description= |
- | ``selector`` | Selector from which the info is to be retrieved. See the `Finding elements` section for details about the selectors. |
- | ``attribute`` | Requested attribute name. |
- | ``assertion_operator`` | See `Assertions` for further details. Defaults to None. |
- | ``assertion_expected`` | Expected value for the state |
- | ``message`` | overrides the default error message for assertion. |
+ *Arguments:*
+ - ``selector``: Selector from which the info is to be retrieved. See the
+ `Finding elements` section for details about the selectors.
+ - ``attribute``: Requested attribute name.
+ - ``assertion_operator``: See `Assertions` for further details. Defaults to
+ None.
+ - ``assertion_expected``: Expected value for the state
+ - ``message``: overrides the default error message for assertion.
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -458,12 +480,13 @@ def get_attribute_names(
) -> list[str]:
"""Returns all HTML attribute names of an element as a list.
-
- | =Arguments= | =Description= |
- | ``selector`` | Selector from which the info is to be retrieved. See the `Finding elements` section for details about the selectors. |
- | ``assertion_operator`` | See `Assertions` for further details. Defaults to None. |
- | ``*assertion_expected`` | Expected value for the state |
- | ``message`` | overrides the default error message for assertion. |
+ *Arguments:*
+ - ``selector``: Selector from which the info is to be retrieved. See the
+ `Finding elements` section for details about the selectors.
+ - ``assertion_operator``: See `Assertions` for further details. Defaults to
+ None.
+ - ``*assertion_expected``: Expected value for the state
+ - ``message``: overrides the default error message for assertion.
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -511,12 +534,13 @@ def get_classes(
) -> list[str]:
"""Returns all classes of an element as a list.
-
- | =Arguments= | =Description= |
- | ``selector`` | Selector from which the info is to be retrieved. See the `Finding elements` section for details about the selectors. |
- | ``assertion_operator`` | See `Assertions` for further details. Defaults to None. |
- | ``*assertion_expected`` | Expected values for the state |
- | ``message`` | overrides the default error message for assertion. |
+ *Arguments:*
+ - ``selector``: Selector from which the info is to be retrieved. See the
+ `Finding elements` section for details about the selectors.
+ - ``assertion_operator``: See `Assertions` for further details. Defaults to
+ None.
+ - ``*assertion_expected``: Expected values for the state
+ - ``message``: overrides the default error message for assertion.
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -561,12 +585,13 @@ def get_select_options(
Each returned dictionary has the keys
"index", "value", "label" and "selected".
-
- | =Arguments= | =Description= |
- | ``selector`` | Selector from which the info is to be retrieved. See the `Finding elements` section for details about the selectors. |
- | ``assertion_operator`` | See `Assertions` for further details. Defaults to None. |
- | ``assertion_expected`` | Expected value for the state |
- | ``message`` | overrides the default error message for assertion. |
+ *Arguments:*
+ - ``selector``: Selector from which the info is to be retrieved. See the
+ `Finding elements` section for details about the selectors.
+ - ``assertion_operator``: See `Assertions` for further details. Defaults to
+ None.
+ - ``assertion_expected``: Expected value for the state
+ - ``message``: overrides the default error message for assertion.
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -618,12 +643,15 @@ def get_selected_options(
) -> list[str | int]:
"""Returns the specified attribute of selected options of the ``select`` element.
- | =Arguments= | =Description= |
- | ``selector`` | Selector from which the info is to be retrieved. See the `Finding elements` section for details about the selectors. |
- | ``option_attribute`` | Which attribute shall be returned/verified. Defaults to label. |
- | ``assertion_operator`` | See `Assertions` for further details. Defaults to None. |
- | ``*assertion_expected`` | Expected value for the state |
- | ``message`` | overrides the default error message for assertion. |
+ *Arguments:*
+ - ``selector``: Selector from which the info is to be retrieved. See the
+ `Finding elements` section for details about the selectors.
+ - ``option_attribute``: Which attribute shall be returned/verified. Defaults
+ to label.
+ - ``assertion_operator``: See `Assertions` for further details. Defaults to
+ None.
+ - ``*assertion_expected``: Expected value for the state
+ - ``message``: overrides the default error message for assertion.
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -684,14 +712,19 @@ def get_checkbox_state(
`Assertions` for further details for the assertion arguments. By default assertion
is not done.
- | =Arguments= | =Description= |
- | ``selector`` | Selector which shall be examined. See the `Finding elements` section for details about the selectors. |
- | ``assertion_operator`` | ``==`` and ``!=`` and equivalent are allowed on boolean values. Other operators are not accepted. |
- | ``assertion_expected`` | Boolean value of expected state. Strings are interpreted as booleans. All strings are ``${True}`` except the following: ``FALSE, NO, OFF, 0, UNCHECKED, NONE, ${EMPTY}`` (case-insensitive). Defaults to ``Unchecked``. |
- | ``message`` | overrides the default error message for assertion. |
+ *Arguments:*
+ - ``selector``: Selector which shall be examined. See the `Finding elements`
+ section for details about the selectors.
+ - ``assertion_operator``: ``==`` and ``!=`` and equivalent are allowed on
+ boolean values. Other operators are not accepted.
+ - ``assertion_expected``: Boolean value of expected state. Strings are
+ interpreted as booleans. All strings are ``${True}`` except the
+ following: ``FALSE``, ``NO``, ``OFF``, ``0``, ``UNCHECKED``, ``NONE``, ``${EMPTY}``
+ (case-insensitive). Defaults to ``UNCHECKED``.
+ - ``message``: overrides the default error message for assertion.
- - ``checked`` => ``True``
- - ``unchecked`` => ``False``
+ - ``CHECKED`` => ``True``
+ - ``UNCHECKED`` => ``False``
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -729,11 +762,13 @@ def get_element_count(
) -> int:
"""Returns the count of elements found with ``selector``.
- | =Arguments= | =Description= |
- | ``selector`` | Selector which shall be counted. See the `Finding elements` section for details about the selectors. |
- | ``assertion_operator`` | See `Assertions` for further details. Defaults to None. |
- | ``assertion_expected`` | Expected value for the assertion |
- | ``message`` | overrides the default error message for assertion. |
+ *Arguments:*
+ - ``selector``: Selector which shall be counted. See the `Finding elements`
+ section for details about the selectors.
+ - ``assertion_operator``: See `Assertions` for further details. Defaults to
+ None.
+ - ``assertion_expected``: Expected value for the assertion
+ - ``message``: overrides the default error message for assertion.
Optionally asserts that the count matches the specified assertion. See
`Assertions` for further details for the assertion arguments. By default assertion
@@ -769,11 +804,16 @@ def get_viewport_size(
) -> ViewportDimensions | None:
"""Returns the current viewport dimensions.
- | =Arguments= | =Description= |
- | ``key`` | Optionally filters the returned values. If keys is set to ``ALL`` (default) it will return the viewport size as dictionary, otherwise it will just return the single value selected by the key. Note: If a single value is retrieved, an assertion does *not* need a ``validate`` combined with a cast of ``value``. |
- | ``assertion_operator`` | See `Assertions` for further details. Defaults to None. |
- | ``assertion_expected`` | Expected value for the assertion |
- | ``message`` | overrides the default error message for assertion. |
+ *Arguments:*
+ - ``key``: Optionally filters the returned values. If keys is set to ``ALL``
+ (default) it will return the viewport size as dictionary, otherwise it
+ will just return the single value selected by the key. Note: If a single
+ value is retrieved, an assertion does *not* need a ``validate`` combined
+ with a cast of ``value``.
+ - ``assertion_operator``: See `Assertions` for further details. Defaults to
+ None.
+ - ``assertion_expected``: Expected value for the assertion
+ - ``message``: overrides the default error message for assertion.
Optionally asserts that the state matches the specified assertion. See
`Assertions` for further details for the assertion arguments. By default assertion
@@ -819,10 +859,13 @@ def get_table_cell_element(self, table: str, column: str, row: str) -> str:
The returned value is used like the one from `Get Element`.
- | =Arguments= | =Description= |
- | ``table`` | selector must select the ``
`` element that contains both selected elements |
- | ``column`` | selector can select any ``
`` or ``
`` element or one of their descendants. |
- | ``row`` | selector can select any ``
`` element or one of their descendants like ``
`` elements. |
+ *Arguments:*
+ - ``table``: selector must select the ``
`` element that contains both
+ selected elements
+ - ``column``: selector can select any ``
`` or ``
`` element or one of
+ their descendants.
+ - ``row``: selector can select any ``
`` element or one of their
+ descendants like ``
`` elements.
``column`` and ``row`` can also consume index numbers instead of selectors.
Indexes are starting from ``0`` and ``-1`` is specific for the last element.
@@ -881,11 +924,14 @@ def get_table_cell_index(
) -> int:
"""Returns the index (0 based) of a table cell within its row.
- | =Arguments= | =Description= |
- | ``selector`` | can select any ``
`` or ``
`` element or one of their descendants. See the `Finding elements` section for details about the selectors. |
- | ``assertion_operator`` | See `Assertions` for further details. Defaults to None. |
- | ``assertion_expected`` | Expected value for the assertion |
- | ``message`` | overrides the default error message for assertion. |
+ *Arguments:*
+ - ``selector``: can select any ``
`` or ``
`` element or one of their
+ descendants. See the `Finding elements` section for details about the
+ selectors.
+ - ``assertion_operator``: See `Assertions` for further details. Defaults to
+ None.
+ - ``assertion_expected``: Expected value for the assertion
+ - ``message``: overrides the default error message for assertion.
Example:
| ${table}= Set Variable id=`Get Table Cell Element` >> div.kw-docs table #Table of keyword `Get Table Cell Element`
@@ -924,12 +970,14 @@ def get_table_row_index(
) -> int:
"""Returns the index (0 based) of a table row.
-
- | =Arguments= | =Description= |
- | ``selector`` | can select any ``
``, ``
`` or ``
`` element or one of their descendants. See the `Finding elements` section for details about the selectors. |
- | ``assertion_operator`` | See `Assertions` for further details. Defaults to None. |
- | ``assertion_expected`` | Expected value for the assertion |
- | ``message`` | overrides the default error message for assertion. |
+ *Arguments:*
+ - ``selector``: can select any ``
``, ``
`` or ``
`` element or one
+ of their descendants. See the `Finding elements` section for details
+ about the selectors.
+ - ``assertion_operator``: See `Assertions` for further details. Defaults to
+ None.
+ - ``assertion_expected``: Expected value for the assertion
+ - ``message``: overrides the default error message for assertion.
Example:
| ${table}= Set Variable id=`Get Table Cell Element` >> div.kw-docs table #Table of keyword `Get Table Cell Element`
@@ -966,9 +1014,9 @@ def get_element(self, selector: str) -> str:
selector, chained with ``>>``. Because it is a selector and not a captured
DOM node, it is resolved again from the page on every use.
-
- | =Arguments= | =Description= |
- | ``selector`` | Selector from which the element shall be retrieved. See the `Finding elements` section for details about the selectors. |
+ *Arguments:*
+ - ``selector``: Selector from which the element shall be retrieved. See the
+ `Finding elements` section for details about the selectors.
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -994,9 +1042,9 @@ def get_elements(self, selector: str) -> list[str]:
Each string can be used as the *first* clause of another selector, chained
with ``>>``, exactly like the value returned by `Get Element`.
-
- | =Arguments= | =Description= |
- | ``selector`` | Selector from which the elements shall be retrieved. See the `Finding elements` section for details about the selectors. |
+ *Arguments:*
+ - ``selector``: Selector from which the elements shall be retrieved. See the
+ `Finding elements` section for details about the selectors.
Keyword does not use strict mode and returns an empty list if the ``selector``
does not match any element.
@@ -1067,18 +1115,26 @@ def get_element_by_role(
| ${checkbox} Get Element By Role checkbox name=Subscribe
| ${button} Get Element By Role button name=/submit/i
- | =Arguments= | =Description= |
- | ``all_elements`` | If True, returns all matched elements as a list. |
- | ``role`` | Role from which shall be retrieved. |
- | ``checked`` | An attribute that is usually set by aria-checked or native controls. |
- | ``disabled`` | An attribute that is usually set by aria-disabled or disabled. |
- | ``exact`` | Whether name is matched exactly: case-sensitive and whole-string. Defaults to false. Ignored when name is a regular expression. Note that exact match still trims whitespace. |
- | ``expanded`` | An attribute that is usually set by aria-expanded. |
- | ``include_hidden`` | Option that controls whether hidden elements are matched. By default, only non-hidden elements, as defined by ARIA, are matched by role selector. |
- | ``level`` | A number attribute that is usually present for roles heading, list item, row, treeitem, with default values for
-
elements. |
- | ``name`` | Option to match the accessible name. By default, matching is case-insensitive and searches for a substring, use exact to control this behavior. |
- | ``pressed`` | An attribute that is usually set by aria-pressed. |
- | ``selected`` | An attribute that is usually set by aria-selected. |
+ *Arguments:*
+ - ``all_elements``: If True, returns all matched elements as a list.
+ - ``role``: Role from which shall be retrieved.
+ - ``checked``: An attribute that is usually set by aria-checked or native
+ controls.
+ - ``disabled``: An attribute that is usually set by aria-disabled or disabled.
+ - ``exact``: Whether name is matched exactly: case-sensitive and whole-string.
+ Defaults to false. Ignored when name is a regular expression. Note that
+ exact match still trims whitespace.
+ - ``expanded``: An attribute that is usually set by aria-expanded.
+ - ``include_hidden``: Option that controls whether hidden elements are
+ matched. By default, only non-hidden elements, as defined by ARIA, are
+ matched by role selector.
+ - ``level``: A number attribute that is usually present for roles heading,
+ list item, row, treeitem, with default values for
-
elements.
+ - ``name``: Option to match the accessible name. By default, matching is
+ case-insensitive and searches for a substring, use exact to control this
+ behavior.
+ - ``pressed``: An attribute that is usually set by aria-pressed.
+ - ``selected``: An attribute that is usually set by aria-selected.
If an element shall be fetched from an iframe, a selector prefix must be set using `Set Selector Prefix` keyword including ``>>>`` as ending.
@@ -1137,11 +1193,15 @@ def get_element_by(
Selection strategies can be several Playwright strategies like AltText or Label.
See [https://playwright.dev/docs/locators|Playwright Locators] for more information.
- | =Arguments= | =Description= |
- | ``selection_strategy`` | SelectionStrategy to be used. Refers to Playwrights ``page.getBy***`` functions. See https://playwright.dev/docs/locators |
- | ``text`` | Text to locate the element for. |
- | ``exact`` | Whether to find an exact match: case-sensitive and whole-string. Defaults to false. Ignored when locating by a regular expression. Note that exact match still trims whitespace. This has no effect if RegExp is used or if TestID is used as strategy. |
- | ``all_elements`` | If True, returns all matched elements as a list. |
+ *Arguments:*
+ - ``selection_strategy``: SelectionStrategy to be used. Refers to Playwrights
+ ``page.getBy***`` functions. See https://playwright.dev/docs/locators
+ - ``text``: Text to locate the element for.
+ - ``exact``: Whether to find an exact match: case-sensitive and whole-string.
+ Defaults to false. Ignored when locating by a regular expression. Note
+ that exact match still trims whitespace. This has no effect if RegExp is
+ used or if TestID is used as strategy.
+ - ``all_elements``: If True, returns all matched elements as a list.
This keywords implements the following Playwright functions:
- [https://playwright.dev/docs/api/class-page#page-get-by-alt-text|page.getByAltText]
@@ -1198,14 +1258,17 @@ def get_style( # ruff: ignore[PLR0917]
) -> dict[str, str] | str | tuple | dict:
"""Gets the computed style properties of the element selected by ``selector``.
-
- | =Arguments= | =Description= |
- | ``selector`` | Selector from which the style shall be retrieved. See the `Finding elements` section for details about the selectors. |
- | ``key`` | Key of the requested CSS property. Retrieves "ALL" styles as dictionary by default. All css settings can be used as keys even if they are not all returned in the dictionary. |
- | ``assertion_operator`` | See `Assertions` for further details. Defaults to None. |
- | ``assertion_expected`` | Expected value for the assertion |
- | ``message`` | overrides the default error message for assertion. |
- | ``pseudo_element`` | Pseudo element to match. Defaults to None. |
+ *Arguments:*
+ - ``selector``: Selector from which the style shall be retrieved. See the
+ `Finding elements` section for details about the selectors.
+ - ``key``: Key of the requested CSS property. Retrieves "ALL" styles as
+ dictionary by default. All css settings can be used as keys even if they
+ are not all returned in the dictionary.
+ - ``assertion_operator``: See `Assertions` for further details. Defaults to
+ None.
+ - ``assertion_expected``: Expected value for the assertion
+ - ``message``: overrides the default error message for assertion.
+ - ``pseudo_element``: Pseudo element to match. Defaults to None.
A [https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements|pseudo element] is a CSS functionality to add styles, for example ``::before`` or ``::after``.
@@ -1279,13 +1342,21 @@ def get_boundingbox(
To allow also hidden elements without a bounding box, set ``allow_hidden`` to ``True``,
which results in a return value of ``None`` in case of no bounding box.
- | =Arguments= | =Description= |
- | ``selector`` | Selector from which the bounding box shall be retrieved. See the `Finding elements` section for details about the selectors. |
- | ``key`` | Optionally filters the returned values. If keys is set to ``ALL`` (default) it will return the BoundingBox as Dictionary, otherwise it will just return the single value selected by the key. Note: If a single value is retrieved, an assertion does *not* need a ``validate`` combined with a cast of ``value``. |
- | ``assertion_operator`` | See `Assertions` for further details. Defaults to None. |
- | ``assertion_expected`` | Expected value for the assertion |
- | ``message`` | overrides the default error message for assertion. |
- | ``allow_hidden`` | (named only) If True, hidden elements are not causing a failure and will return ``None``. Otherwise a hidden element will fail. Defaults to False. |
+ *Arguments:*
+ - ``selector``: Selector from which the bounding box shall be retrieved. See
+ the `Finding elements` section for details about the selectors.
+ - ``key``: Optionally filters the returned values. If keys is set to ``ALL``
+ (default) it will return the BoundingBox as Dictionary, otherwise it
+ will just return the single value selected by the key. Note: If a single
+ value is retrieved, an assertion does *not* need a ``validate`` combined
+ with a cast of ``value``.
+ - ``assertion_operator``: See `Assertions` for further details. Defaults to
+ None.
+ - ``assertion_expected``: Expected value for the assertion
+ - ``message``: overrides the default error message for assertion.
+ - ``allow_hidden``: (named only) If True, hidden elements are not causing a
+ failure and will return ``None``. Otherwise a hidden element will fail.
+ Defaults to False.
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -1353,13 +1424,18 @@ def get_scroll_size(
) -> Dimensions | float | int:
"""Gets elements or pages scrollable size as object ``{width: float, height: float}``.
-
- | =Arguments= | =Description= |
- | ``selector`` | Optional selector from which the scroll size shall be retrieved. If no selector is given the scroll size of the page itself is used. See the `Finding elements` section for details about the selectors. |
- | ``key`` | Optionally filters the returned values. If keys is set to ``ALL`` (default) it will return the scroll size as dictionary, otherwise it will just return the single value selected by the key. |
- | ``assertion_operator`` | See `Assertions` for further details. Defaults to None. |
- | ``assertion_expected`` | Expected value for the assertion |
- | ``message`` | overrides the default error message for assertion. |
+ *Arguments:*
+ - ``selector``: Optional selector from which the scroll size shall be
+ retrieved. If no selector is given the scroll size of the page itself is
+ used. See the `Finding elements` section for details about the
+ selectors.
+ - ``key``: Optionally filters the returned values. If keys is set to ``ALL``
+ (default) it will return the scroll size as dictionary, otherwise it
+ will just return the single value selected by the key.
+ - ``assertion_operator``: See `Assertions` for further details. Defaults to
+ None.
+ - ``assertion_expected``: Expected value for the assertion
+ - ``message``: overrides the default error message for assertion.
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -1412,13 +1488,18 @@ def get_scroll_position(
It describes the rectangle which is visible of the scrollable content of that element.
All values are measured from position {top: 0, left: 0}.
-
- | =Arguments= | =Description= |
- | ``selector`` | Optional selector from which the scroll position shall be retrieved. If no selector is given the scroll position of the page itself is used (``document.scrollingElement``). See the `Finding elements` section for details about the selectors. |
- | ``key`` | Optionally filters the returned values. If keys is set to ``ALL`` (default) it will return the scroll position as dictionary, otherwise it will just return the single value selected by the key. |
- | ``assertion_operator`` | See `Assertions` for further details. Defaults to None. |
- | ``assertion_expected`` | Expected value for the assertion |
- | ``message`` | overrides the default error message for assertion. |
+ *Arguments:*
+ - ``selector``: Optional selector from which the scroll position shall be
+ retrieved. If no selector is given the scroll position of the page
+ itself is used (``document.scrollingElement``). See the `Finding
+ elements` section for details about the selectors.
+ - ``key``: Optionally filters the returned values. If keys is set to ``ALL``
+ (default) it will return the scroll position as dictionary, otherwise it
+ will just return the single value selected by the key.
+ - ``assertion_operator``: See `Assertions` for further details. Defaults to
+ None.
+ - ``assertion_expected``: Expected value for the assertion
+ - ``message``: overrides the default error message for assertion.
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -1465,13 +1546,18 @@ def get_client_size(
) -> Dimensions | float:
"""Gets elements or pages client size (``clientHeight``, ``clientWidth``) as object {width: float, height: float}.
-
- | =Arguments= | =Description= |
- | ``selector`` | Optional selector from which the client size shall be retrieved. If no selector is given the client size of the page itself is used (``document.scrollingElement``). See the `Finding elements` section for details about the selectors. |
- | ``key`` | Optionally filters the returned values. If keys is set to ``ALL`` (default) it will return the client size as dictionary, otherwise it will just return the single value selected by the key. |
- | ``assertion_operator`` | See `Assertions` for further details. Defaults to None. |
- | ``assertion_expected`` | Expected value for the assertion |
- | ``message`` | overrides the default error message for assertion. |
+ *Arguments:*
+ - ``selector``: Optional selector from which the client size shall be
+ retrieved. If no selector is given the client size of the page itself is
+ used (``document.scrollingElement``). See the `Finding elements` section
+ for details about the selectors.
+ - ``key``: Optionally filters the returned values. If keys is set to ``ALL``
+ (default) it will return the client size as dictionary, otherwise it
+ will just return the single value selected by the key.
+ - ``assertion_operator``: See `Assertions` for further details. Defaults to
+ None.
+ - ``assertion_expected``: Expected value for the assertion
+ - ``message``: overrides the default error message for assertion.
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -1517,13 +1603,16 @@ def get_element_states(
This Keyword returns a list of states that are valid for the selected element.
-
- | =Arguments= | =Description= |
- | ``selector`` | Selector of the corresponding object. See the `Finding elements` section for details about the selectors. |
- | ``assertion_operator`` | See `Assertions` for further details. Defaults to None. |
- | ``*assertion_expected`` | Expected states |
- | ``message`` | overrides the default error message for assertion. |
- | ``return_names`` | If set to ``False`` the keyword does return an IntFlag object (`ElementState`) instead of a list. `ElementState` may contain multiple states at the same time. Defaults to ``True``. |
+ *Arguments:*
+ - ``selector``: Selector of the corresponding object. See the `Finding
+ elements` section for details about the selectors.
+ - ``assertion_operator``: See `Assertions` for further details. Defaults to
+ None.
+ - ``*assertion_expected``: Expected states
+ - ``message``: overrides the default error message for assertion.
+ - ``return_names``: If set to ``False`` the keyword does return an IntFlag
+ object (`ElementState`) instead of a list. `ElementState` may contain
+ multiple states at the same time. Defaults to ``True``.
Optionally asserts that the state matches the specified assertion. See
`Assertions` for further details for the assertion arguments. By default, assertion
@@ -1605,11 +1694,14 @@ def get_download_state(
| downloadID: Optional[str]
| }
- | =Arguments= | =Description= |
- | ``download`` | `DownloadInfo` dictionary returned from `Promise To Wait For Download` or download id as string. |
- | ``assertion_operator`` | See `Assertions` for further details. Defaults to None. |
- | ``assertion_expected`` | Expected state of the download. Be aware that the returned value is a dictionary |
- | ``message`` | overrides the default error message for assertion. |
+ *Arguments:*
+ - ``download``: `DownloadInfo` dictionary returned from `Promise To Wait For
+ Download` or download id as string.
+ - ``assertion_operator``: See `Assertions` for further details. Defaults to
+ None.
+ - ``assertion_expected``: Expected state of the download. Be aware that the
+ returned value is a dictionary
+ - ``message``: overrides the default error message for assertion.
[https://forum.robotframework.org/t//6479|Comment >>]
"""
diff --git a/Browser/keywords/interaction.py b/Browser/keywords/interaction.py
index 0afc7a70c..64bb3894a 100644
--- a/Browser/keywords/interaction.py
+++ b/Browser/keywords/interaction.py
@@ -60,11 +60,16 @@ def type_text(
Sends a ``keydown``, ``keypress/input``, and ``keyup`` event for each
character in the text.
- | =Arguments= | =Description= |
- | ``selector`` | Selector of the text field. See the `Finding elements` section for details about the selectors. |
- | ``txt`` | Text for the text field. |
- | ``delay`` | Delay between the single key strokes. It may be either a number or a Robot Framework time string. Time strings are fully explained in an appendix of Robot Framework User Guide. Defaults to ``0 ms``. Example: ``50 ms`` |
- | ``clear`` | Set to ``False`` if the field should not be cleared before typing. Defaults to ``True``. |
+ *Arguments:*
+ - ``selector``: Selector of the text field. See the `Finding elements` section
+ for details about the selectors.
+ - ``txt``: Text for the text field.
+ - ``delay``: Delay between the single key strokes. It may be either a number
+ or a Robot Framework time string. Time strings are fully explained in an
+ appendix of Robot Framework User Guide. Defaults to ``0 ms``. Example:
+ ``50 ms``
+ - ``clear``: Set to ``False`` if the field should not be cleared before
+ typing. Defaults to ``True``.
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -97,11 +102,12 @@ def fill_text(self, selector: str, txt: str, force: bool = False):
[contenteditable] element, this keyword fails. Note that
you can pass an empty string as ``txt`` to clear the input field.
-
- | =Arguments= | =Description= |
- | ``selector`` | Selector of the text field. See the `Finding elements` section for details about the selectors. |
- | ``txt`` | Text for the text field. |
- | ``force`` | Set to ``True`` to skip Playwright's [https://playwright.dev/docs/actionability|Actionability checks]. |
+ *Arguments:*
+ - ``selector``: Selector of the text field. See the `Finding elements` section
+ for details about the selectors.
+ - ``txt``: Text for the text field.
+ - ``force``: Set to ``True`` to skip Playwright's
+ [https://playwright.dev/docs/actionability | Actionability checks].
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -119,8 +125,9 @@ def fill_text(self, selector: str, txt: str, force: bool = False):
def clear_text(self, selector: str):
"""Clears the text field found by ``selector``.
- | =Arguments= | =Description= |
- | ``selector`` | Selector of the text field. See the `Finding elements` section for details about the selectors. |
+ *Arguments:*
+ - ``selector``: Selector of the text field. See the `Finding elements` section
+ for details about the selectors.
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -143,11 +150,19 @@ def type_secret(
):
"""Types the given ``secret`` into the text field found by ``selector``.
- | =Arguments= | =Description= |
- | ``selector`` | Selector of the text field. See the `Finding elements` section for details about the selectors. |
- | ``secret`` | Supports Robot Framework 7.4 Secret type as normal variable (with curly braces). Also environment variable name with % prefix or a local variable with $ prefix that has the secret text value (without curly braces). |
- | ``delay`` | Delay between the single key strokes. It may be either a number or a Robot Framework time string. Time strings are fully explained in an appendix of Robot Framework User Guide. Defaults to ``0 ms``. Example: ``50 ms`` |
- | ``clear`` | Set to ``False`` if the field should not be cleared before typing. Defaults to ``True``. |
+ *Arguments:*
+ - ``selector``: Selector of the text field. See the `Finding elements` section
+ for details about the selectors.
+ - ``secret``: Supports Robot Framework 7.4 Secret type as normal variable
+ (with curly braces). Also environment variable name with % prefix or a
+ local variable with $ prefix that has the secret text value (without
+ curly braces).
+ - ``delay``: Delay between the single key strokes. It may be either a number
+ or a Robot Framework time string. Time strings are fully explained in an
+ appendix of Robot Framework User Guide. Defaults to ``0 ms``. Example:
+ ``50 ms``
+ - ``clear``: Set to ``False`` if the field should not be cleared before
+ typing. Defaults to ``True``.
This keyword does not log the secret in Robot Framework logs, but
if Playwright debug logs are enabled, the secret will be visible as
@@ -209,11 +224,16 @@ def type_secret(
def fill_secret(self, selector: str, secret: str | Secret, force: bool = False):
"""Fills the given ``secret`` into the text field found by ``selector``.
-
- | =Arguments= | =Description= |
- | ``selector`` | Selector of the text field. See the `Finding elements` section for details about the selectors. |
- | ``secret`` | The secret string that should be filled into the text field. Supports Robot Framework 7.4 Secret type as normal variable (with curly braces). Also environment variable name with % prefix or a local variable with $ prefix that has the secret text value (without curly braces). |
- | ``force`` | Set to ``True`` to skip Playwright's [https://playwright.dev/docs/actionability|Actionability checks]. |
+ *Arguments:*
+ - ``selector``: Selector of the text field. See the `Finding elements` section
+ for details about the selectors.
+ - ``secret``: The secret string that should be filled into the text field.
+ Supports Robot Framework 7.4 Secret type as normal variable (with curly
+ braces). Also environment variable name with % prefix or a local
+ variable with $ prefix that has the secret text value (without curly
+ braces).
+ - ``force``: Set to ``True`` to skip Playwright's
+ [https://playwright.dev/docs/actionability | Actionability checks].
This keyword does not log the secret in Robot Framework logs, but
@@ -280,12 +300,17 @@ def press_keys(
):
"""Types the given key combination into element found by ``selector``.
-
- | =Arguments= | =Description= |
- | ``selector`` | Selector of the text field. See the `Finding elements` section for details about the selectors. |
- | ``*keys`` | Keys to be pressed one after the other. Combining modifiers with a single key press by chaining them with ``+``, like ``Control+Shift+T``, is supported. |
- | ``press_duration`` | Delay between keydown and keyup of each key. Can be given as seconds (float) or as Robot Framework time string. Defaults to ``0 ms``. Example: ``50 ms`` |
- | ``key_delay`` | Delay between key presses. Can be given as seconds (float) or as Robot Framework time string. Defaults to ``0 ms``. Example: ``50 ms`` |
+ *Arguments:*
+ - ``selector``: Selector of the text field. See the `Finding elements` section
+ for details about the selectors.
+ - ``*keys``: Keys to be pressed one after the other. Combining modifiers with
+ a single key press by chaining them with ``+``, like
+ ``Control+Shift+T``, is supported.
+ - ``press_duration``: Delay between keydown and keyup of each key. Can be
+ given as seconds (float) or as Robot Framework time string. Defaults to
+ ``0 ms``. Example: ``50 ms``
+ - ``key_delay``: Delay between key presses. Can be given as seconds (float) or
+ as Robot Framework time string. Defaults to ``0 ms``. Example: ``50 ms``
Supports values like ``a`` or ``b`` which will be automatically typed.
@@ -329,10 +354,11 @@ def click(self, selector: str, button: MouseButton = MouseButton.left):
- Use `Mouse Button` to click in the center of the element.
- Wait for initiated navigation to either succeed or fail.
-
- | =Arguments= | =Description= |
- | ``selector`` | Selector element to click. See the `Finding elements` section for details about the selectors. |
- | ``button`` | Mouse button to click with. One of ``left``, ``middle`` or ``right``. Defaults to ``left``. |
+ *Arguments:*
+ - ``selector``: Selector element to click. See the `Finding elements` section
+ for details about the selectors.
+ - ``button``: Mouse button to click with. One of ``left``, ``middle`` or
+ ``right``. Defaults to ``left``.
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -372,17 +398,40 @@ def click_with_options(
- Use `Mouse Button` to click in the center of the element, or the specified position.
- Wait for initiated navigation to either succeed or fail, unless the ``noWaitAfter`` option is set.
-
- | =Arguments= | =Description= |
- | ``selector`` | Selector element to click. See the `Finding elements` section for details about the selectors. |
- | ``button`` | Mouse button to click with. One of ``left``, ``middle`` or ``right``. Defaults to ``left``. |
- | ``*modifiers`` | Modifier keys to press. Ensures that only these modifiers are pressed during the click, and then restores current modifiers back. If not specified, currently pressed modifiers are used. Modifiers can be specified in any order, and multiple modifiers can be specified. Valid modifier keys are ``Alt``, ``Control``, ``ControlOrMeta``, ``Meta`` and ``Shift``. Due to the fact that the argument ``*modifiers`` is a positional only argument, all preceding keyword arguments have to be specified as positional arguments before ``*modifiers``. |
- | ``clickCount`` | How many times the button is clicked. Defaults to 1. |
- | ``delay`` | Time to wait between mouse-down and mouse-up. Defaults to no delay. |
- | ``position_x`` ``position_y`` | A point to click relative to the top-left corner of element bounding-box. Only positive values within the bounding-box are allowed. Both values must be given, otherwise the position is ignored. If not specified, clicks to some visible point of the element. |
- | ``force`` | Set to ``True`` to skip Playwright's Actionability checks (https://playwright.dev/docs/actionability). Defaults to ``False``. |
- | ``noWaitAfter`` | Deprecated. This option will default to true in the future. Actions that initiate navigation, are waiting for these navigation to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to ``False``. |
- | ``trial`` | When set, this method only performs the actionability checks and skips the action. Defaults to ``False``. Useful to wait until the element is ready for the action without performing it. |
+ *Arguments:*
+ - ``selector``: Selector element to click. See the `Finding elements` section
+ for details about the selectors.
+ - ``button``: Mouse button to click with. One of ``left``, ``middle`` or
+ ``right``. Defaults to ``left``.
+ - ``*modifiers``: Modifier keys to press. Ensures that only these modifiers
+ are pressed during the click, and then restores current modifiers back.
+ If not specified, currently pressed modifiers are used. Modifiers can be
+ specified in any order, and multiple modifiers can be specified. Valid
+ modifier keys are ``Alt``, ``Control``, ``ControlOrMeta``, ``Meta`` and
+ ``Shift``. Due to the fact that the argument ``*modifiers`` is a
+ positional only argument, all preceding keyword arguments have to be
+ specified as positional arguments before ``*modifiers``.
+ - ``clickCount``: How many times the button is clicked. Defaults to 1.
+ - ``delay``: Time to wait between mouse-down and mouse-up. Defaults to no
+ delay.
+ - ``position_x``: A point to click relative to the top-left corner of element
+ bounding-box. Only positive values within the bounding-box are allowed.
+ Both values must be given, otherwise the position is ignored. If not
+ specified, clicks to some visible point of the element.
+ - ``position_y``: A point to click relative to the top-left corner of element
+ bounding-box. Only positive values within the bounding-box are allowed.
+ Both values must be given, otherwise the position is ignored. If not
+ specified, clicks to some visible point of the element.
+ - ``force``: Set to ``True`` to skip Playwright's Actionability checks
+ (https://playwright.dev/docs/actionability). Defaults to ``False``.
+ - ``noWaitAfter``: Deprecated. This option will default to true in the future.
+ Actions that initiate navigation, are waiting for these navigation to
+ happen and for pages to start loading. You can opt out of waiting via
+ setting this flag. You would only need this option in the exceptional
+ cases such as navigating to inaccessible pages. Defaults to ``False``.
+ - ``trial``: When set, this method only performs the actionability checks and
+ skips the action. Defaults to ``False``. Useful to wait until the
+ element is ready for the action without performing it.
Arguments ``clickCount``, ``delay``, ``position_x``, ``position_y``, ``force``, ``noWaitAfter`` and ``trial`` are named-only arguments and must be specified using their names.
@@ -444,13 +493,29 @@ def tap(
- Use page.touchscreen to tap the center of the element, or the specified position.
- Wait for initiated navigations to either succeed or fail.
- | =Arguments= | =Description= |
- | ``selector`` | Selector element to tap. See the `Finding elements` section for details about the selectors. |
- | ``*modifiers`` | Modifier keys to press. Ensures that only these modifiers are pressed during the tap, and then restores current modifiers back. If not specified, currently pressed modifiers are used. Modifiers can be specified in any order, and multiple modifiers can be specified. Valid modifier keys are ``Alt``, ``Control``, ``ControlOrMeta``, ``Meta`` and ``Shift``. |
- | ``force`` | Whether to bypass the actionability checks. Defaults to ``False``. |
- | ``noWaitAfter`` | Deprecated. This option has no effect. Defaults to ``False``. |
- | ``position_x`` ``position_y`` | A point to tap relative to the top-left corner of element bounding-box. Only positive values within the bounding-box are allowed. Both values must be given, otherwise the position is ignored. If not specified, taps some visible point of the element. |
- | ``trial`` | When set, this method only performs the actionability checks and skips the action. Defaults to ``False``. |
+ *Arguments:*
+ - ``selector``: Selector element to tap. See the `Finding elements` section
+ for details about the selectors.
+ - ``*modifiers``: Modifier keys to press. Ensures that only these modifiers
+ are pressed during the tap, and then restores current modifiers back. If
+ not specified, currently pressed modifiers are used. Modifiers can be
+ specified in any order, and multiple modifiers can be specified. Valid
+ modifier keys are ``Alt``, ``Control``, ``ControlOrMeta``, ``Meta`` and
+ ``Shift``.
+ - ``force``: Whether to bypass the actionability checks. Defaults to
+ ``False``.
+ - ``noWaitAfter``: Deprecated. This option has no effect. Defaults to
+ ``False``.
+ - ``position_x``: A point to tap relative to the top-left corner of element
+ bounding-box. Only positive values within the bounding-box are allowed.
+ Both values must be given, otherwise the position is ignored. If not
+ specified, taps some visible point of the element.
+ - ``position_y``: A point to tap relative to the top-left corner of element
+ bounding-box. Only positive values within the bounding-box are allowed.
+ Both values must be given, otherwise the position is ignored. If not
+ specified, taps some visible point of the element.
+ - ``trial``: When set, this method only performs the actionability checks and
+ skips the action. Defaults to ``False``.
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -489,9 +554,8 @@ def record_selector(
):
"""Record the selector that is under mouse.
-
- | =Arguments= | =Description= |
- | ``label`` | Text to show in the box on the page while recording. |
+ *Arguments:*
+ - ``label``: Text to show in the box on the page while recording.
Focus on the page and move the mouse over the element you want to select.
@@ -531,12 +595,25 @@ def hover(
- Scroll the element into view if needed.
- Use `Mouse Move` to hover over the center of the element, or the specified ``position``.
-
- | =Arguments= | =Description= |
- | ``selector`` | Selector element to hover. See the `Finding elements` section for details about the selectors. |
- | ``position_x`` & ``position_y`` | A point to hover relative to the top-left corner of element bounding box. If not specified, hovers over some visible point of the element. Only positive values within the bounding-box are allowed. Both values must be given, otherwise the position is ignored. |
- | ``force`` | Set to ``True`` to skip Playwright's [https://playwright.dev/docs/actionability|Actionability checks]. Defaults to ``False``. |
- | ``*modifiers`` | Modifier keys to press. Ensures that only these modifiers are pressed during the hover, and then restores current modifiers back. If not specified, currently pressed modifiers are used. Valid modifier keys are ``Alt``, ``Control``, ``ControlOrMeta``, ``Meta`` and ``Shift``. |
+ *Arguments:*
+ - ``selector``: Selector element to hover. See the `Finding elements` section
+ for details about the selectors.
+ - ``position_x``: A point to hover relative to the top-left corner of element
+ bounding box. If not specified, hovers over some visible point of the
+ element. Only positive values within the bounding-box are allowed. Both
+ values must be given, otherwise the position is ignored.
+ - ``position_y``: A point to hover relative to the top-left corner of element
+ bounding box. If not specified, hovers over some visible point of the
+ element. Only positive values within the bounding-box are allowed. Both
+ values must be given, otherwise the position is ignored.
+ - ``force``: Set to ``True`` to skip Playwright's
+ [https://playwright.dev/docs/actionability | Actionability checks].
+ Defaults to ``False``.
+ - ``*modifiers``: Modifier keys to press. Ensures that only these modifiers
+ are pressed during the hover, and then restores current modifiers back.
+ If not specified, currently pressed modifiers are used. Valid modifier
+ keys are ``Alt``, ``Control``, ``ControlOrMeta``, ``Meta`` and
+ ``Shift``.
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -567,8 +644,9 @@ def hover(
def focus(self, selector: str):
"""Moves focus on to the element found by ``selector``.
- | =Arguments= | =Description= |
- | ``selector`` | Selector of the element. See the `Finding elements` section for details about the selectors. |
+ *Arguments:*
+ - ``selector``: Selector of the element. See the `Finding elements` section
+ for details about the selectors.
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -596,11 +674,23 @@ def scroll_to(
):
"""Scrolls an element or the page to an absolute position based on given coordinates.
- | =Arguments= | =Description= |
- | ``selector`` | Selector of the element. If the selector is ``${None}`` or ``${Empty}`` the page itself is scrolled. To ensure an element is in view use `Hover` instead. See the `Finding elements` section for details about the selectors. |
- | ``vertical`` | Defines where to scroll vertically. It can be a positive number, like ``300``. It can be a percentage value of the absolute scrollable size, like ``50%``. It can be a string defining the top or the bottom of the scroll area. < ``top`` | ``bottom`` > _Be aware that some pages do lazy loading and load more content once you scroll down._ Bottom defines the currently known bottom coordinate. Defaults to ``top``. |
- | ``horizontal`` | Defines where to scroll horizontally. Works the same way as ``vertical``, but defines < ``left`` | ``right`` > as start and end. Defaults to ``left``. |
- | ``behavior`` | Defines whether the scroll happens instantly or smoothly. Defaults to ``auto``. |
+ *Arguments:*
+ - ``selector``: Selector of the element. If the selector is ``${None}`` or
+ ``${Empty}`` the page itself is scrolled. To ensure an element is in
+ view use `Hover` instead. See the `Finding elements` section for details
+ about the selectors.
+ - ``vertical``: Defines where to scroll vertically. It can be a positive
+ number, like ``300``. It can be a percentage value of the absolute
+ scrollable size, like ``50%``. It can be a string defining the top or
+ the bottom of the scroll area. < ``top`` | ``bottom`` > _Be aware that
+ some pages do lazy loading and load more content once you scroll down._
+ Bottom defines the currently known bottom coordinate. Defaults to
+ ``top``.
+ - ``horizontal``: Defines where to scroll horizontally. Works the same way as
+ ``vertical``, but defines < ``left`` | ``right`` > as start and end.
+ Defaults to ``left``.
+ - ``behavior``: Defines whether the scroll happens instantly or smoothly.
+ Defaults to ``auto``.
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -637,11 +727,26 @@ def scroll_by(
):
"""Scrolls an element or the page relative from current position by the given values.
- | =Arguments= | =Description= |
- | ``selector`` | Selector of the element. If the selector is ``${None}`` or ``${Empty}`` the page itself is scrolled. To ensure an element is in view use `Hover` instead. See the `Finding elements` section for details about the selectors. |
- | ``vertical`` | Defines how far and in which direction to scroll vertically. It can be a positive or negative number. Positive scrolls down, like ``50``, negative scrolls up, like ``-50``. It can be a percentage value of the absolute scrollable size, like ``9.95%`` or negative like ``-10%``. It can be the string ``height`` to scroll exactly one visible height down, or ``-height`` to scroll one visible height up. _Be aware that some pages do lazy loading and load more content once you scroll down._ The percentage of the current scrollable height is used and may change. Defaults to ``height``. |
- | ``horizontal`` | Defines how far and in which direction to scroll horizontally. Works the same way as ``vertical``, but positive values scroll to the right and negative values to the left. ``width`` scrolls exactly one visible range to the right. Defaults to ``0``. |
- | ``behavior`` | Defines whether the scroll happens instantly or smoothly. Defaults to ``auto``. |
+ *Arguments:*
+ - ``selector``: Selector of the element. If the selector is ``${None}`` or
+ ``${Empty}`` the page itself is scrolled. To ensure an element is in
+ view use `Hover` instead. See the `Finding elements` section for details
+ about the selectors.
+ - ``vertical``: Defines how far and in which direction to scroll vertically.
+ It can be a positive or negative number. Positive scrolls down, like
+ ``50``, negative scrolls up, like ``-50``. It can be a percentage value
+ of the absolute scrollable size, like ``9.95%`` or negative like
+ ``-10%``. It can be the string ``height`` to scroll exactly one visible
+ height down, or ``-height`` to scroll one visible height up. _Be aware
+ that some pages do lazy loading and load more content once you scroll
+ down._ The percentage of the current scrollable height is used and may
+ change. Defaults to ``height``.
+ - ``horizontal``: Defines how far and in which direction to scroll
+ horizontally. Works the same way as ``vertical``, but positive values
+ scroll to the right and negative values to the left. ``width`` scrolls
+ exactly one visible range to the right. Defaults to ``0``.
+ - ``behavior``: Defines whether the scroll happens instantly or smoothly.
+ Defaults to ``auto``.
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -673,8 +778,9 @@ def scroll_to_element(self, selector: str):
"""This method waits for actionability checks, then tries to scroll element into view,
unless it is completely visible.
- | =Arguments= | =Description= |
- | ``selector`` | Selector of the element. See the `Finding elements` section for details about the selectors. |
+ *Arguments:*
+ - ``selector``: Selector of the element. See the `Finding elements` section
+ for details about the selectors.
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -693,9 +799,11 @@ def scroll_to_element(self, selector: str):
def check_checkbox(self, selector: str, force: bool = False):
"""Checks the checkbox or selects radio button found by ``selector``.
- | =Arguments= | =Description= |
- | ``selector`` | Selector of the checkbox. See the `Finding elements` section for details about the selectors. |
- | ``force`` | Set to ``True`` to skip Playwright's [https://playwright.dev/docs/actionability|Actionability checks]. |
+ *Arguments:*
+ - ``selector``: Selector of the checkbox. See the `Finding elements` section
+ for details about the selectors.
+ - ``force``: Set to ``True`` to skip Playwright's
+ [https://playwright.dev/docs/actionability | Actionability checks].
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -716,9 +824,11 @@ def check_checkbox(self, selector: str, force: bool = False):
def uncheck_checkbox(self, selector: str, force: bool = False):
"""Unchecks the checkbox found by ``selector``.
- | =Arguments= | =Description= |
- | ``selector`` | Selector of the checkbox. See the `Finding elements` section for details about the selectors. |
- | ``force`` | Set to ``True`` to skip Playwright's [https://playwright.dev/docs/actionability|Actionability checks]. |
+ *Arguments:*
+ - ``selector``: Selector of the checkbox. See the `Finding elements` section
+ for details about the selectors.
+ - ``force``: Set to ``True`` to skip Playwright's
+ [https://playwright.dev/docs/actionability | Actionability checks].
Keyword uses strict mode, see `Finding elements` for more details about strict mode.
@@ -744,10 +854,12 @@ def select_options_by(
) -> list[Any]:
"""Selects options from select element found by ``selector``.
- | =Arguments= | =Description= |
- | ``selector`` | Selector of the ``