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.
A Rust port of the Python SeleniumBase testing framework. Provides browser automation, stealth/undetected modes, and a command-line helper.
Commands#
| Command | What it does |
|---|---|
sbrs accept-alert | Accept the active browser alert. |
sbrs add-text | Append text to an input or textarea. |
sbrs assert-attribute | Assert an element attribute equals an expected value. |
sbrs assert-element | Assert that an element exists. |
sbrs assert-link-text | Assert a link with the given text is visible. |
sbrs assert-pdf-text | Assert that a page or PDF URL contains the expected text. |
sbrs assert-text-not-visible | Assert that an element does not contain the given text. |
sbrs assert-text-visible | Assert that an element contains the expected text. |
sbrs assert-title | Assert the page title contains the expected text. |
sbrs behave-gui | Launch the Behave Commander, a terminal app (needs a build with the tui feature). |
sbrs cache-clear | Clear the browser cache via CDP. |
sbrs caseplans | Launch the Case Plans Generator, a terminal app (needs a build with the tui feature). |
sbrs cdp | Execute a Chrome DevTools Protocol command. |
sbrs cdp-click-element | Click an element using CDP. |
sbrs cdp-type-text | Type text using CDP input injection. |
sbrs check-if-unchecked | Check a checkbox only if it is unchecked. |
sbrs choose-file | Upload a local file into a file input. |
sbrs clear-cookies | Delete all browser cookies. |
sbrs clear-local-storage | Clear the page local storage. |
sbrs click-partial-link-text | Click a link containing the given text. |
sbrs click-visible-elements | Click all visible elements matching a selector. |
sbrs close-window | Close the current browser window. |
sbrs commander | Launch the interactive commander (needs a build with the tui feature). |
sbrs completions | Generate a completion script for a supported shell, or a Fig spec. |
sbrs decrypt | Decrypt a token made by sbrs encrypt; read from stdin if TOKEN is omitted. Python’s sbrs unobfuscate is the same command. |
sbrs deferred | Run several assertions, then report every failure at once. |
sbrs devtools | Launch Chrome with an open DevTools endpoint and print MCP client configs. |
sbrs dismiss-alert | Dismiss the active browser alert. |
sbrs doctor | Run a diagnostic check on the environment and configuration. |
sbrs download-file | Download a file from a URL (browser download with an HTTP fallback). |
sbrs drag-and-drop | Drag one element onto another. |
sbrs encrypt | Encrypt text with a passphrase (AES-256-GCM); read from stdin if TEXT is omitted. |
sbrs export-recording | Export the recorded test actions. |
sbrs get-active-element-css | Print a CSS selector for the currently focused element. |
sbrs get-alert-text | Print the text of the active alert. |
sbrs get-attribute | Print an element attribute value. |
sbrs get-cookies | Print all browser cookies as JSON. |
sbrs get-current-url | Print the current URL. |
sbrs get-local-storage-item | Print a local storage value by key. |
sbrs get-property | Print an element property value. |
sbrs get-text | Print the visible text of an element. |
sbrs get-title | Print the page title. |
sbrs get-value | Print the value of a form element. |
sbrs get-window-position | Print the browser window position. |
sbrs go-back | Navigate back in browser history. |
sbrs go-forward | Navigate forward in browser history. |
sbrs grid-hub | Start, stop, restart or check a Selenium Grid hub. |
sbrs grid-node | Start, stop, restart or check a Selenium Grid node. |
sbrs highlight-click | Highlight an element, then click it. |
sbrs hover | Hover over an element. |
sbrs hover-and-click | Hover over one element, then click another. |
sbrs human-click | Click an element with human-like timing and noise. |
sbrs human-type | Type text with human-like timing and noise. |
sbrs import-playwright | Convert Playwright tests or a script (JavaScript, TypeScript or Python) into Rust tests for the pure CDP engine. |
sbrs import-puppeteer | Convert Puppeteer scripts or tests (JavaScript, TypeScript) or a Chrome Recorder JSON export into Rust tests for the pure CDP engine. |
sbrs import-python | Convert common SeleniumBase or Selenium Python code into a Rust test. |
sbrs install | Download a driver into ./downloaded_drivers/ (Python’s sbrs get). |
sbrs is-checked | Print whether a checkbox is checked. |
sbrs is-element-visible | Print whether an element is visible. |
sbrs is-link-text-visible | Print whether a link with the given text is visible. |
sbrs is-partial-link-text-visible | Print whether a link containing the given text is visible. |
sbrs is-text-visible | Print whether the expected text is visible in an element. |
sbrs load-cookies | Load browser cookies from a JSON file. |
sbrs mkchart | Create an HTML chart. |
sbrs mkdir | Create a folder with a runnable browser-test suite. |
sbrs mkfile | Create a browser-test file. |
sbrs mkpres | Create an HTML presentation. |
sbrs mkrec | Create a test recording scaffold. |
sbrs objectify | Objectify a test recording. |
sbrs open | Open a URL in the browser. |
sbrs open-new-tab | Open a new browser tab. |
sbrs open-new-window | Open a new browser window. |
sbrs patch-chrome | Patch a Chrome/Chromium binary for native-level spoofing. |
sbrs patch-chromedriver | Patch a chromedriver binary to reduce detection surface. |
sbrs pdf-text | Print the text extracted from a page or PDF URL. |
sbrs plugin | List the built-in plugins, or show what one declares. |
sbrs plugin info | Show what one plugin declares and what it may do. |
sbrs plugin list | List the built-in plugins of this build, and whether they are on. |
sbrs print | Print a file. |
sbrs print-pdf | Print a page to PDF and save it to disk. |
sbrs prompt | Print one short line for a shell prompt: the installed Chrome’s major version and whether a matching chromedriver is at hand. |
sbrs record | Record browser interactions into a replayable action file. |
sbrs refresh | Reload the current page. |
sbrs remove-local-storage-item | Remove a local storage entry by key. |
sbrs replay | Replay a recorded action file against a fresh browser session. |
sbrs run-scenario | Run a scenario file and write an optional dashboard. |
sbrs save-cookies | Save browser cookies to a JSON file. |
sbrs save-source | Save the current page source to a file. |
sbrs screenshot | Capture a screenshot of the current page. |
sbrs select-option | Select an option from a dropdown. |
sbrs send-keys | Send keystrokes to an element. |
sbrs set-local-storage-item | Set a local storage key/value pair. |
sbrs set-window-position | Set the browser window position. |
sbrs smoke | Run a smoke test against a URL. |
sbrs smooth-scroll-to | Smoothly scroll an element into view. |
sbrs switch-to-default-content | Switch focus back to the main document. |
sbrs switch-to-default-window | Switch focus to the default window. |
sbrs switch-to-frame | Switch focus to an iframe. |
sbrs switch-to-newest-window | Switch focus to the newest browser window. |
sbrs switch-to-parent-frame | Switch focus to the parent frame. |
sbrs switch-to-window | Switch focus to a window by handle. |
sbrs test | Run the project’s tests, or one example, through Cargo. |
sbrs throttle3g | Throttle the browser connection to 3G speeds. |
sbrs translate | Write the actions of a JSON scenario in another language. |
sbrs type-alert-text | Type text into the active alert prompt. |
sbrs uc-click | Perform a UC-mode click on an element. |
sbrs uc-type | Perform UC-mode typing into an element. |
sbrs uncheck-if-checked | Uncheck a checkbox only if it is checked. |
sbrs version | Print the sbrs version, as sbrs --version does. |
sbrs wait-for-and-accept-alert | Wait for an alert, then accept it. |
sbrs wait-for-and-dismiss-alert | Wait for an alert, then dismiss it. |
sbrs wait-for-element-not-visible | Wait until an element is no longer visible. |
sbrs wait-for-element-present | Wait until an element is present in the DOM. |
sbrs wait-for-ready-state-complete | Wait until the document readyState is complete. |
sbrs wait-for-text | Wait until an element contains the expected text. |
Global flags#
They go before the command: sbrs --headless open URL.
WebDriver server URL (default: SB_WEBDRIVER_URL, else http://localhost:4444)
Browser engine to launch (default: chrome, or the config file’s)
One of: chrome, chromium, edge, firefox, brave, comet, opera, safari, ie, cft, chs
Run the browser in headed mode
Run the browser in headless mode
Enable Chrome DevTools Protocol mode
Enable undetected-chromedriver style evasions
Override the default user agent string
Alias for —user-agent
Also: -a
Locale string for the browser context
Refuse the requests of ad and tracker hosts (Chromium WebDriver sessions)
Proxy (host:port or scheme://host:port); with —proxy-list, a name from the list
File of proxies to choose from; without —proxy a random one is used
URL to a proxy auto-config (PAC) file
Path to a persistent browser user-data directory
Path to an unpacked extension directory
Share browsers among the tests of the run (SB_REUSE_SESSION)
Also: --reuse_session, --rs
Share a browser among the tests of one Rust module (SB_REUSE_CLASS_SESSION)
Also: --reuse-class-session, --reuse_class_session
Use a mobile device emulation profile
End the current test when ESC is pressed in the browser
Also: --esc_end, --ee
Write recordings as pure CDP code (sb_cdp Page and Locator calls)
Also: --rec_sb_cdp
Number of parallel threads for test runs
Also: -n
Path to a TOML/JSON settings file
Also: -c
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.
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.
Print help
Also: -h
Print version
Also: -V
sbrs accept-alert#
Accept the active browser alert.
sbrs add-text#
Append text to an input or textarea.
Flags
CSS selector for the target element
Text to append to the element
sbrs assert-attribute#
Assert an element attribute equals an expected value.
Flags
CSS selector for the target element
Attribute name to read or assert
Expected attribute value
sbrs assert-element#
Assert that an element exists.
Flags
CSS selector for the target element
sbrs assert-link-text#
Assert a link with the given text is visible.
Flags
Exact link text to assert
sbrs assert-pdf-text#
Assert that a page or PDF URL contains the expected text.
Arguments
URL of the page or PDF to check
Flags
Text that must appear in the PDF
Also keep the intermediate PDF at this path
sbrs assert-text-not-visible#
Assert that an element does not contain the given text.
Flags
CSS selector for the target element
Text that should not be visible
sbrs assert-text-visible#
Assert that an element contains the expected text.
Flags
CSS selector for the target element
Expected visible text
sbrs assert-title#
Assert the page title contains the expected text.
Flags
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.
Arguments
A folder of feature files, or one .feature file.
Flags
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.
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.
Arguments
A folder of tests, or one test file.
Flags
Write the starter checklist CASE_PLANS.md instead; this needs no tui feature.
sbrs cdp#
Execute a Chrome DevTools Protocol command.
Flags
CDP method name (e.g. Runtime.evaluate)
JSON object of CDP parameters
sbrs cdp-click-element#
Click an element using CDP.
Flags
CSS selector for the target element
sbrs cdp-type-text#
Type text using CDP input injection.
Flags
Text to inject via CDP
sbrs check-if-unchecked#
Check a checkbox only if it is unchecked.
Flags
CSS selector for the target element
sbrs choose-file#
Upload a local file into a file input.
Arguments
CSS selector of the <input type=file> element
Local file to upload
Flags
Page to open first (defaults to a generated blank upload page)
sbrs clear-cookies#
Delete all browser cookies.
sbrs clear-local-storage#
Clear the page local storage.
sbrs click-partial-link-text#
Click a link containing the given text.
Flags
Link text substring to click
sbrs click-visible-elements#
Click all visible elements matching a selector.
Flags
CSS selector for the target element
sbrs close-window#
Close the current browser window.
sbrs commander#
Launch the interactive commander (needs a build with the tui feature).
sbrs completions#
Generate a completion script for a supported shell, or a Fig spec.
Arguments
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.
Arguments
The token to decrypt.
sbrs deferred#
Run several assertions, then report every failure at once.
Flags
URL to open before running the assertions
Assertion spec: element=<css>, text=<css>:<text>, title=<text>, or url=<text>
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.
Flags
Run the browser without a window
Profile directory to keep (default: a throwaway one; never Chrome’s own default profile)
Proxy: SERVER:PORT, USER:PASS@SERVER:PORT or scheme://SERVER:PORT
Browser binary to launch, such as Microsoft Edge or another Chromium browser
Page to open once the browser runs
Print the endpoint and configs as one line of JSON instead of text
sbrs dismiss-alert#
Dismiss the active browser alert.
sbrs doctor#
Run a diagnostic check on the environment and configuration.
sbrs download-file#
Download a file from a URL (browser download with an HTTP fallback).
Arguments
URL of the file to download
Flags
Output file path (defaults to the URL file name in the current directory)
Also: -o
Seconds to wait for the browser download before falling back to HTTP
Default: "30"
sbrs drag-and-drop#
Drag one element onto another.
Flags
CSS selector of the element to drag
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.
Arguments
The text to encrypt.
sbrs export-recording#
Export the recorded test actions.
sbrs get-active-element-css#
Print a CSS selector for the currently focused element.
sbrs get-alert-text#
Print the text of the active alert.
sbrs get-attribute#
Print an element attribute value.
Flags
CSS selector for the target element
Attribute name to read or assert
sbrs get-cookies#
Print all browser cookies as JSON.
sbrs get-current-url#
Print the current URL.
sbrs get-local-storage-item#
Print a local storage value by key.
Flags
Storage key
sbrs get-property#
Print an element property value.
Flags
CSS selector for the target element
Property name to read
sbrs get-text#
Print the visible text of an element.
Flags
CSS selector for the target element
sbrs get-title#
Print the page title.
sbrs get-value#
Print the value of a form element.
Flags
CSS selector for the target element
sbrs get-window-position#
Print the browser window position.
sbrs go-back#
Navigate back in browser history.
sbrs go-forward#
Navigate forward in browser history.
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).
Arguments
What to do with the Grid process.
One of: start, stop, restart, status
More arguments for the Selenium Server, after --.
Flags
The Selenium Server jar (default: the SB_SELENIUM_SERVER_JAR variable). It is never downloaded.
The Java executable (default: java on PATH).
The address to listen on.
The port to listen on (default: 4444 for a hub, 5555 for a node).
For a node, the hub to register with: a host or a URL.
Close sessions that have been idle this many seconds.
Log at INFO instead of WARNING.
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.
Arguments
What to do with the Grid process.
One of: start, stop, restart, status
More arguments for the Selenium Server, after --.
Flags
The Selenium Server jar (default: the SB_SELENIUM_SERVER_JAR variable). It is never downloaded.
The Java executable (default: java on PATH).
The address to listen on.
The port to listen on (default: 4444 for a hub, 5555 for a node).
For a node, the hub to register with: a host or a URL.
Close sessions that have been idle this many seconds.
Log at INFO instead of WARNING.
Start even if something already accepts connections on the port.
sbrs highlight-click#
Highlight an element, then click it.
Flags
CSS selector for the target element
sbrs hover#
Hover over an element.
Flags
CSS selector for the target element
sbrs hover-and-click#
Hover over one element, then click another.
Flags
CSS selector to hover over
CSS selector to click
sbrs human-click#
Click an element with human-like timing and noise.
Flags
CSS selector for the target element
sbrs human-type#
Type text with human-like timing and noise.
Flags
CSS selector for the target element
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.
Arguments
Playwright source file to convert.
Flags
Output file for the generated Rust tests
Also: -o
Source language (default: from the file extension, else from the content)
One of: js, ts, python
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.
Arguments
Puppeteer source file (or Recorder .json export) to convert.
Flags
Output file for the generated Rust tests
Also: -o
Source language (default: from the file extension, else from the content)
One of: js, ts, json
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.
Arguments
Python source file to convert.
Flags
Output file for the generated Rust test
Also: -o
Source API to assume when converting Python code
One of: auto, selenium-base, selenium
Default: "auto"
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.
Arguments
The driver: chromedriver, geckodriver (or firefoxdriver), edgedriver (or msedgedriver).
Default: "chromedriver"
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.
Flags
CSS selector for the target element
sbrs is-element-visible#
Print whether an element is visible.
Flags
CSS selector for the target element
sbrs is-link-text-visible#
Print whether a link with the given text is visible.
Flags
Exact link text to check
sbrs is-partial-link-text-visible#
Print whether a link containing the given text is visible.
Flags
Link text substring to check
sbrs is-text-visible#
Print whether the expected text is visible in an element.
Flags
CSS selector for the target element
Expected text to check
sbrs load-cookies#
Load browser cookies from a JSON file.
Flags
JSON file to load cookies from
sbrs mkchart#
Create an HTML chart.
Flags
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.
Arguments
Folder to create, for example tests/ui.
Flags
Create only the scaffolding, with no example tests.
Also: -b
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.
Arguments
File to create, for example tests/login.rs.
Flags
Page the test opens (default: https://example.com).
Leave the test body empty: it only opens the page.
Also: -b
Replace the file if it already exists.
sbrs mkpres#
Create an HTML presentation.
Flags
Output HTML presentation path
sbrs mkrec#
Create a test recording scaffold.
Flags
Output recording scaffold path
sbrs objectify#
Objectify a test recording.
sbrs open#
Open a URL in the browser.
Arguments
URL to open in the browser.
sbrs open-new-tab#
Open a new browser tab.
sbrs open-new-window#
Open a new browser window.
sbrs patch-chrome#
Patch a Chrome/Chromium binary for native-level spoofing.
Flags
Path to the Chrome/Chromium binary
Directory where patched binaries are cached
sbrs patch-chromedriver#
Patch a chromedriver binary to reduce detection surface.
Flags
Path to the chromedriver binary
sbrs pdf-text#
Print the text extracted from a page or PDF URL.
Arguments
URL of the page or PDF to extract text from
Flags
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.
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.
Arguments
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.
sbrs print#
Print a file.
Flags
File path to print
sbrs print-pdf#
Print a page to PDF and save it to disk.
Arguments
URL to render as a PDF
Flags
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.
Flags
The line to print; placeholders {browser} {major} {driver} {mark} {driver_major}, {{ and }} for braces
Default: "{browser} {major} {driver}"
Mark the driver with + - ? instead of ✓ ✗ ?
Browser to report on (default: SB_CHROME_BIN, else the installed Chrome or Chromium)
Run —version again instead of using the versions cached in the user cache folder
Explain on standard error what was found and how
sbrs record#
Record browser interactions into a replayable action file.
Arguments
URL to open and record
Flags
Stop recording after this many seconds (default: run until Ctrl-C)
sbrs refresh#
Reload the current page.
sbrs remove-local-storage-item#
Remove a local storage entry by key.
Flags
Storage key
sbrs replay#
Replay a recorded action file against a fresh browser session.
Arguments
JSON action file produced by sbrs record
sbrs run-scenario#
Run a scenario file and write an optional dashboard.
Flags
Scenario file to run
Optional path to write a scenario dashboard
sbrs save-cookies#
Save browser cookies to a JSON file.
Flags
JSON file to save cookies to
sbrs save-source#
Save the current page source to a file.
Flags
Output HTML file path (default: a new file in latest_logs/)
sbrs screenshot#
Capture a screenshot of the current page.
Flags
Output image file path (default: a new file in latest_logs/)
sbrs select-option#
Select an option from a dropdown.
Flags
CSS selector for the target element
Visible text of the option to select
Option value attribute
sbrs send-keys#
Send keystrokes to an element.
Flags
CSS selector for the target element
Keys to send to the element
sbrs set-local-storage-item#
Set a local storage key/value pair.
Flags
Storage key
Value to store in local storage
sbrs set-window-position#
Set the browser window position.
Flags
Window X coordinate in pixels
Window Y coordinate in pixels
sbrs smoke#
Run a smoke test against a URL.
Arguments
URL to open or smoke-test
Flags
Expected substring in the page title
sbrs smooth-scroll-to#
Smoothly scroll an element into view.
Flags
CSS selector for the target element
sbrs switch-to-default-content#
Switch focus back to the main document.
sbrs switch-to-default-window#
Switch focus to the default window.
sbrs switch-to-frame#
Switch focus to an iframe.
Flags
CSS selector for the target element
sbrs switch-to-newest-window#
Switch focus to the newest browser window.
sbrs switch-to-parent-frame#
Switch focus to the parent frame.
sbrs switch-to-window#
Switch focus to a window by handle.
Flags
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.
Arguments
Run only the tests whose name contains this text.
Arguments for the test harness, after -- (for example —nocapture).
Flags
Run one integration test file from tests/.
Run one example from examples/ instead of the tests.
Build with the release profile.
Cargo features to enable, separated by commas.
sbrs throttle3g#
Throttle the browser connection to 3G speeds.
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.
Arguments
The scenario file.
The language: a code (en, zh, nl, fr, it, ja, ko, pt, ru, es) or its English name.
Flags
Print the translation and write nothing (the default).
Also: -p
Replace the file with the translation.
Also: -o
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.
Flags
Text to type into the alert prompt
sbrs uc-click#
Perform a UC-mode click on an element.
Flags
CSS selector for the target element
sbrs uc-type#
Perform UC-mode typing into an element.
Flags
CSS selector for the target element
Text to type in UC mode
sbrs uncheck-if-checked#
Uncheck a checkbox only if it is checked.
Flags
CSS selector for the target element
sbrs version#
Print the sbrs version, as sbrs --version does.
sbrs wait-for-and-accept-alert#
Wait for an alert, then accept it.
Flags
sbrs wait-for-and-dismiss-alert#
Wait for an alert, then dismiss it.
Flags
sbrs wait-for-element-not-visible#
Wait until an element is no longer visible.
Flags
CSS selector for the target element
sbrs wait-for-element-present#
Wait until an element is present in the DOM.
Flags
CSS selector for the target element
sbrs wait-for-ready-state-complete#
Wait until the document readyState is complete.
sbrs wait-for-text#
Wait until an element contains the expected text.
Flags
CSS selector for the target element
Expected text substring to wait for