# browsermob

> Fine-grained HAR file creation and inspection in Selenium tests.

Latest version **0.0.2** (published 2015-04-23) · Apache License, Version 2.0 license · 0 weekly downloads

## Install

```sh
npm install browsermob
pnpm add browsermob
yarn add browsermob
bun add browsermob
```

Provides the command `browsermob-manager`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2015-04-23 |
| First published | 2015-04-23 |
| Weekly downloads | 0 |
| License | Apache License, Version 2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+14 in 3 direct dependencies) |
| Install scripts | no |
| Author | Andrew Yurisich |
| Maintainers | encore-ui |
| Keywords | testing, har, performance, performance-testing, selenium |

## Links

- npm: https://www.npmjs.com/package/browsermob
- npm.io page: https://npm.io/package/browsermob

## Dependencies (6)

- [lodash](https://npm.io/package/lodash.md) ^3.7.0
- [adm-zip](https://npm.io/package/adm-zip.md) ^0.4.7
- [request](https://npm.io/package/request.md) ^2.55.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^0.18.2
- [minimist](https://npm.io/package/minimist.md) ^1.1.1
- [restler-q](https://npm.io/package/restler-q.md) ^0.1.1

## Alternatives

- [d3-force-3d](https://npm.io/package/d3-force-3d.md) — 1.0M weekly downloads
- [ng2-charts](https://npm.io/package/ng2-charts.md) — 486.8K weekly downloads
- [@arcgis/core](https://npm.io/package/@arcgis/core.md) — 257.8K weekly downloads
- [react-sparklines](https://npm.io/package/react-sparklines.md) — 249.3K weekly downloads
- [react-native-gifted-charts](https://npm.io/package/react-native-gifted-charts.md) — 182.3K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2015-04-23

## README

# browsermob

Create a HAR file with incremental "pages" in your Selenium tests.

https://github.com/lightbody/browsermob-proxy#rest-api

Command Line

```
npm install --save-dev browsermob
./node_modules/.bin/browsermob-manager update
./node_modules/.bin/browsermob-manager start # optional --port PORT, defaults to 9090
```

API

```js
var browsermob = require('browsermob');

// attempting to call `.start()` without a live server running will throw an exception
proxy = browsermob.proxy({
    address: 'http://localhost:8080',
    harSessionStartingPort: 8081
});

session = proxy.start(PORT_NUMBER); // POST call to ADDRESS:PORT/proxy/PORT_NUMBER
session.port // will match PORT_NUMBER
proxy.sessions.then(function (ports) {
    console.log(ports); // [8081]
});
session.record(HARFILE_NAME); // PUT request /proxy/PORT_NUMBER/har/, starts a HAR file recording session
session.next(NEW_HARFILE_NAME); // PUT request /proxy/PORT_NUMBER/har/pageRef
var harfile = session.record(); // PUT request /proxy/PORT_NUMBER/har, returns a HAR file, and begins a new one
// run your (Selenium) tests through the proxy
var harfile = session.stop(); // GET request /proxy/PORT_NUMBER/har, then DELETE request /proxy/PORT_NUMBER
var grade = harfile.grade; // run a yslow report, and get the overall score (0 - 100)
```

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