A Python library for writing concise, readable, and maintainable browser UI tests with a user-oriented API.
Selene is a Python library for writing browser-based UI tests, built as a Pythonic port of the Java Selenide project. It provides a concise, user-oriented API that abstracts Selenium WebDriver's complexity, enabling developers to write readable and maintainable tests with natural language syntax. It solves the problem of verbose and brittle Selenium scripts by offering smart waiting, automatic retries, and detailed error messages.
Python developers and QA engineers who write browser automation tests and seek more readable, maintainable test code than raw Selenium provides. Teams looking to adopt the Page Object pattern with reusable components.
Developers choose Selene for its Pythonic, expressive API that makes tests read like English, reducing boilerplate and improving team collaboration. Its automatic waiting and retry mechanisms handle dynamic content reliably, while detailed error messages and flexible configuration simplify test maintenance and debugging.
User-oriented Web UI browser tests in Python
Selene's API uses modules like `be` and `have` to write tests that read like natural language, reducing boilerplate and improving team collaboration, as shown in the quick start example with commands like `.should(have.text('Selenium'))`.
Built-in implicit waiting and retry mechanisms handle Ajax-like dynamic content automatically, minimizing flaky tests without manual sleep commands, which is a core feature highlighted in the README.
Provides comprehensive error reports for actions and assertions, making debugging easier by pinpointing failures in decomposed selectors, as emphasized in the 'Flexible filtering of collections' section.
Options like timeouts and selectors can be customized globally, per browser, per element, or per action, offering fine-grained control, as detailed in the 'Highly customizable' feature description.
The recommended version v2.0.0rc9 is still in alpha/beta with ongoing API refinements, risking breaking changes for production use, as admitted in the versions section noting 'some commands are in progress of deprecation and renaming'.
Upgrading from v1.x to v2.x requires extensive code changes, including method renames and syntax updates per the migration guide, which can be cumbersome for existing projects.
Selene's abstractions might lag behind Selenium updates, and issues in underlying Selenium can propagate, limiting control over driver-specific features and requiring updates when Selenium changes.
Lighter web automation with Python
Selenium Python bindings
Robot Framework is a generic test automation framework for acceptance testing and ATDD
Stateful programmatic web browsing
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.