webdriver-wrapper

Wrapper around the webdriver package that automatically manages Selenium

https://github.com/gtollini/webdriver-wrapper#readme

LTS Haskell 23.19:0.2.0.1
Stackage Nightly 2025-04-24:0.2.0.1
Latest on Hackage:0.2.0.1

See all snapshots webdriver-wrapper appears in

BSD-3-Clause licensed by Gabriel Tollini
Maintained by [email protected]
This version can be pinned in stack with:webdriver-wrapper-0.2.0.1@sha256:34237d3c061b4d97b9b09236f51edb6601dc4e670636d2425c79207c70a9ab0d,2200

webdriver-wrapper

This package was created so end-users don’t need to manually manage Selenium or their webdriver when dealing with the webdriver package.

This package is strongly inspired by sandwich-webdriver. My original use-case didn’t require the sandwich test suite, though, so I made this package which focuses on being simpler and more minimalistic.

Extra dependencies

You must have Java installed, since Selenium is distributed as a .jar file. I’m running OpenJDK 17 on my machine, and it just works.

How to use

The wrappedRunSession function is a drop-in replacement for runSession. It will download, if needed, Selenium and a webdriver to ~/.local/haskell-webdriver-wrapper/{your_architecture} (on Linux) or %APPDATA%/haskell-webdriver-wrapper/{your_architecture} (on Windows). Then it starts Selenium and runs your WD a computation, closing Selenium whether WD succeeds or fails.

For runWD, there are two functions: wrappedFirefoxRunWD and wrappedChromeRunWD. They’re also drop-in replacements for runWD, and will also handle everything related to Selenium - the only difference being, as you can imagine, wrappedFirefoxRunWD runs your session on Firefox and wrappedChromeRunWD runs your session on Chrome.

Changes

Changelog for webdriver-wrapper

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to the Haskell Package Versioning Policy.

Unreleased

0.1.0.0 - YYYY-MM-DD