# @wdio/globals

> A helper utility for importing global variables directly

Latest version **9.31.3** (published 2026-08-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @wdio/globals
pnpm add @wdio/globals
yarn add @wdio/globals
bun add @wdio/globals
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 9.31.3 |
| Published | 2026-08-25 |
| First published | 2022-08-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18.20.0 |
| Dependencies | 0 |
| Unpacked size | 14.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 9838 |
| Author | Christian Bromann |
| Maintainers | christian-bromann, wdio-user, wswebcreation-nl |
| Keywords | webdriver, wdio, wdio-utility |

## Links

- npm: https://www.npmjs.com/package/@wdio/globals
- Repository: https://github.com/webdriverio/webdriverio
- Homepage: https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-globals
- Issues: https://github.com/webdriverio/webdriverio/issues
- npm.io page: https://npm.io/package/@wdio/globals

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 9.31.3 (latest) — 2026-08-25
- 9.32.0-alpha.14 (next) — 2026-09-13
- 8.46.0 (v8) — 2025-08-11
- 9.0.0-alpha.0 (v9) — 2024-03-12
- 9.32.0-alpha.13 — 2026-09-13
- 9.32.0-alpha.6 — 2026-09-13
- 9.32.0-alpha.0 — 2026-09-13
- 9.32.0-alpha.3 — 2026-09-13
- 9.31.1 — 2026-08-18
- 9.31.0 — 2026-08-18
- 9.29.1 — 2026-06-26
- 9.29.0 — 2026-06-18
- 9.28.0 — 2026-06-10
- 9.27.2 — 2026-05-26
- 9.27.1 — 2026-04-30
- … 309 more at https://npm.io/package/@wdio/globals/versions

## README

WDIO Globals
============

> A helper utility for importing global variables directly

In your test files, WebdriverIO puts each of these methods and objects into the global environment. You don't have to import anything to use them. However, if you prefer explicit imports, you can do `import { browser, $, $$, expect } from '@wdio/globals'` and set `injectGlobals: false` in your WDIO configuration.

The following global objects are set if not configured otherwise:

- `browser`: WebdriverIO Browser object
- `driver`: alias to browser (used when running mobile tests)
- `multiRemoteBrowser`: alias to browser or driver but only set for Multiremote sessions
- `$`: command to fetch an element (see more in API docs)
- `$$`: command to fetch elements (see more in API docs)
- `expect`: assertion framework for WebdriverIO (see API docs)

Note: WebdriverIO has no control of used frameworks (e.g. Mocha or Jasmine) setting global variables when bootstrapping their environment.

## Install

To install the package, run:

```sh
npm i @wdio/globals --save-dev
```

## Usage

You can implicitly import WebdriverIO primitives as following:

```ts
import { browser, $, $$, expect } from '@wdio/globals'

describe('my test', () => {
    // ...

    it('can do something', async () => {
        // ...
    })

    // ...
})
```

## TypeScript

If you have a TypeScript project you can propagate the WebdriverIO namespace by adding this package to the `types` list, e.g.:

```json title="tsconfig.json"
{
    "compilerOptions": {
        "types": ["node", "@wdio/globals/types"]
    }
}
```

For more information on WebdriverIO Globals, check out the [docs](https://webdriver.io/docs/api/globals).

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