webdriver-wrapper

Wrapper around the webdriver package that automatically manages Selenium

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

Stackage Nightly 2024-09-19:0.2.0.0
Latest on Hackage:0.2.0.0

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.0@sha256:138a54590504394392bbefbb0d55c20bca530d84277c76d2fa58a96d18783223,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