{"_id":"webdriver@10.1.0","bugs":{"url":"https://github.com/webdriverio/webdriverio/issues"},"dist":{"shasum":"74c2f11b777d0285e3c5292a70c3032b212c8575","tarball":"http://registry-npm.ywwl.com/webdriver/download/webdriver-10.1.0.tgz","fileCount":59,"integrity":"sha512-W3lNUfcjsD5T62U7HackcsfKefrBoUect9PkyObhuByjPFjR+JwmkWAjbFYHlATpZwFZN5d5h28VBanG4BUe4g==","signatures":[{"sig":"MEUCIDz+kIzD6DPQqFa979Jx9nSCMa8OyUGdkf8ou41oy/7qAiEA8RD85TKv/NYaYHv9H6qUHuQVsRSwrd9qhSrporE2j+0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIE3uAZXS+D4uaTaLRGr0UFfpjgPgQMoftByiogo5DO9MAiEAxWk3MhpHuKLEkb60ZDqKS2VTa2K9nW2zdx+O4vhbwMY="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/webdriver@10.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":458710,"size":87986,"noattachment":false,"key":"/webdriver/-/webdriver-10.1.0.tgz"},"main":"./build/index.cjs","name":"webdriver","type":"module","types":"./build/index.d.ts","author":{"name":"Christian Bromann","email":"mail@bromann.dev"},"module":"./build/index.js","engines":{"node":">=22.19.0"},"exports":{".":{"types":"./build/index.d.ts","import":"./build/node.js","browser":"./build/index.js","require":"./build/index.cjs","importSource":"./src/node.ts","browserSource":"./src/browser.js","requireSource":"./src/index.cts"}},"gitHead":"f9e88c9fd7b1665f4e85400d8970c53ec02631bb","license":"MIT","version":"10.1.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"845b4805-83df-4ae2-b4d2-1fb5b3d5380e"}},"homepage":"https://github.com/webdriverio/webdriverio/tree/main/packages/webdriver","keywords":["webdriver"],"repository":{"url":"git+https://github.com/webdriverio/webdriverio.git","type":"git","directory":"packages/webdriver"},"_npmVersion":"lerna/10.1.1/node@v24.21.0+x64 (linux)","description":"A Node.js bindings implementation for the W3C WebDriver and WebDriver Bidi protocols","directories":{},"maintainers":[{"name":"christian-bromann","email":"mail@bromann.dev"},{"name":"wdio-user","email":"bot@webdriver.io"},{"name":"wswebcreation-nl","email":"wim@wswebcreation.nl"}],"_nodeVersion":"24.21.0","dependencies":{"ws":"^8.21.0","undici":"^8.11.2","@types/ws":"^8.5.3","@types/node":"^22.20.4","@wdio/types":"10.1.0","@wdio/utils":"10.1.0","@wdio/config":"10.1.0","@wdio/logger":"10.1.0","deepmerge-ts":"^8.0.0","@wdio/protocols":"10.0.2","https-proxy-agent":"^9.1.0"},"_hasShrinkwrap":false,"typeScriptVersion":"6.0.3","_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/webdriver_10.1.0_1792358241366_0.4624129469987206"},"readme":"WebDriver\n=========\n\n> A lightweight, non-opinionated implementation of the [WebDriver](https://w3c.github.io/webdriver/webdriver-spec.html) and [WebDriver BiDi](https://w3c.github.io/webdriver-bidi/) specification including mobile commands supported by [Appium](http://appium.io/)\n\nThere are [tons](https://github.com/christian-bromann/awesome-selenium#javascript) 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](https://w3c.github.io/webdriver/webdriver-spec.html) and doesn't come with any extra or higher-level abstraction. It is lightweight and comes with support for the [WebDriver specification](https://w3c.github.io/webdriver/webdriver-spec.html) and [Appium](https://appium.io/).\n\nThe package supports the following protocols:\n\n- [WebDriver](https://w3c.github.io/webdriver/)\n- [WebDriver Bidi](https://w3c.github.io/webdriver-bidi/)\n- [Appium](http://appium.io/)\n- [Chromium](http://chromedriver.chromium.org/) (additional Chromedriver specific commands)\n- [Selenium](https://www.selenium.dev/) (additional Selenium WebDriver specific commands)\n- [Sauce Labs](https://saucelabs.com/) (Sauce Labs specific WebDriver extensions)\n\nCommands 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`](https://www.npmjs.com/package/@wdio/protocols) package. All commands come with TypeScript support.\n\n## Install\n\nTo install this package from NPM run:\n\n```sh\nnpm i webdriver\n```\n\n## WebDriver Example\n\nThe following example demonstrates a simple Google Search scenario:\n\n```js\nimport WebDriver from 'webdriver';\n\nconst client = await WebDriver.newSession({\n    path: '/',\n    capabilities: { browserName: 'firefox' }\n})\n\nawait client.navigateTo('https://www.google.com/ncr')\n\nconst searchInput = await client.findElement('css selector', '#lst-ib')\nawait client.elementSendKeys(searchInput['element-6066-11e4-a52e-4f735466cecf'], 'WebDriver')\n\nconst searchBtn = await client.findElement('css selector', 'input[value=\"Google Search\"]')\nawait client.elementClick(searchBtn['element-6066-11e4-a52e-4f735466cecf'])\n\nconsole.log(await client.getTitle()) // outputs \"WebDriver - Google Search\"\n\nawait client.deleteSession()\n```\n\n## WebDriver Bidi Example\n\nTo 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:\n\n```js\nimport WebDriver from 'webdriver'\n\nconst browser = await WebDriver.newSession({\n    capabilities: {\n        webSocketUrl: true,\n        browserName: 'firefox'\n    }\n})\n\nawait browser.sessionSubscribe({ events: ['log.entryAdded'] })\n\n/**\n * returns: {\"type\":\"console\",\"method\":\"log\",\"realm\":null,\"args\":[{\"type\":\"string\",\"value\":\"Hello Bidi\"}],\"level\":\"info\",\"text\":\"Hello Bidi\",\"timestamp\":1657282076037}\n */\nbrowser.on('log.entryAdded', (entryAdded) => console.log('received %s', entryAdded))\n\nawait browser.executeScript('console.log(\"Hello Bidi\")', [])\nawait browser.deleteSession()\n```\n\n# Configuration\n\nTo create a WebDriver session call the `newSession` method on the `WebDriver` class and pass in your configurations:\n\n```js\nimport WebDriver from 'webdriver'\nconst client = await WebDriver.newSession(options)\n```\n\nThe following options are available:\n\n### capabilities\n\n<Option type=\"Object\">\n\nDefines the [capabilities](https://w3c.github.io/webdriver/webdriver-spec.html#capabilities) you want to run in your WebDriver session. Note: by default, it will automatically set the `webSocketUrl` to establish a [WebDriver Bidi](https://w3c.github.io/webdriver-bidi/) session, if you don't want this, make sure to set `'wdio:enforceWebDriverClassic': true` in your capabilities.\n\n</Option>\nRequired: `true`\n\n### logLevel\n\n<Option type=\"String\" default=\"info\" values=\"trace | debug | info | warn | error | silent\">\n\nLevel of logging verbosity.\n\n</Option>\n\n### protocol\n\n<Option type=\"String\" default=\"http\" values=\"http | https\">\n\nProtocol to use when communicating with the Selenium standalone server (or driver).\n\n</Option>\n\n### hostname\n\n<Option type=\"String\" default=\"localhost\">\n\nHost of your WebDriver server.\n\n</Option>\n\n### port\n\n<Option type=\"Number\" default=\"undefined\">\n\nPort your WebDriver server is on.\n\n</Option>\n\n### path\n\n<Option type=\"String\" default=\"/\">\n\nPath to WebDriver endpoint or grid server.\n\n</Option>\n\n### queryParams\n\n<Option type=\"Object\" default=\"undefined\">\n\nQuery parameters that are propagated to the driver server.\n\n</Option>\n\n### connectionRetryTimeout\n\n<Option type=\"Number\" default=\"120000\">\n\nTimeout for any WebDriver request to a driver or grid.\n\n</Option>\n\n### connectionRetryCount\n\n<Option type=\"Number\" default=\"3\">\n\nCount of request retries to the Selenium server.\n\n</Option>\n\n### bidiResponseTimeout\n\n<Option type=\"Number\" default=\"180000\">\n\nTimeout (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.\n\n</Option>\n\n### bidiConnectTimeout\n\n<Option type=\"Number\" default=\"10000\">\n\nTimeout (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.\n\nThis option applies to sessions in Node.js. In a browser, for example with the [browser runner](https://webdriver.io/docs/runner#browser-runner), the connection waits until it opens or fails.\n\n</Option>\n\n### agent\n\n<Option type=\"Object\" default={`{\n    http: new http.Agent({ keepAlive: true }),\n    https: new https.Agent({ keepAlive: true })\n}`}>\n\nAllows you to use a custom` http`/`https`/`http2` [agent](https://www.npmjs.com/package/got#agent) to make requests.\n\n</Option>\n\n### transformRequest\n\n<Option type=\"(RequestOptions) => RequestOptions\" default=\"none\">\n\nFunction intercepting [HTTP request options](https://github.com/sindresorhus/got#options) before a WebDriver request is made to a driver.\n\n</Option>\n\n### transformResponse\n\n<Option type=\"(Response, RequestOptions) => Response\" default=\"none\">\n\nFunction intercepting HTTP response objects after a WebDriver response has arrived.\n\n</Option>\n\n","publish_time":1792358241435,"_cnpm_publish_time":1792358241435,"dist-tags":{"alpha":"5.0.0-alpha.14","beta":"7.0.0-beta.4","latest":"10.2.0","latest-5":"5.23.0","next":"10.2.0-alpha.100.sha-b38abd894","v7":"7.40.0","v8":"8.46.0","v9":"9.33.1"}}