DEV.co
Open-Source Testing · yashaka

selene

Selene is a Python library that simplifies browser automation testing by wrapping Selenium WebDriver with a more readable, user-friendly API. It handles common testing tasks like element waiting, retries, and page object patterns out of the box, reducing boilerplate code.

Source: GitHub — github.com/yashaka/selene
733
GitHub stars
179
Forks
Python
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositoryyashaka/selene
Owneryashaka
Primary languagePython
LicenseMIT — OSI-approved
Stars733
Forks179
Open issues119
Latest release2.0.0rc10 (2026-05-20)
Last updated2026-05-31
Sourcehttps://github.com/yashaka/selene

What selene is

Selene provides lazy-evaluated element selectors, built-in implicit waits with retry logic for Ajax scenarios, extended condition matchers (be.*, have.*), and automatic driver management. It supports Selenium 4.12+, Python 3.10+, and works with local, remote, and Appium drivers.

Quickstart

Get the selene source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/yashaka/selene.gitcd selene# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

End-to-end web UI testing for Python projects

Ideal for teams building test suites that need readable, maintainable assertions without wrestling with raw Selenium. Selene's natural language syntax reduces cognitive load and improves test clarity across teams.

Page Object Model implementations

Selene's lazy-evaluated elements and widget composition support make it well-suited for organizing complex test suites using PageObject patterns, enabling element reuse across test cases.

Dynamic content and Ajax-heavy applications

Built-in smart retry mechanisms and flexible collection filtering handle asynchronously loaded elements and animations without custom wait logic, reducing flakiness in test suites.

Implementation considerations

  • Upgrade to Python 3.10+ and Selenium >= 4.12.0; migration from v1.x involves API refactoring (e.g., .first() → .first, condition syntax changes).
  • Test infrastructure must support headless or cloud driver deployment (Grid, BrowserStack, etc.); Selene abstracts driver setup but still requires valid WebDriver configuration.
  • Learn Selene's condition syntax (be.*, have.*, have.no.*) and lazy element model to avoid common mistakes like evaluating elements before page load.
  • Plan for flakiness mitigation: Selene's retry logic helps, but complex Ajax scenarios may still require custom wait strategies or test data stabilization.
  • CI/CD pipeline must include browser/driver availability (e.g., Chromium for headless, or cloud service credentials); Docker images or GitHub Actions' built-in browser support simplify this.

When to avoid it — and what to weigh

  • Locked into Python < 3.10 — Current v2.x pre-release requires Python 3.10+. Legacy v1.0.2 supports older Python but targets Selenium < 4.0 and is no longer actively developed.
  • Need a fully stable, production-hardened release — Latest release is 2.0.0rc10 (pre-release). While users report 2-year production use, API changes and deprecations are still in progress. Stable v1.0.2 exists but is outdated.
  • Minimal Python/testing knowledge in the team — Selene abstracts Selenium complexity well, but still requires Python proficiency and understanding of async behavior, element location strategies, and waits. Not suitable for non-technical test automation.
  • Enterprise support and SLA requirements — Community-driven open-source project with no commercial backing. Support is limited to GitHub issues (119 open) and Telegram chat. No formal SLA or dedicated support channel.

License & commercial use

Selene is licensed under the MIT License, a permissive open-source license that allows free use, modification, and distribution in commercial and private projects, provided the license and copyright notice are included.

MIT License permits commercial use without restriction. However, this is a community-driven project with no commercial entity backing it. Organizations using Selene in production should understand that support, maintenance, and long-term viability depend on community contributions. No warranty or liability guarantees exist; Requires review of internal risk tolerance.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

Selene is a test automation library and does not directly expose security or authentication mechanisms. Security posture depends on: (1) test infrastructure (driver, CI/CD environment, cloud service credentials); (2) handling of sensitive test data (credentials, PII) in test scripts and logs. Teams should use secure credential management (environment variables, secret managers) and avoid hardcoding secrets in test code. No known CVEs or security audits referenced in provided data.

Alternatives to consider

Selenium WebDriver (raw)

Lower-level control and larger ecosystem, but requires more boilerplate code, manual wait/retry logic, and more verbose assertions. Suitable if fine-grained control is essential or team prefers minimal abstraction.

Playwright (Python)

Modern alternative with faster execution, better async support, and built-in device emulation. Lacks PageObject conventions and may require different test architecture, but offers superior performance and out-of-the-box debugging tools.

Cypress (JavaScript/Node.js)

Purpose-built for modern single-page app testing with excellent developer experience and debugging. Requires JavaScript/Node.js stack; not a Python option but offers superior speed and reliability for web UI tests.

Software development agency

Build on selene with DEV.co software developers

Selene offers a productive, Pythonic alternative to raw Selenium for E2E web testing. If your team uses Python and seeks readable test code with built-in retry logic, review the migration path and production readiness before adoption. Consider engaging Devco for custom test framework setup or integration support.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

selene FAQ

Is Selene v2.0.0rc10 ready for production?
Mostly yes. Multiple users report 2+ years of production use. Risk is API changes and deprecations still in progress. If API stability is critical, use stable v1.0.2 (outdated dependencies) or wait for final v2.0 release. Test thoroughly with your specific use cases.
How does Selene handle flaky tests and timeouts?
Selene provides built-in implicit waits (default 4s, configurable globally or per-element) and smart retry logic for Ajax-like loading. Conditions (be.*, have.*) are re-evaluated until success or timeout. Complex scenarios may still require custom wait strategies or test data stabilization.
Can I use Selene with cloud services like BrowserStack or Sauce Labs?
Yes. Selene supports any Selenium-compatible driver, including remote and cloud services. Pass custom driver options (capabilities, URL) to the browser configuration; Selene's API remains unchanged.
What is the migration path from Selene v1.x to v2.x?
Upgrade Python to 3.10+, update Selene to v2.0.0rc<LATEST>, and refactor deprecated methods (e.g., .first() → .first, text('foo') → have.text('foo'), visible → be.visible). Refer to the migration guide in the README for detailed patterns.

Work with a software development agency

Adopting selene is usually one piece of a larger software development effort. As a software development agency, DEV.co provides software development services and web development expertise — pairing senior software developers and web developers with your team to design, build, and operate open-source testing software in production.

Evaluate Selene for Your Test Automation Needs

Selene offers a productive, Pythonic alternative to raw Selenium for E2E web testing. If your team uses Python and seeks readable test code with built-in retry logic, review the migration path and production readiness before adoption. Consider engaging Devco for custom test framework setup or integration support.