Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
webdriver-js-extender
Advanced tools
A plugin which adds additional commands to selenium's javascript implementation of the webdriver client side API
The webdriver-js-extender package is a utility that extends the capabilities of the WebDriverJS (Selenium WebDriver for JavaScript) by allowing users to execute custom commands and interact with the browser in ways that are not directly supported by the standard WebDriver API.
Executing Custom Commands
This feature allows users to execute custom commands that are not part of the standard WebDriver API. In this example, a custom GET command is executed to retrieve the current URL of the browser session.
const { WebDriverExtender } = require('webdriver-js-extender');
const { Builder } = require('selenium-webdriver');
(async function example() {
let driver = new Builder().forBrowser('chrome').build();
driver = WebDriverExtender.extend(driver);
await driver.get('http://www.example.com');
const result = await driver.executeCustomCommand({
cmd: 'GET',
path: '/session/:sessionId/url',
data: {}
});
console.log(result);
await driver.quit();
})();
Interacting with Browser Extensions
This feature allows users to interact with browser extensions. In this example, the code retrieves and logs the list of installed browser extensions.
const { WebDriverExtender } = require('webdriver-js-extender');
const { Builder } = require('selenium-webdriver');
(async function example() {
let driver = new Builder().forBrowser('chrome').build();
driver = WebDriverExtender.extend(driver);
await driver.get('http://www.example.com');
const extensions = await driver.getInstalledExtensions();
console.log(extensions);
await driver.quit();
})();
The selenium-webdriver package is the official JavaScript implementation of the WebDriver API. It provides a comprehensive set of functions to control web browsers. While it does not support custom commands out of the box, it is widely used and well-documented.
WebdriverIO is a popular WebDriver binding for Node.js. It provides a rich set of features and plugins, including support for custom commands, making it a powerful alternative to webdriver-js-extender. WebdriverIO also has an active community and extensive documentation.
Nightwatch.js is an end-to-end testing framework that uses the WebDriver API. It includes built-in support for custom commands and assertions, making it a versatile tool for browser automation and testing. Nightwatch.js is known for its simplicity and ease of use.
This tools extends Selenium's javascript implementation of the WebDriver API to include additional commands (e.g. commands required for appium).
You can view the full list of commands in lib/index.ts
.
Use WebDriver JS Extender's extend
function on your webdriver instance:
var extendedWebdriver = require('webdriver-js-extender').extend(webdriver);
extendedWebdriver.setNetworkConnection(5);
FAQs
A plugin which adds additional commands to selenium's javascript implementation of the webdriver client side API
The npm package webdriver-js-extender receives a total of 436,269 weekly downloads. As such, webdriver-js-extender popularity was classified as popular.
We found that webdriver-js-extender demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.