@natl/adapter-selenium
v1.0.0
Published
Official Selenium WebDriver engine adapter for NATL
Maintainers
Readme
@natl/adapter-selenium
Official Selenium WebDriver UI adapter for NATL.
Status: supported with limits — fine for Grid / classic WebDriver pilots; prefer Playwright when you need Trace Viewer or video. Same compact YAML; set engine: selenium (or --engine selenium).
Logo assets: brand/.
Install
npm install @natl/core @natl/adapter-selenium
# Selenium Manager downloads matching drivers automatically when a browser is installedUse with the CLI:
npm install -g @natl/cli @natl/adapter-selenium
natl run tests/ --engine seleniumArtifact parity (vs Playwright)
| Capability | Selenium | Notes |
|------------|----------|--------|
| Fail / step screenshot | Yes | Written under artifacts_dir like Playwright |
| fullPage screenshot | Best-effort | Chrome/Edge via CDP captureBeyondViewport; Firefox → viewport |
| Trace (.zip / Trace Viewer) | No | Explicit no-op; warns when trace is on / on-fail and a keep would apply |
| Video (.webm) | No | Explicit no-op; warns when video is on / on-fail and a keep would apply |
Set trace: off and video: off in config (or CLI) to silence those warnings. Use @natl/adapter-playwright when you need Trace Viewer or video.
Config (factory opts)
# natl.config.yaml
engine: selenium
browser: chrome # chrome | chromium | firefox | edge
headless: true
viewport: # optional window size hint
width: 1280
height: 720
timeout: 15000Remote Grid / corporate WebDriver hub (optional):
set SELENIUM_REMOTE_URL=http://localhost:4444/wd/hub
natl run suite.yaml --engine selenium(SELENIUM_GRID_URL is accepted as an alias.)
Unknown browser values throw a clear error. If the driver/browser cannot start, the error mentions Selenium Manager and SELENIUM_REMOTE_URL.
Develop
pnpm install
pnpm build
pnpm test@natl/core is a peer dependency (^0.1.0). For local work against a sibling checkout use pnpm link or overrides (link:../core).
Exports
| Export | Purpose |
|--------|---------|
| engine | "selenium" |
| createAdapter | AdapterFactory |
| SeleniumAdapter | Class |
| resolveSeleniumBrowser | Map browser string → chrome/firefox/edge |
| resolveSeleniumBy | Map LocatorRef (css | xpath) → Selenium By |
| describeUnsupportedSeleniumArtifacts | Warn text when trace/video cannot be saved |
Notes
- Gestures (
scroll/swipe/longPress) are best-effort via WebDriver Actions / script. - See Artifact parity above for screenshot / trace / video.
