Skip to main content

easelenium

Test

Selenium WebDriver wrapper and GUI toolkit for test automation. Provides a high-level Browser API, the PageObject pattern, and an optional wxPython GUI for generating and running tests without writing boilerplate.

Features:

  • Supports Firefox, Chrome, and Edge
  • PageObject pattern with code generation
  • Context manager and decorator APIs for browser lifecycle
  • Optional wxPython GUI (Generator, Editor, Test Runner tabs)
  • CI-friendly CLI wrapper around pytest
  • Python 3.8+

Installation

Pip

pip install easelenium           # library only
pip install "easelenium[gui]"    # with GUI

With uv

uv add easelenium           # library only
uv add "easelenium[gui]"    # with GUI

Usage

Direct API

from easelenium.browser import Browser
from selenium.webdriver.common.by import By

browser = Browser("gc")                          # gc=Chrome, ff=Firefox, edge=Edge
browser.get("https://duckduckgo.com")
browser.type(by_name="q", text="selenium")
browser.click(by_id="search_button_homepage")
print(browser.get_text(by_css="h2.result__title"))
browser.quit()

Most Browser methods accept either a WebElement, by_*= or a (By, selector) tuple:

search_input = (By.NAME, "q")
browser.type(search_input, text="selenium")
browser.click((By.ID, "search_button_homepage"))

Context manager

from easelenium.browser import browser_context

with browser_context("gc", headless=True) as browser:
    browser.get("https://duckduckgo.com")
    print(browser.get_title())
# browser.quit() called automatically; screenshot saved on exception

Decorator

from easelenium.browser import browser_decorator

@browser_decorator(browser_name="gc", headless=True)
def run_search(browser=None):
    browser.get("https://duckduckgo.com")
    browser.type(by_name="q", text="selenium")

PageObject pattern

from selenium.webdriver.common.by import By
from easelenium.base_page_object import BasePageObject

class DuckDuckGo(BasePageObject):
    SEARCH_INPUT = (By.NAME, "q")
    SEARCH_BUTTON = (By.ID, "search_button_homepage")

    def search(self, text):
        self.browser.get("https://duckduckgo.com")
        self.browser.type(self.SEARCH_INPUT, text=text)
        self.browser.click(self.SEARCH_BUTTON)

Test base class

from easelenium.base_test import BaseTest

class MyTest(BaseTest):
    BROWSER_NAME = "gc"

    def test_title(self):
        self.browser.get("https://duckduckgo.com")
        assert "DuckDuckGo" in self.browser.get_title()

BaseTest handles browser setup/teardown and saves a screenshot on failure.


GUI

Requires the [gui] extra. Launch with:

easelenium_ui
# or
python easelenium/scripts/easelenium_ui.py
Tab Purpose
Generator Open a URL, click elements, emit PageObject source
Editor Edit generated PageObject files
Selector Finder Interactively test CSS/XPath selectors
Test Runner Run pytest suites and view results

CLI (CI)

easelenium_cli --browser GC tests/
# or
python easelenium/scripts/easelenium_cli.py --browser GC tests/

Wraps pytest and injects the chosen browser into fixtures via a pytest plugin.


Development

Requires uv and just.

just init        # create .venv and install dependencies
just fmt         # ruff format
just fix         # ruff check --fix + pyright
just test        # run pytest
just bump minor  # bump version and create git tag (major / minor / patch)

On Linux, run tests with a virtual display:

xvfb-run --server-args="-screen 0 1366x768x24" pytest tests/

Dependencies

Package Role
selenium WebDriver core
webdriver-manager Auto-download browser drivers
loguru Logging
pytest / pytest-html Test runner
wxPython GUI (optional — easelenium[gui])

License

MIT — easelenium/licenses/easelenium_license.txt


Tutorial

  1. Introduction
  2. Setup
  3. Test creation
  4. Continuous Integration

More information

Presentation

Thesis which contains description of the framework

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easelenium-0.8.4.tar.gz (92.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easelenium-0.8.4-py3-none-any.whl (58.7 kB view details)

Uploaded Python 3

File details

Details for the file easelenium-0.8.4.tar.gz.

File metadata

  • Download URL: easelenium-0.8.4.tar.gz
  • Upload date:
  • Size: 92.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for easelenium-0.8.4.tar.gz
Algorithm Hash digest
SHA256 ac79e53dbecfebdfc59247e793ec3def7cbb77265fcbb3531dcbd4165540b64f
MD5 64310d42397faab3f6ba36a8f28cd0fa
BLAKE2b-256 ca7831268315d5f77df05f730bccddf12be90346b566c356651f66031f5f2deb

See more details on using hashes here.

File details

Details for the file easelenium-0.8.4-py3-none-any.whl.

File metadata

  • Download URL: easelenium-0.8.4-py3-none-any.whl
  • Upload date:
  • Size: 58.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for easelenium-0.8.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e5a1f40fb3ea61cb644f08011e3919265384f1f071f333a507199ebe9b14a6fa
MD5 d93b90e062065459643bd5daa91f6870
BLAKE2b-256 100f7823b048e628f16e421b4071404d372fe2b53bae1fbc68f849d6808367a8

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.8.4 This release

2 files

0.8.1

2 files

0.7.2

2 files

0.6.4

2 files

0.6.2

2 files

0.6.1

2 files

0.5

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page