Skip to main content
Info

Generated from the usage spec of sbrs (completions/sbrs.usage.kdl) by SB_UPDATE_COMPLETIONS=1 cargo test -p seleniumbase-rs-cli --bin sbrs usage_spec. Do not edit it by hand. For the common commands by task, see the CLI TL;DR.

sbrs 0.5.1 (seleniumbase-rs)

A Rust port of the Python SeleniumBase testing framework. Provides browser automation, stealth/undetected modes, and a command-line helper.

Usage

Commands#

CommandWhat it does
sbrs accept-alertAccept the active browser alert.
sbrs add-textAppend text to an input or textarea.
sbrs assert-attributeAssert an element attribute equals an expected value.
sbrs assert-elementAssert that an element exists.
sbrs assert-link-textAssert a link with the given text is visible.
sbrs assert-pdf-textAssert that a page or PDF URL contains the expected text.
sbrs assert-text-not-visibleAssert that an element does not contain the given text.
sbrs assert-text-visibleAssert that an element contains the expected text.
sbrs assert-titleAssert the page title contains the expected text.
sbrs behave-guiLaunch the Behave Commander, a terminal app (needs a build with the tui feature).
sbrs cache-clearClear the browser cache via CDP.
sbrs caseplansLaunch the Case Plans Generator, a terminal app (needs a build with the tui feature).
sbrs cdpExecute a Chrome DevTools Protocol command.
sbrs cdp-click-elementClick an element using CDP.
sbrs cdp-type-textType text using CDP input injection.
sbrs check-if-uncheckedCheck a checkbox only if it is unchecked.
sbrs choose-fileUpload a local file into a file input.
sbrs clear-cookiesDelete all browser cookies.
sbrs clear-local-storageClear the page local storage.
sbrs click-partial-link-textClick a link containing the given text.
sbrs click-visible-elementsClick all visible elements matching a selector.
sbrs close-windowClose the current browser window.
sbrs commanderLaunch the interactive commander (needs a build with the tui feature).
sbrs completionsGenerate a completion script for a supported shell, or a Fig spec.
sbrs decryptDecrypt a token made by sbrs encrypt; read from stdin if TOKEN is omitted. Python’s sbrs unobfuscate is the same command.
sbrs deferredRun several assertions, then report every failure at once.
sbrs devtoolsLaunch Chrome with an open DevTools endpoint and print MCP client configs.
sbrs dismiss-alertDismiss the active browser alert.
sbrs doctorRun a diagnostic check on the environment and configuration.
sbrs download-fileDownload a file from a URL (browser download with an HTTP fallback).
sbrs drag-and-dropDrag one element onto another.
sbrs encryptEncrypt text with a passphrase (AES-256-GCM); read from stdin if TEXT is omitted.
sbrs export-recordingExport the recorded test actions.
sbrs get-active-element-cssPrint a CSS selector for the currently focused element.
sbrs get-alert-textPrint the text of the active alert.
sbrs get-attributePrint an element attribute value.
sbrs get-cookiesPrint all browser cookies as JSON.
sbrs get-current-urlPrint the current URL.
sbrs get-local-storage-itemPrint a local storage value by key.
sbrs get-propertyPrint an element property value.
sbrs get-textPrint the visible text of an element.
sbrs get-titlePrint the page title.
sbrs get-valuePrint the value of a form element.
sbrs get-window-positionPrint the browser window position.
sbrs go-backNavigate back in browser history.
sbrs go-forwardNavigate forward in browser history.
sbrs grid-hubStart, stop, restart or check a Selenium Grid hub.
sbrs grid-nodeStart, stop, restart or check a Selenium Grid node.
sbrs highlight-clickHighlight an element, then click it.
sbrs hoverHover over an element.
sbrs hover-and-clickHover over one element, then click another.
sbrs human-clickClick an element with human-like timing and noise.
sbrs human-typeType text with human-like timing and noise.
sbrs import-playwrightConvert Playwright tests or a script (JavaScript, TypeScript or Python) into Rust tests for the pure CDP engine.
sbrs import-puppeteerConvert Puppeteer scripts or tests (JavaScript, TypeScript) or a Chrome Recorder JSON export into Rust tests for the pure CDP engine.
sbrs import-pythonConvert common SeleniumBase or Selenium Python code into a Rust test.
sbrs installDownload a driver into ./downloaded_drivers/ (Python’s sbrs get).
sbrs is-checkedPrint whether a checkbox is checked.
sbrs is-element-visiblePrint whether an element is visible.
sbrs is-link-text-visiblePrint whether a link with the given text is visible.
sbrs is-partial-link-text-visiblePrint whether a link containing the given text is visible.
sbrs is-text-visiblePrint whether the expected text is visible in an element.
sbrs load-cookiesLoad browser cookies from a JSON file.
sbrs mkchartCreate an HTML chart.
sbrs mkdirCreate a folder with a runnable browser-test suite.
sbrs mkfileCreate a browser-test file.
sbrs mkpresCreate an HTML presentation.
sbrs mkrecCreate a test recording scaffold.
sbrs objectifyObjectify a test recording.
sbrs openOpen a URL in the browser.
sbrs open-new-tabOpen a new browser tab.
sbrs open-new-windowOpen a new browser window.
sbrs patch-chromePatch a Chrome/Chromium binary for native-level spoofing.
sbrs patch-chromedriverPatch a chromedriver binary to reduce detection surface.
sbrs pdf-textPrint the text extracted from a page or PDF URL.
sbrs pluginList the built-in plugins, or show what one declares.
sbrs plugin infoShow what one plugin declares and what it may do.
sbrs plugin listList the built-in plugins of this build, and whether they are on.
sbrs printPrint a file.
sbrs print-pdfPrint a page to PDF and save it to disk.
sbrs promptPrint one short line for a shell prompt: the installed Chrome’s major version and whether a matching chromedriver is at hand.
sbrs recordRecord browser interactions into a replayable action file.
sbrs refreshReload the current page.
sbrs remove-local-storage-itemRemove a local storage entry by key.
sbrs replayReplay a recorded action file against a fresh browser session.
sbrs run-scenarioRun a scenario file and write an optional dashboard.
sbrs save-cookiesSave browser cookies to a JSON file.
sbrs save-sourceSave the current page source to a file.
sbrs screenshotCapture a screenshot of the current page.
sbrs select-optionSelect an option from a dropdown.
sbrs send-keysSend keystrokes to an element.
sbrs set-local-storage-itemSet a local storage key/value pair.
sbrs set-window-positionSet the browser window position.
sbrs smokeRun a smoke test against a URL.
sbrs smooth-scroll-toSmoothly scroll an element into view.
sbrs switch-to-default-contentSwitch focus back to the main document.
sbrs switch-to-default-windowSwitch focus to the default window.
sbrs switch-to-frameSwitch focus to an iframe.
sbrs switch-to-newest-windowSwitch focus to the newest browser window.
sbrs switch-to-parent-frameSwitch focus to the parent frame.
sbrs switch-to-windowSwitch focus to a window by handle.
sbrs testRun the project’s tests, or one example, through Cargo.
sbrs throttle3gThrottle the browser connection to 3G speeds.
sbrs translateWrite the actions of a JSON scenario in another language.
sbrs type-alert-textType text into the active alert prompt.
sbrs uc-clickPerform a UC-mode click on an element.
sbrs uc-typePerform UC-mode typing into an element.
sbrs uncheck-if-checkedUncheck a checkbox only if it is checked.
sbrs versionPrint the sbrs version, as sbrs --version does.
sbrs wait-for-and-accept-alertWait for an alert, then accept it.
sbrs wait-for-and-dismiss-alertWait for an alert, then dismiss it.
sbrs wait-for-element-not-visibleWait until an element is no longer visible.
sbrs wait-for-element-presentWait until an element is present in the DOM.
sbrs wait-for-ready-state-completeWait until the document readyState is complete.
sbrs wait-for-textWait until an element contains the expected text.

