Gathering detailed insights and metrics for @rpai/webdriver
Gathering detailed insights and metrics for @rpai/webdriver
Gathering detailed insights and metrics for @rpai/webdriver
Gathering detailed insights and metrics for @rpai/webdriver
@rpai/webdriverio
Next-gen browser and mobile automation test framework for Node.js
@rpai/wdio-logger
A helper utility for logging of WebdriverIO packages
@rpai/wdio-utils
A WDIO helper utility to provide several utility functions used across the project.
@rpai/wdio-types
Utility package providing type information for a variety of WebdriverIO interfaces
npm install @rpai/webdriver
Typescript
Module System
Min. Node Version
Node Version
NPM Version
53.5
Supply Chain
88.8
Quality
76.7
Maintenance
100
Vulnerability
97.9
License
TypeScript (94.46%)
JavaScript (3.3%)
EJS (1.45%)
CSS (0.68%)
Gherkin (0.07%)
Dockerfile (0.03%)
Vue (0.01%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
394
Last Day
1
Last Week
5
Last Month
37
Last Year
394
MIT License
9,185 Stars
7,809 Commits
2,539 Forks
215 Watchers
30 Branches
621 Contributors
Updated on Feb 16, 2025
Latest Version
1.0.3
Package Id
@rpai/webdriver@1.0.3
Unpacked Size
347.11 kB
Size
65.50 kB
File Count
64
NPM Version
10.7.0
Node Version
20.15.0
Published on
Sep 27, 2024
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
-16.7%
5
Compared to previous week
Last Month
85%
37
Compared to previous month
Last Year
0%
394
Compared to previous year
A lightweight, non-opinionated implementation of the WebDriver and WebDriver BiDi specification including mobile commands supported by Appium
There are tons 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 and doesn't come with any extra or higher-level abstraction. It is lightweight and comes with support for the WebDriver specification and Appium's Mobile JSONWire Protocol.
The package supports the following protocols:
Commands 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
package. All commands come with TypeScript support.
To install this package from NPM run:
1npm i webdriver
The following example demonstrates a simple Google Search scenario:
1import WebDriver from 'webdriver';
2
3const client = await WebDriver.newSession({
4 path: '/',
5 capabilities: { browserName: 'firefox' }
6})
7
8await client.navigateTo('https://www.google.com/ncr')
9
10const searchInput = await client.findElement('css selector', '#lst-ib')
11await client.elementSendKeys(searchInput['element-6066-11e4-a52e-4f735466cecf'], 'WebDriver')
12
13const searchBtn = await client.findElement('css selector', 'input[value="Google Search"]')
14await client.elementClick(searchBtn['element-6066-11e4-a52e-4f735466cecf'])
15
16console.log(await client.getTitle()) // outputs "WebDriver - Google Search"
17
18await client.deleteSession()
To 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:
1import WebDriver from 'webdriver' 2 3const browser = await WebDriver.newSession({ 4 capabilities: { 5 webSocketUrl: true, 6 browserName: 'firefox' 7 } 8}) 9 10await browser.sessionSubscribe({ events: ['log.entryAdded'] }) 11 12/** 13 * returns: {"type":"console","method":"log","realm":null,"args":[{"type":"string","value":"Hello Bidi"}],"level":"info","text":"Hello Bidi","timestamp":1657282076037} 14 */ 15browser.on('log.entryAdded', (entryAdded) => console.log('received %s', entryAdded)) 16 17await browser.executeScript('console.log("Hello Bidi")', []) 18await browser.deleteSession()
To create a WebDriver session call the newSession
method on the WebDriver
class and pass in your configurations:
1import WebDriver from 'webdriver' 2const client = await WebDriver.newSession(options)
The following options are available:
Defines the capabilities you want to run in your Selenium session.
Type: Object
Required: true
Level of logging verbosity.
Type: String
Default: info
Options: trace | debug | info | warn | error | silent
Protocol to use when communicating with the Selenium standalone server (or driver).
Type: String
Default: http
Options: http | https
Host of your WebDriver server.
Type: String
Default: 0.0.0.0
Port your WebDriver server is on.
Type: Number
Default: undefined
Path to WebDriver endpoint or grid server.
Type: String
Default: /
Query parameters that are propagated to the driver server.
Type: Object
Default: undefined
Timeout for any WebDriver request to a driver or grid.
Type: Number
Default: 120000
Count of request retries to the Selenium server.
Type: Number
Default: 3
Allows you to use a custom http
/https
/http2
agent to make requests.
Type: Object
Default:
1{ 2 http: new http.Agent({ keepAlive: true }), 3 https: new https.Agent({ keepAlive: true }) 4}
Function intercepting HTTP request options before a WebDriver request is made
Type: (RequestOptions) => RequestOptions
Default: none
Function intercepting HTTP response objects after a WebDriver response has arrived
Type: (Response, RequestOptions) => Response
Default: none
No vulnerabilities found.
Reason
security policy file detected
Details
Reason
30 commit(s) and 16 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
badge detected: Passing
Reason
Found 6/25 approved changesets -- score normalized to 2
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
21 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-02-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More