npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

webdriver

v10.1.0

Published

A Node.js bindings implementation for the W3C WebDriver and WebDriver Bidi protocols

Readme

WebDriver

A lightweight, non-opinionated implementation of the WebDriver and WebDriver BiDi specification including mobile commands supported by Appium

There are tons of Selenium and WebDriver binding implementations in the Node.js world. Every one of them has an opinionated API and recommended way to use it. This binding is the most non-opinionated you will find as it just represents the WebDriver specification and doesn't come with any extra or higher-level abstraction. It is lightweight and comes with support for the WebDriver specification and Appium.

The package supports the following protocols:

Commands are added to the client's protocol based on assumptions of provided capabilities. You can find more details about the commands by checking out the @wdio/protocols package. All commands come with TypeScript support.

Install

To install this package from NPM run:

npm i webdriver

WebDriver Example

The following example demonstrates a simple Google Search scenario:

import WebDriver from 'webdriver';

const client = await WebDriver.newSession({
    path: '/',
    capabilities: { browserName: 'firefox' }
})

await client.navigateTo('https://www.google.com/ncr')

const searchInput = await client.findElement('css selector', '#lst-ib')
await client.elementSendKeys(searchInput['element-6066-11e4-a52e-4f735466cecf'], 'WebDriver')

const searchBtn = await client.findElement('css selector', 'input[value="Google Search"]')
await client.elementClick(searchBtn['element-6066-11e4-a52e-4f735466cecf'])

console.log(await client.getTitle()) // outputs "WebDriver - Google Search"

await client.deleteSession()

WebDriver Bidi Example

To connect to the WebDriver Bidi protocol you have to send along a webSocketUrl flag to tell the browser driver to opt-in to the protocol:

import WebDriver from 'webdriver'

const browser = await WebDriver.newSession({
    capabilities: {
        webSocketUrl: true,
        browserName: 'firefox'
    }
})

await browser.sessionSubscribe({ events: ['log.entryAdded'] })

/**
 * returns: {"type":"console","method":"log","realm":null,"args":[{"type":"string","value":"Hello Bidi"}],"level":"info","text":"Hello Bidi","timestamp":1657282076037}
 */
browser.on('log.entryAdded', (entryAdded) => console.log('received %s', entryAdded))

await browser.executeScript('console.log("Hello Bidi")', [])
await browser.deleteSession()

Configuration

To create a WebDriver session call the newSession method on the WebDriver class and pass in your configurations:

import WebDriver from 'webdriver'
const client = await WebDriver.newSession(options)

The following options are available:

capabilities

Defines the capabilities you want to run in your WebDriver session. Note: by default, it will automatically set the webSocketUrl to establish a WebDriver Bidi session, if you don't want this, make sure to set 'wdio:enforceWebDriverClassic': true in your capabilities.

logLevel

Level of logging verbosity.

protocol

Protocol to use when communicating with the Selenium standalone server (or driver).

hostname

Host of your WebDriver server.

port

Port your WebDriver server is on.

path

Path to WebDriver endpoint or grid server.

queryParams

Query parameters that are propagated to the driver server.

connectionRetryTimeout

Timeout for any WebDriver request to a driver or grid.

connectionRetryCount

Count of request retries to the Selenium server.

bidiResponseTimeout

Timeout (in ms) for a WebDriver Bidi command to receive a response from the browser. Increase this if you run commands, e.g. execute, that legitimately take longer than the default to resolve.

bidiConnectTimeout

Timeout (in ms) for the browser to accept the WebDriver Bidi connection. After it, the session continues with WebDriver Classic and Bidi-only commands fail. Increase it if a browser that is busy at startup, e.g. several browsers that start at the same time on a CI runner, accepts the connection late.

This option applies to sessions in Node.js. In a browser, for example with the browser runner, the connection waits until it opens or fails.

agent

Allows you to use a custom http/https/http2 agent to make requests.

transformRequest

Function intercepting HTTP request options before a WebDriver request is made to a driver.

transformResponse

Function intercepting HTTP response objects after a WebDriver response has arrived.