Global flags#

They go before the command: sbrs --headless open URL.

--webdriver <URL>string#

WebDriver server URL (default: SB_WEBDRIVER_URL, else http://localhost:4444)

--browser <BROWSER>string#

Browser engine to launch (default: chrome, or the config file’s)

One of: chrome, chromium, edge, firefox, brave, comet, opera, safari, ie, cft, chs

--headedboolean#

Run the browser in headed mode

--headlessboolean#

Run the browser in headless mode

--cdpboolean#

Enable Chrome DevTools Protocol mode

--ucboolean#

Enable undetected-chromedriver style evasions

--user-agent <USER_AGENT>string#

Override the default user agent string

--agent <AGENT>string#

Alias for —user-agent

Also: -a

--locale <LOCALE>string#

Locale string for the browser context

--ad-blockboolean#

Refuse the requests of ad and tracker hosts (Chromium WebDriver sessions)

--proxy <PROXY>string#

Proxy (host:port or scheme://host:port); with —proxy-list, a name from the list

--proxy-list <FILE>string#

File of proxies to choose from; without —proxy a random one is used

--proxy-pac-url <PROXY_PAC_URL>string#

URL to a proxy auto-config (PAC) file

--user-data-dir <USER_DATA_DIR>string#

Path to a persistent browser user-data directory

--extension-dir <EXTENSION_DIR>string#

Path to an unpacked extension directory

--reuse-sessionboolean#

Share browsers among the tests of the run (SB_REUSE_SESSION)

Also: --reuse_session, --rs

--rcsboolean#

Share a browser among the tests of one Rust module (SB_REUSE_CLASS_SESSION)

Also: --reuse-class-session, --reuse_class_session

--mobileboolean#

Use a mobile device emulation profile

--esc-endboolean#

End the current test when ESC is pressed in the browser

Also: --esc_end, --ee

--rec-sb-cdpboolean#

Write recordings as pure CDP code (sb_cdp Page and Locator calls)

Also: --rec_sb_cdp

--threads <THREADS>string#

Number of parallel threads for test runs

Also: -n

--config <CONFIG>string#

Path to a TOML/JSON settings file

Also: -c

--plugin <NAME>string[]#

Turn on a built-in plugin in the browsers the command starts (repeatable)

Adds to the plugins the settings file (the [plugins] table) and SB_PLUGINS turn on. Precedence, highest first: the command line, then SB_PLUGINS (which replaces the names the file enables), then the settings file. sbrs plugin list shows the plugins this build has. sbrs test passes the names on to the tests as SB_PLUGINS.

--plugin-opt <NAME.KEY=VALUE>string[]#

Set one option of a plugin, NAME.KEY=VALUE with a TOML VALUE (repeatable)

Quote the whole option so the shell keeps the quotes of a string: —plugin-opt ‘shield.level=“strict”’. An option given here replaces the same option from SB_PLUGINS or the settings file and keeps the plugin’s other options, so the precedence is the command line, then SB_PLUGINS, then the file. The plugin must be turned on by —plugin, SB_PLUGINS or the file. Not available for sbrs test: put the options in the [plugins.NAME] table of the settings file.

--helpboolean#

Print help

Also: -h

--versionboolean#

Print version

Also: -V

sbrs accept-alert#

Accept the active browser alert.

Usage

sbrs add-text#

Append text to an input or textarea.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

--text <TEXT>stringrequired#

Text to append to the element

sbrs assert-attribute#

Assert an element attribute equals an expected value.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

--attribute <ATTRIBUTE>stringrequired#

Attribute name to read or assert

--value <VALUE>stringrequired#

Expected attribute value

sbrs assert-element#

Assert that an element exists.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

Assert a link with the given text is visible.

Usage

Flags

--text <TEXT>stringrequired#

Exact link text to assert

sbrs assert-pdf-text#

Assert that a page or PDF URL contains the expected text.

Usage

Arguments

URLstringrequired#

URL of the page or PDF to check

Flags

--text <TEXT>stringrequired#

Text that must appear in the PDF

--save-pdf <SAVE_PDF>string#

Also keep the intermediate PDF at this path

sbrs assert-text-not-visible#

Assert that an element does not contain the given text.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

--text <TEXT>stringrequired#

Text that should not be visible

sbrs assert-text-visible#

Assert that an element contains the expected text.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

--text <TEXT>stringrequired#

Expected visible text

sbrs assert-title#

Assert the page title contains the expected text.

Usage

Flags

--text <TEXT>stringrequired#

Expected page title substring

sbrs behave-gui#

Also: gui-behave

Launch the Behave Commander, a terminal app (needs a build with the tui feature).

Lists the .feature files under PATH with their scenarios, runs the ones you mark through the crate’s behave runner and shows the results. PATH is a folder of feature files or one file; by default features.

The runner has only the built-in steps: steps written in Rust are not loaded, and a scenario that uses one is reported as undefined. The Python command opens a Tkinter window; this one runs in the terminal.

Usage

Arguments

PATHstring#

A folder of feature files, or one .feature file.

Flags

--newboolean#

Prompt for a name, a title and scenarios and write a new feature file instead; this needs no tui feature.

sbrs cache-clear#

Clear the browser cache via CDP.

Usage

sbrs caseplans#

Also: case-plans

Launch the Case Plans Generator, a terminal app (needs a build with the tui feature).

Lists the tests under PATH and creates, edits and saves a case plan for each, case_plans/<test>.md next to its file, and writes a summary of the plans to case_summary.md. PATH is a folder of tests or one test file; by default the tests/ and examples/ folders of the current folder.

The Python command opens a Tkinter window; this one runs in the terminal.

Usage

Arguments

PATHstring#

A folder of tests, or one test file.

Flags

--starterboolean#

Write the starter checklist CASE_PLANS.md instead; this needs no tui feature.

sbrs cdp#

Execute a Chrome DevTools Protocol command.

Usage

Flags

--cmd <CMD>stringrequired#

CDP method name (e.g. Runtime.evaluate)

--params <PARAMS>string#

JSON object of CDP parameters

sbrs cdp-click-element#

Click an element using CDP.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

sbrs cdp-type-text#

Type text using CDP input injection.

Usage

Flags

--text <TEXT>stringrequired#

Text to inject via CDP

sbrs check-if-unchecked#

Check a checkbox only if it is unchecked.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

sbrs choose-file#

Upload a local file into a file input.

Usage

Arguments

SELECTORstringrequired#

CSS selector of the <input type=file> element

FILEstringrequired#

Local file to upload

Flags

--url <URL>string#

Page to open first (defaults to a generated blank upload page)

sbrs clear-cookies#

Delete all browser cookies.

Usage

sbrs clear-local-storage#

Clear the page local storage.

Usage

Click a link containing the given text.

Usage

Flags

--text <TEXT>stringrequired#

Link text substring to click

sbrs click-visible-elements#

Click all visible elements matching a selector.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

sbrs close-window#

Close the current browser window.

Usage

sbrs commander#

Launch the interactive commander (needs a build with the tui feature).

Usage

sbrs completions#

Generate a completion script for a supported shell, or a Fig spec.

Usage

Arguments

SHELLstringrequired#

Shell (or fig for a Fig spec) to generate completions for

One of: bash, zsh, fish, elvish, powershell, fig, usage

sbrs decrypt#

Also: unobfuscate

Decrypt a token made by sbrs encrypt; read from stdin if TOKEN is omitted. Python’s sbrs unobfuscate is the same command.

Usage

Arguments

TOKENstring#

The token to decrypt.

sbrs deferred#

Run several assertions, then report every failure at once.

Usage

Flags

--url <URL>string#

URL to open before running the assertions

--assert <SPEC>string[]#

Assertion spec: element=<css>, text=<css>:<text>, title=<text>, or url=<text>

--spec <SPEC>string#

JSON file containing an array of assertion specs

sbrs devtools#

Launch Chrome with an open DevTools endpoint and print MCP client configs.

Starts Chrome with the Pure CDP engine (no chromedriver), prints the DevTools HTTP endpoint, the browser WebSocket URL and configs for Google’s chrome-devtools-mcp and Microsoft’s Playwright MCP, then keeps the browser running until Ctrl+C, which closes it and exits with 0. The global —browser (chrome, chromium, edge or another Chromium browser), —headed, —user-agent, —locale, —ad-block, —extension-dir and —proxy-list apply as well.

Usage

Flags

--headlessboolean#

Run the browser without a window

--port <PORT>string#

DevTools port on 127.0.0.1 (0 lets Chrome pick a free one)

Default: "9222"

--user-data-dir <DIR>string#

Profile directory to keep (default: a throwaway one; never Chrome’s own default profile)

--proxy <PROXY>string#

Proxy: SERVER:PORT, USER:PASS@SERVER:PORT or scheme://SERVER:PORT

--browser-path <PATH>string#

Browser binary to launch, such as Microsoft Edge or another Chromium browser

--url <URL>string#

Page to open once the browser runs

--jsonboolean#

Print the endpoint and configs as one line of JSON instead of text

sbrs dismiss-alert#

Dismiss the active browser alert.

Usage

sbrs doctor#

Run a diagnostic check on the environment and configuration.

Usage

sbrs download-file#

Download a file from a URL (browser download with an HTTP fallback).

Usage

Arguments

URLstringrequired#

URL of the file to download

Flags

--output <OUTPUT>string#

Output file path (defaults to the URL file name in the current directory)

Also: -o

--timeout <TIMEOUT>string#

Seconds to wait for the browser download before falling back to HTTP

Default: "30"

sbrs drag-and-drop#

Drag one element onto another.

Usage

Flags

--source-css <SOURCE_CSS>stringrequired#

CSS selector of the element to drag

--target-css <TARGET_CSS>stringrequired#

CSS selector of the drop target

sbrs encrypt#

Also: obfuscate

Encrypt text with a passphrase (AES-256-GCM); read from stdin if TEXT is omitted.

The passphrase comes from the SB_ENCRYPTION_KEY environment variable, never from an argument, so it stays out of shell history and process listings. Python’s sbrs obfuscate is the same command.

Usage

Arguments

TEXTstring#

The text to encrypt.

sbrs export-recording#

Export the recorded test actions.

Usage

sbrs get-active-element-css#

Print a CSS selector for the currently focused element.

Usage

sbrs get-alert-text#

Print the text of the active alert.

Usage

sbrs get-attribute#

Print an element attribute value.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

--attribute <ATTRIBUTE>stringrequired#

Attribute name to read or assert

sbrs get-cookies#

Print all browser cookies as JSON.

Usage

sbrs get-current-url#

Print the current URL.

Usage

sbrs get-local-storage-item#

Print a local storage value by key.

Usage

Flags

--key <KEY>stringrequired#

Storage key

sbrs get-property#

Print an element property value.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

--property <PROPERTY>stringrequired#

Property name to read

sbrs get-text#

Print the visible text of an element.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

sbrs get-title#

Print the page title.

Usage

sbrs get-value#

Print the value of a form element.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

sbrs get-window-position#

Print the browser window position.

Usage

sbrs go-back#

Navigate back in browser history.

Usage

sbrs go-forward#

Navigate forward in browser history.

Usage

sbrs grid-hub#

Start, stop, restart or check a Selenium Grid hub.

Needs a Selenium Server jar you supply; nothing is downloaded. The process record and log are kept in a folder of your own (SB_GRID_DIR).

Usage

Arguments

ACTIONstringrequired#

What to do with the Grid process.

One of: start, stop, restart, status

EXTRA_ARGSstring[]#

More arguments for the Selenium Server, after --.

Flags

--jar <PATH>string#

The Selenium Server jar (default: the SB_SELENIUM_SERVER_JAR variable). It is never downloaded.

--java <PATH>string#

The Java executable (default: java on PATH).

--grid-host <HOST>string#

The address to listen on.

--grid-port <PORT>string#

The port to listen on (default: 4444 for a hub, 5555 for a node).

--hub <HOST_OR_URL>string#

For a node, the hub to register with: a host or a URL.

--session-timeout <SECONDS>string#

Close sessions that have been idle this many seconds.

--wait <SECONDS>string#

How many seconds start waits for the Grid to become ready.

Default: "60"

--grid-verboseboolean#

Log at INFO instead of WARNING.

--skip-port-checkboolean#

Start even if something already accepts connections on the port.

sbrs grid-node#

Start, stop, restart or check a Selenium Grid node.

A node registers with the hub named by --hub, or with this machine’s.

Usage

Arguments

ACTIONstringrequired#

What to do with the Grid process.

One of: start, stop, restart, status

EXTRA_ARGSstring[]#

More arguments for the Selenium Server, after --.

Flags

--jar <PATH>string#

The Selenium Server jar (default: the SB_SELENIUM_SERVER_JAR variable). It is never downloaded.

--java <PATH>string#

The Java executable (default: java on PATH).

--grid-host <HOST>string#

The address to listen on.

--grid-port <PORT>string#

The port to listen on (default: 4444 for a hub, 5555 for a node).

--hub <HOST_OR_URL>string#

For a node, the hub to register with: a host or a URL.

--session-timeout <SECONDS>string#

Close sessions that have been idle this many seconds.

--wait <SECONDS>string#

How many seconds start waits for the Grid to become ready.

Default: "60"

--grid-verboseboolean#

Log at INFO instead of WARNING.

--skip-port-checkboolean#

Start even if something already accepts connections on the port.

sbrs highlight-click#

Highlight an element, then click it.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

sbrs hover#

Hover over an element.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

sbrs hover-and-click#

Hover over one element, then click another.

Usage

Flags

--hover-css <HOVER_CSS>stringrequired#

CSS selector to hover over

--click-css <CLICK_CSS>stringrequired#

CSS selector to click

sbrs human-click#

Click an element with human-like timing and noise.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

sbrs human-type#

Type text with human-like timing and noise.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

--text <TEXT>stringrequired#

Text to type with humanized timing

sbrs import-playwright#

Also: import-pw

Convert Playwright tests or a script (JavaScript, TypeScript or Python) into Rust tests for the pure CDP engine.

Usage

Arguments

FILEstringrequired#

Playwright source file to convert.

Flags

--output <OUTPUT>string#

Output file for the generated Rust tests

Also: -o

--language <LANGUAGE>string#

Source language (default: from the file extension, else from the content)

One of: js, ts, python

--test-name <TEST_NAME>string#

Name of the test generated for a script without test titles (default: the file name)

sbrs import-puppeteer#

Also: import-pptr

Convert Puppeteer scripts or tests (JavaScript, TypeScript) or a Chrome Recorder JSON export into Rust tests for the pure CDP engine.

Usage

Arguments

FILEstringrequired#

Puppeteer source file (or Recorder .json export) to convert.

Flags

--output <OUTPUT>string#

Output file for the generated Rust tests

Also: -o

--language <LANGUAGE>string#

Source language (default: from the file extension, else from the content)

One of: js, ts, json

--test-name <TEST_NAME>string#

Name of the test generated for a script without test titles (default: the file name)

sbrs import-python#

Convert common SeleniumBase or Selenium Python code into a Rust test.

Usage

Arguments

FILEstringrequired#

Python source file to convert.

Flags

--output <OUTPUT>string#

Output file for the generated Rust test

Also: -o

--source <SOURCE>string#

Source API to assume when converting Python code

One of: auto, selenium-base, selenium

Default: "auto"

--test-name <TEST_NAME>string#

Name of the generated test function

sbrs install#

Also: get

Download a driver into ./downloaded_drivers/ (Python’s sbrs get).

Without a version, chromedriver and edgedriver are the drivers for the installed Chrome and Edge, and geckodriver is the newest release.

Usage

Arguments

DRIVERstring#

The driver: chromedriver, geckodriver (or firefoxdriver), edgedriver (or msedgedriver).

Default: "chromedriver"

VERSIONstring#

latest, a major version (chromedriver, edgedriver), a full build, or a geckodriver version such as 0.36.0.

sbrs is-checked#

Print whether a checkbox is checked.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

sbrs is-element-visible#

Print whether an element is visible.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

Print whether a link with the given text is visible.

Usage

Flags

--text <TEXT>stringrequired#

Exact link text to check

Print whether a link containing the given text is visible.

Usage

Flags

--text <TEXT>stringrequired#

Link text substring to check

sbrs is-text-visible#

Print whether the expected text is visible in an element.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

--text <TEXT>stringrequired#

Expected text to check

sbrs load-cookies#

Load browser cookies from a JSON file.

Usage

Flags

--file <FILE>stringrequired#

JSON file to load cookies from

sbrs mkchart#

Create an HTML chart.

Usage

Flags

--file <FILE>stringrequired#

Output HTML chart path

sbrs mkdir#

Create a folder with a runnable browser-test suite.

Names are relative to the current directory and use letters, digits, _, - and ., with / between folders. Nothing is overwritten unless --force is given.

Usage

Arguments

DIRstringrequired#

Folder to create, for example tests/ui.

Flags

--basicboolean#

Create only the scaffolding, with no example tests.

Also: -b

--forceboolean#

Replace generated files that already exist.

sbrs mkfile#

Also: new

Create a browser-test file.

The name follows the same rules as mkdir; .rs is added when missing. An existing file is never overwritten unless --force is given.

Usage

Arguments

FILEstringrequired#

File to create, for example tests/login.rs.

Flags

--url <URL>string#

Page the test opens (default: https://example.com).

--basicboolean#

Leave the test body empty: it only opens the page.

Also: -b

--forceboolean#

Replace the file if it already exists.

sbrs mkpres#

Create an HTML presentation.

Usage

Flags

--file <FILE>stringrequired#

Output HTML presentation path

sbrs mkrec#

Create a test recording scaffold.

Usage

Flags

--file <FILE>stringrequired#

Output recording scaffold path

sbrs objectify#

Objectify a test recording.

Usage

sbrs open#

Open a URL in the browser.

Usage

Arguments

URLstringrequired#

URL to open in the browser.

sbrs open-new-tab#

Open a new browser tab.

Usage

sbrs open-new-window#

Open a new browser window.

Usage

sbrs patch-chrome#

Patch a Chrome/Chromium binary for native-level spoofing.

Usage

Flags

--path <PATH>stringrequired#

Path to the Chrome/Chromium binary

--cache-dir <CACHE_DIR>string#

Directory where patched binaries are cached

sbrs patch-chromedriver#

Patch a chromedriver binary to reduce detection surface.

Usage

Flags

--path <PATH>stringrequired#

Path to the chromedriver binary

sbrs pdf-text#

Print the text extracted from a page or PDF URL.

Usage

Arguments

URLstringrequired#

URL of the page or PDF to extract text from

Flags

--save-pdf <SAVE_PDF>string#

Also keep the intermediate PDF at this path

sbrs plugin#

List the built-in plugins, or show what one declares.

Plugins run inside the browsers a command starts. Turn them on by name with the global options —plugin and —plugin-opt, the SB_PLUGINS variable, or the [plugins] table of the settings file; the command line wins over SB_PLUGINS, which wins over the file. sbrs plugin list shows the plugins this build has.

Usage

sbrs plugin info#

Show what one plugin declares and what it may do.

Prints the plugin’s category, phase, capabilities (with their risk, and whether the host enforces them), what it needs, its place among the other plugins and the options it was given. Exits with status 2 and lists the known names when there is no such plugin.

Usage

Arguments

NAMEstringrequired#

The plugin’s name, as sbrs plugin list shows it.

sbrs plugin list#

List the built-in plugins of this build, and whether they are on.

Prints each plugin’s name, category and summary, and yes under ENABLED when the settings file, SB_PLUGINS or the global —plugin option turns it on. A build without built-in plugins says so; rebuild it with —features plugins-builtin.

Usage

sbrs print#

Print a file.

Usage

Flags

--file <FILE>stringrequired#

File path to print

sbrs print-pdf#

Print a page to PDF and save it to disk.

Usage

Arguments

URLstringrequired#

URL to render as a PDF

Flags

--output <OUTPUT>string#

Output PDF file path

Also: -o

Default: "page.pdf"

sbrs prompt#

Print one short line for a shell prompt: the installed Chrome’s major version and whether a matching chromedriver is at hand.

Prints chrome 155 ✓driver, with ✗driver when the chromedriver is missing or of another version and ?driver when its version cannot be read. It starts no browser and uses no network: versions come from files (a macOS app’s Info.plist, the version folder beside chrome.exe), and one that only --version tells is cached for ten minutes in the user cache folder. Prints nothing and exits with 0 when no browser is found; —verbose says why, on standard error. The chromedriver is looked for as sbrs doctor does: CHROMEDRIVER_PATH, downloaded_drivers/, PATH.

Usage

Flags

--format <TEMPLATE>string#

The line to print; placeholders {browser} {major} {driver} {mark} {driver_major}, {{ and }} for braces

Default: "{browser} {major} {driver}"

--asciiboolean#

Mark the driver with + - ? instead of ✓ ✗ ?

--browser-path <PATH>string#

Browser to report on (default: SB_CHROME_BIN, else the installed Chrome or Chromium)

--no-cacheboolean#

Run —version again instead of using the versions cached in the user cache folder

--verboseboolean#

Explain on standard error what was found and how

sbrs record#

Record browser interactions into a replayable action file.

Usage

Arguments

URLstringrequired#

URL to open and record

Flags

--output <OUTPUT>string#

Output action file (.json or .yaml)

Also: -o

Default: "actions.json"

--duration <DURATION>string#

Stop recording after this many seconds (default: run until Ctrl-C)

sbrs refresh#

Reload the current page.

Usage

sbrs remove-local-storage-item#

Remove a local storage entry by key.

Usage

Flags

--key <KEY>stringrequired#

Storage key

sbrs replay#

Replay a recorded action file against a fresh browser session.

Usage

Arguments

FILEstringrequired#

JSON action file produced by sbrs record

sbrs run-scenario#

Run a scenario file and write an optional dashboard.

Usage

Flags

--file <FILE>stringrequired#

Scenario file to run

--dashboard <DASHBOARD>string#

Optional path to write a scenario dashboard

sbrs save-cookies#

Save browser cookies to a JSON file.

Usage

Flags

--file <FILE>stringrequired#

JSON file to save cookies to

sbrs save-source#

Save the current page source to a file.

Usage

Flags

--path <PATH>string#

Output HTML file path (default: a new file in latest_logs/)

sbrs screenshot#

Capture a screenshot of the current page.

Usage

Flags

--path <PATH>string#

Output image file path (default: a new file in latest_logs/)

sbrs select-option#

Select an option from a dropdown.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

--text <TEXT>string#

Visible text of the option to select

--value <VALUE>string#

Option value attribute

sbrs send-keys#

Send keystrokes to an element.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

--text <TEXT>stringrequired#

Keys to send to the element

sbrs set-local-storage-item#

Set a local storage key/value pair.

Usage

Flags

--key <KEY>stringrequired#

Storage key

--value <VALUE>stringrequired#

Value to store in local storage

sbrs set-window-position#

Set the browser window position.

Usage

Flags

--x <X>stringrequired#

Window X coordinate in pixels

--y <Y>stringrequired#

Window Y coordinate in pixels

sbrs smoke#

Run a smoke test against a URL.

Usage

Arguments

URLstringrequired#

URL to open or smoke-test

Flags

--title-contains <TITLE_CONTAINS>string#

Expected substring in the page title

sbrs smooth-scroll-to#

Smoothly scroll an element into view.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

sbrs switch-to-default-content#

Switch focus back to the main document.

Usage

sbrs switch-to-default-window#

Switch focus to the default window.

Usage

sbrs switch-to-frame#

Switch focus to an iframe.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

sbrs switch-to-newest-window#

Switch focus to the newest browser window.

Usage

sbrs switch-to-parent-frame#

Switch focus to the parent frame.

Usage

sbrs switch-to-window#

Switch focus to a window by handle.

Usage

Flags

--handle <HANDLE>stringrequired#

Window handle to switch to

sbrs test#

Run the project’s tests, or one example, through Cargo.

The global options reach the tests as SB_* environment variables (for example sbrs --headless --browser firefox test sets SB_HEADLESS and SB_BROWSER), so a test that loads Settings sees them, and -n sets how many tests run at once. --plugin reaches them as SB_PLUGINS, with the plugins the settings file and the variable already turn on; --plugin-opt cannot be passed on, so sbrs test refuses it.

Usage

Arguments

FILTERstring#

Run only the tests whose name contains this text.

HARNESS_ARGSstring[]#

Arguments for the test harness, after -- (for example —nocapture).

Flags

--test <NAME>string#

Run one integration test file from tests/.

--example <NAME>string#

Run one example from examples/ instead of the tests.

--releaseboolean#

Build with the release profile.

--features <FEATURES>string[]#

Cargo features to enable, separated by commas.

sbrs throttle3g#

Throttle the browser connection to 3G speeds.

Usage

sbrs translate#

Write the actions of a JSON scenario in another language.

Rewrites each step’s action (click, open, …) with the translation dictionary and changes nothing else in the file; the steps keep running, because a scenario can be read in any of the languages. Python SeleniumBase translates Python test files; a Rust test is compiled code, so this translates the portable JSON scenario instead.

Usage

Arguments

FILEstringrequired#

The scenario file.

LANGUAGEstringrequired#

The language: a code (en, zh, nl, fr, it, ja, ko, pt, ru, es) or its English name.

Flags

--printboolean#

Print the translation and write nothing (the default).

Also: -p

--overwriteboolean#

Replace the file with the translation.

Also: -o

--copyboolean#

Write the translation to a new file next to it, such as login_es.json.

Also: -c

sbrs type-alert-text#

Type text into the active alert prompt.

Usage

Flags

--text <TEXT>stringrequired#

Text to type into the alert prompt

sbrs uc-click#

Perform a UC-mode click on an element.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

sbrs uc-type#

Perform UC-mode typing into an element.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

--text <TEXT>stringrequired#

Text to type in UC mode

sbrs uncheck-if-checked#

Uncheck a checkbox only if it is checked.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

sbrs version#

Print the sbrs version, as sbrs --version does.

Usage

sbrs wait-for-and-accept-alert#

Wait for an alert, then accept it.

Usage

Flags

--timeout <TIMEOUT>string#

Maximum wait time in seconds

Default: "10"

sbrs wait-for-and-dismiss-alert#

Wait for an alert, then dismiss it.

Usage

Flags

--timeout <TIMEOUT>string#

Maximum wait time in seconds

Default: "10"

sbrs wait-for-element-not-visible#

Wait until an element is no longer visible.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

--timeout <TIMEOUT>string#

Maximum wait time in seconds

Default: "10"

sbrs wait-for-element-present#

Wait until an element is present in the DOM.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

--timeout <TIMEOUT>string#

Maximum wait time in seconds

Default: "10"

sbrs wait-for-ready-state-complete#

Wait until the document readyState is complete.

Usage

sbrs wait-for-text#

Wait until an element contains the expected text.

Usage

Flags

--css <CSS>stringrequired#

CSS selector for the target element

--text <TEXT>stringrequired#

Expected text substring to wait for

--timeout <TIMEOUT>string#

Maximum wait time in seconds

Default: "10"