SeleniumBase logo

SeleniumBase

Python framework for fast, stealthy web automation and testing

A Python-based automation framework that simplifies UI testing, web scraping, and bot-detection evasion with built-in stealth modes and rich reporting.

SeleniumBase banner

Overview

Overview

SeleniumBase is a Python framework that streamlines browser automation, UI testing, and web scraping. It targets both newcomers and seasoned developers who need a reliable way to interact with modern web applications.

Core Capabilities

The library offers raw-Python scripting as well as pytest-compatible test cases, allowing automatic discovery and execution. Built-in stealth features—UC Mode and CDP Mode—help bypass bot-detection, CAPTCHAs, and Cloudflare challenges. A pure CDP mode runs without Selenium or WebDriver, communicating directly with Chrome DevTools. Comprehensive reporting generates PDFs, HTML logs, screenshots, and video captures, while a visual dashboard presents results at a glance.

Getting Started & Integration

Installation is a single pip command, and over 200 example scripts demonstrate common patterns. Tests can be run locally, in headless mode, or integrated into CI/CD pipelines using standard pytest commands. Command-line options enable mobile emulation, grid farms, and locale settings, making SeleniumBase adaptable to diverse environments.

Highlights

UC Mode and CDP Mode for bot-detection evasion
Pure CDP mode that runs without Selenium/WebDriver
Pytest integration with automatic test discovery
Dashboard with PDF/HTML reports, screenshots, and video capture

Pros

  • Write tests as raw Python scripts or pytest cases
  • Powerful stealth options bypass CAPTCHAs and Cloudflare
  • Over 200 example scripts accelerate learning
  • Rich reporting and visual debugging tools

Considerations

  • Stealth features need frequent updates to stay effective
  • Pure CDP mode limited to Chrome‑based browsers
  • Advanced options (UC, CDP) add learning curve for beginners
  • Large feature set can increase installation size

Managed products teams compare with

When teams consider SeleniumBase, these hosted platforms usually appear on the same shortlist.

BrowserStack Automate logo

BrowserStack Automate

Cross-browser test automation on 3500+ real browser/OS combinations

GHO

Ghost Inspector

Automated browser tests for websites and web apps

LambdaTest logo

LambdaTest

Cross-browser & mobile app testing cloud with real devices and automation

Looking for a hosted option? These are the services engineering teams benchmark against before choosing open source.

Fit guide

Great for

  • QA engineers needing reliable end-to-end UI tests
  • Developers who want to scrape sites protected by bot detection
  • Teams integrating tests into CI/CD pipelines with pytest
  • Users preferring Python over JavaScript‑based automation tools

Not ideal when

  • Projects that require cross-language support beyond Python
  • Environments limited to headless browsers without Chrome/Chromium
  • Scenarios needing ultra-lightweight, single-file scripts
  • Organizations that cannot accommodate frequent updates for stealth evasion

How teams use it

E‑commerce checkout validation

Automated end-to-end test verifies product selection, cart, and order confirmation, generating PDF and screenshot reports.

Bypassing Cloudflare protection

Script uses UC + CDP modes to navigate Cloudflare challenge pages and interact with the site without manual captcha solving.

Large‑scale web scraping

Stealth modes allow extraction of data from sites that block bots, while built-in selectors simplify element interaction.

CI/CD integrated regression suite

Pytest-compatible tests run on each commit, producing HTML dashboards and alerts for failures.

Tech snapshot

Python99%
Shell1%
HTML1%
Gherkin1%
Dockerfile1%
Batchfile1%

Tags

pytestchromedriverpytest-pluginweb-automationwebdriverselenium-pythoncloudflare-bypasspythonbot-detectiontest-automatione2e-testingweb-scraping-pythonseleniumseleniumbasewebkitweb-scrapinganti-detectionbehavepython-scrapercdp

Frequently asked questions

Does SeleniumBase require Selenium WebDriver?

It can use Selenium/WebDriver by default, but also offers a pure CDP mode that operates without them.

Which browsers are supported?

Chrome/Chromium is fully supported; other browsers work through standard Selenium drivers.

How do UC Mode and CDP Mode differ?

UC Mode modifies request headers and mimics real user behavior, while CDP Mode interacts directly with Chrome DevTools Protocol for deeper stealth.

Can I run tests in headless mode?

Yes, headless execution is supported via command-line options.

Is there a GUI for test creation?

SeleniumBase includes a GUI recorder and visual tools, but test scripts are still written in Python.

Project at a glance

Active
Stars
12,110
Watchers
12,110
Forks
1,480
LicenseMIT
Repo age11 years old
Last commit2 days ago
Primary languagePython

Last synced 2 hours ago