Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
T

thirtyfour

> 测试质量
Open source

Selenium WebDriver client for Rust, for automated testing of websites

1.4K stars0 likes0 views
WebsiteGitHub

About

Selenium WebDriver client for Rust, for automated testing of websites

thirtyfour

Thirtyfour is a Selenium / WebDriver library for Rust, for automated website UI testing.

Documentation is available as the Thirtyfour book, llms.txt, and llms-full.txt. If you are porting existing automation, start with the Selenium and Playwright translation guide.

Features

  • All W3C WebDriver and WebElement methods supported
  • Create new browser session directly via WebDriver (e.g. chromedriver)
  • Create new browser session via Selenium Standalone or Grid
  • Find elements (via all common selectors e.g. Testid, Id, Class, CSS, Tag, XPath)
  • Send keys to elements, including key-combinations
  • Execute Javascript
  • Action Chains
  • Get and set cookies
  • Switch to frame/window/element/alert
  • Shadow DOM support
  • Alert support
  • Capture / Save screenshot of browser or individual element as PNG
  • Chrome DevTools Protocol (CDP) — typed commands plus optional WebSocket-based event subscription via the cdp-events feature
  • WebDriver BiDi (W3C bidirectional protocol) — typed commands and event subscription cross-browser, opt-in via the bidi feature
  • Powerful query interface (the recommended way to find elements) with explicit waits and various predicates
  • Component Wrappers (similar to Page Object Model)
  • Browser-test runner that attempts asynchronous cleanup on errors and panics

Feature Flags

  • rustls-tls: (Default) Use rustls to provide TLS support (via reqwest).
  • native-tls: Use native TLS (via reqwest).
  • component: (Default) Enable the Component derive macro (via thirtyfour_macros) and export Component / ElementResolver from the prelude.
  • cdp: (Default) Typed Chrome DevTools Protocol commands.
  • cdp-events: WebSocket-backed CDP event subscription.
  • bidi: WebDriver BiDi (W3C) — typed commands and event subscription via WebDriver::bidi(). Opt in by calling caps.enable_bidi() before starting the session.

Example (async):

To run this example:

cargo run --example tokio_async
…

For test functions, prefer run_browser_test. It attempts driver.quit().await after successful tests, early error returns, and panicking assertions, and preserves both errors when the test and cleanup fail. Call quit() directly for application flows that do not use the runner.

Prefer stable selectors

When you control the application under test, give important elements stable data-testid hooks and select them with By::Testid:

rust
let save_button = driver
    .query(By::Testid("settings-save"))
    .desc("settings save button")
    .single()
    .await?;

Prefer app-owned test IDs first, then stable semantic CSS selectors. Match visible text when the copy itself is part of the behavior you are testing, and use XPath only when CSS cannot reasonably express the target. The Wikipedia example above uses the stable selectors that third-party page actually exposes.

See the Element Queries chapter for the full selector guidance.

Minimum Supported Rust Version

Rust 1.88.

LICENSE

This work is dual-licensed under MIT or Apache 2.0. You can choose either license if you use this work.

See the NOTICE file for more details.

SPDX-License-Identifier: MIT OR Apache-2.0

Issues· 11 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustasyncautomationautomation-seleniumautomation-test

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category测试质量
PricingOpen source

> Related tools

J
Jest
JavaScript 测试框架
P
Playwright
现代端到端测试框架
E
eslint-plugin-test-selectors
Enforces that data-test-id attributes are added to interactive DOM elements (JSX) to help with UI testing. JSX only.