# chromeos-webdriver-server

> A WebDriver server that pushes URLs to ChromeOS devices, built on generic-webdriver-server.

Latest version **1.0.4** (published 2024-05-15) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install chromeos-webdriver-server
pnpm add chromeos-webdriver-server
yarn add chromeos-webdriver-server
bun add chromeos-webdriver-server
```

Provides the commands `chromeos-webdriver-cli`, `chromeos-webdriver-server`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2024-05-15 |
| First published | 2020-08-04 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 36.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Google |
| Maintainers | joeyparrish |
| Keywords | chromebook, chromeos, karma, selenium, webdriver |

## Links

- npm: https://www.npmjs.com/package/chromeos-webdriver-server
- Homepage: https://github.com/shaka-project/generic-webdriver-server
- npm.io page: https://npm.io/package/chromeos-webdriver-server

## Dependencies (4)

- [yargs](https://npm.io/package/yargs.md) ^17.7.2
- [node-ssh](https://npm.io/package/node-ssh.md) ^13.2.0
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.7.0
- [generic-webdriver-server](https://npm.io/package/generic-webdriver-server.md) ^1.1.5

## Alternatives

- [@snazzah/davey](https://npm.io/package/@snazzah/davey.md) — 1.5M weekly downloads
- [@vendure/testing](https://npm.io/package/@vendure/testing.md) — 8.3K weekly downloads
- [vue-simple-context-menu](https://npm.io/package/vue-simple-context-menu.md) — 6.6K weekly downloads
- [cypress-webpack-preprocessor-v5](https://npm.io/package/cypress-webpack-preprocessor-v5.md) — 2.1K weekly downloads
- [@backstage/plugin-catalog-backend-module-puppetdb](https://npm.io/package/@backstage/plugin-catalog-backend-module-puppetdb.md) — 1.3K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2024-05-15
- 1.0.3 — 2024-05-15
- 1.0.2 — 2022-02-07
- 1.0.1 — 2021-04-01
- 1.0.0 — 2020-08-04

## README

# ChromeOS WebDriver Server

A [WebDriver][] server for ChromeOS, implementing the subset of the WebDriver
protocol necessary for [Karma][].  Add ChromeOS to your [Selenium grid][]!

Part of the [Generic WebDriver Server][] family.


## Installation

```sh
npm install --save-dev generic-webdriver-server chromeos-webdriver-server
```


## Usage

First, please refer to the ["Setup" doc][] for [Generic WebDriver Server][].
That will explain how to set up Selenium to talk to Generic WebDriver Servers,
as well as how to set server parameters.

In the command-line for the Selenium node, set the following Java system
properties:

 - `genericwebdriver.browser.name`: We recommend the value "chromeos".  See
   also notes in the ["Setup" doc][].
 - `genericwebdriver.backend.exe`: The path to the executable, such as
   `node_modules/chromeos-webdriver-server/chromeos-webdriver-server.js`
 - `genericwebdriver.backend.params.hostname`: The hostname or IP address of the
   ChromeOS device, with optional SSH port number.  If omitted, this **must** be
   provided in the client's desired capabilities instead.  (See below.)


## Supported parameters

This backend supports the following parameters:

 - `hostname`: **(required)** The hostname or IP address of the ChromeOS
   device, with optional SSH port number.
 - `username`: The username to use when logging in via SSH (defaults to `root`).
 - `private-key`: The path to the private key to use when logging in via SSH
   (defaults to `~/.ssh/chromeos_testing_rsa`).
 - `fetch-private-key`: If true, fetch the SSH private key if it doesn't exist
   at the path specified by `private-key` (defaults to true).
 - `private-key-url`: The URL from which to fetch a base64-encoded private key
   (defaults to the source code URL of the private key used by default in all
   dev-mode ChromeOS devices).


## Sending command-line arguments to Chrome

In addition to the parameters above, this server supports passing on extra
command line arguments to Chrome.  On the server command line, these are placed
at the end of the command and are separated from server parameters by "--".

These Chrome arguments can be set in the client's desired capabilities under
`generic:args`.  For example:

```py
caps = {
  'browserName': 'chromeos',
  'version': 'Pixelbook',
  'generic:args': [
    # Appended to the server command after "--", then passed on to the Chrome
    # instance instead of being handled by the server.
    '--autoplay-policy=no-user-gesture-required',
  ],
}
```

See also related notes in the ["Setup" doc][].


## Device setup

See [device-setup.md](https://github.com/shaka-project/generic-webdriver-server/blob/main/backends/chromeos/device-setup.md)
for details on setting up a ChromeOS device in dev mode and enabling SSH access.


## How it works

See [how-it-works.md](https://github.com/shaka-project/generic-webdriver-server/blob/main/backends/chromeos/how-it-works.md)
for details.


## Tunneling to a ChromeOS device on another network

See [tunneling.md](https://github.com/shaka-project/generic-webdriver-server/blob/main/backends/chromeos/tunneling.md)
for details.


## Using the CLI

In addition to running a ChromeOS node in Selenium, this package offers a CLI
for directing a ChromeOS device to a specific URL.  For example, if installed
globally with `npm install -g chromeos-webdriver-server`:

```sh
chromeos-webdriver-cli --hostname=192.168.1.42 --url=https://www.google.com/
```


[Generic WebDriver Server]: https://github.com/shaka-project/generic-webdriver-server
[Karma]: https://karma-runner.github.io/
[Selenium grid]: https://www.selenium.dev/documentation/en/grid/
["Setup" doc]: https://github.com/shaka-project/generic-webdriver-server/blob/main/setup.md
[WebDriver]: https://www.w3.org/TR/webdriver2/

---
_Source: https://npm.io/package/chromeos-webdriver-server · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
