# @pageobject/standard-selenium

> This package implements the PageObjectJS standard API for Selenium.

Latest version **1.0.0-beta-4** (published 2018-02-10) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @pageobject/standard-selenium
pnpm add @pageobject/standard-selenium
yarn add @pageobject/standard-selenium
bun add @pageobject/standard-selenium
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.0-beta-4 |
| Published | 2018-02-10 |
| First published | 2018-01-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Clemens Akens |
| Maintainers | clebert |
| Keywords | javascript, node, web, test, testing, automation, end-to-end, e2e, pageobject, puppeteer, selenium, webdriver |

## Links

- npm: https://www.npmjs.com/package/@pageobject/standard-selenium
- Repository: https://github.com/clebert/pageobject
- Homepage: https://pageobject.js.org/
- Issues: https://github.com/clebert/pageobject/issues
- npm.io page: https://npm.io/package/@pageobject/standard-selenium

## Dependencies (1)

- [@pageobject/core](https://npm.io/package/@pageobject/core.md) ^1.0.0-beta-4

## 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.0-beta-4 (latest) — 2018-02-10
- 1.0.0-beta-3 — 2018-02-07
- 1.0.0-beta-2 — 2018-02-05
- 1.0.0-beta-1 — 2018-01-31
- 1.0.0-beta — 2018-01-31

## README

# @pageobject/standard-selenium [![Package Version][badge-npm-image]][badge-npm-link] [![Build Status][badge-travis-image]][badge-travis-link] [![Coverage Status][badge-coveralls-image]][badge-coveralls-link]

> This package implements the [PageObjectJS standard API][internal-readme-standard] for [Selenium][external-selenium].

## Installation

```sh
yarn add @pageobject/standard-selenium
```

### Peer dependencies

```sh
yarn add @pageobject/standard \
         selenium-webdriver
```

### TypeScript types

```sh
yarn add --dev @types/selenium-webdriver
```

## API

Please find the API documentation [here][internal-api-standard-selenium].

## Usage

In this example we load the website [`example.com`][external-example-website] and test if the actual page title corresponds to the expected page title.

The **complete code** of this example can be found in the file [`example.js`][internal-example-standard-selenium].

### Create a new Selenium WebDriver instance

```js
const driver = await new Builder()
  .withCapabilities({
    browserName: 'chrome',
    chromeOptions: {args: ['headless', 'disable-gpu']}
  })
  .build();
```

Please make sure you have the latest version of Chrome installed.

Additionally a suitable ChromeDriver is required, in this example we use [`node-chromedriver`][external-node-chromedriver] to install it.

```js
require('chromedriver');
```

### Load the website

```js
const page = await SeleniumPage.load('http://example.com/', driver);
```

### Create a page object

```js
class Root extends StandardPageObject {
  get selector() {
    return ':root';
  }
}

const root = new Root(page);
```

### Run the assertion using the page object

```js
assert.strictEqual(await root.getPageTitle(), 'Example Domain');
```

---

Built by (c) Clemens Akens. Released under the terms of the [MIT License][internal-license].

[badge-coveralls-image]: https://coveralls.io/repos/github/clebert/pageobject/badge.svg?branch=master
[badge-coveralls-link]: https://coveralls.io/github/clebert/pageobject?branch=master
[badge-npm-image]: https://img.shields.io/npm/v/@pageobject/standard-selenium.svg
[badge-npm-link]: https://yarnpkg.com/en/package/@pageobject/standard-selenium
[badge-travis-image]: https://travis-ci.org/clebert/pageobject.svg?branch=master
[badge-travis-link]: https://travis-ci.org/clebert/pageobject

[internal-api-standard-selenium]: https://pageobject.js.org/api/standard-selenium/
[internal-example-standard-selenium]: https://github.com/clebert/pageobject/blob/master/@pageobject/standard-selenium/example.js
[internal-license]: https://github.com/clebert/pageobject/blob/master/LICENSE
[internal-readme-standard]: https://github.com/clebert/pageobject/tree/master/@pageobject/standard/README.md

[external-example-website]: http://example.com/
[external-node-chromedriver]: https://github.com/giggio/node-chromedriver
[external-selenium]: http://seleniumhq.github.io/selenium/docs/api/javascript/index.html

---
_Source: https://npm.io/package/@pageobject/standard-selenium · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
