SeleniumBase is a Python framework for browser automation, web scraping, and testing. It uses the Selenium/WebDriver API and integrates test runners such as pytest, pynose, and behave, providing capabilities for test organization, discovery, execution, status (pass, fail, or skip), and command-line options.
In terms of use, it can be used for web automation, end-to-end testing, and data scraping. The material shows that it includes CDP Mode, which can make browser automation undetectable to anti-bot services, and adds Stealth capabilities to native Playwright; it also includes code for bypassing CAPTCHA. The material mentions that the sb_cdp (pure CDP mode) example can pass the bot detection tests of BrowserScan and Sannysoft, and can bypass Cloudflare Turnstile while performing browser operations. For CAPTCHAs that are not automatically bypassed, sb.solve_captcha() can be used to handle them; if the page has no CAPTCHA, this call will not perform any operation.
Main capabilities include: automatically handling common WebDriver actions, such as launching the browser, saving screenshots on failure, and closing the browser after the test; automatically detecting CSS selectors and XPath without manually specifying the selector type; methods often perform multiple steps in a single call, for example self.type(selector, text) will sequentially wait for the element to be visible, wait for the element to be interactable, clear the text box, enter new text, and if the text ends with "\n", press Enter/submit; providing default timeouts, for example self.click("button"), and explicit timeouts can also be modified via the timeout parameter, such as self.click("button", timeout=10). sb.assert_* methods will wait up to 7 seconds for the expected condition to appear.
In terms of usage, the material provides multiple approaches: inherit from the BaseCase class and run with pytest or pynose (access the native Selenium driver via self.driver); use the SB Context Manager and run with pure Python (access the native driver via sb.driver); use the Driver Manager and run with pure Python. Regarding test scripts, example scripts whose filenames start or end with test are designed specifically for pytest, while other scripts start with raw and can be run directly with pure Python. Installation can be done via pip from PyPI to install seleniumbase, or by cloning from GitHub to install and upgrade. After installation, enter seleniumbase or sbase to verify. SeleniumBase will automatically download the webdriver as needed, and the driver manager can use --driver-version=VER to specify the version. On the command line, --uc can be used to add stealth capability to pytest, --demo mode will slow down the test and highlight operations, --dashboard can generate an automatically updated dashboard, and --html=report.html can generate a test report.
Applicable scenarios and limitations: suitable for scenarios requiring browser automation, E2E testing, data scraping, and the need to bypass anti-bot detection and CAPTCHA. It supports mainstream browsers such as Chrome, Edge, Firefox, and Safari, as well as Linux/Ubuntu, macOS, and Windows systems; it also supports mainstream CI/CD platforms and can run tests offline when the webdriver has been pre-downloaded. The material does not provide specific pricing, cost, platform, or performance data; this information is not currently available.