Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@appium/base-driver
Advanced tools
@appium/base-driver is a foundational package for creating Appium drivers. It provides a base class and a set of utilities that can be extended to create custom drivers for different platforms and automation needs.
BaseDriver Class
The BaseDriver class provides the core functionality for creating and managing sessions. By extending this class, you can implement custom logic for session creation and deletion.
const { BaseDriver } = require('@appium/base-driver');
class CustomDriver extends BaseDriver {
async createSession(capabilities) {
// Custom session creation logic
return super.createSession(capabilities);
}
async deleteSession() {
// Custom session deletion logic
return super.deleteSession();
}
}
module.exports = CustomDriver;
Command Handling
Command handling allows you to define custom endpoints and their corresponding logic. This is useful for implementing specific commands that your driver needs to support.
const { BaseDriver } = require('@appium/base-driver');
class CustomDriver extends BaseDriver {
constructor(opts) {
super(opts);
this.handlers = {
'/session/:sessionId/element': this.findElement.bind(this),
// Add more command handlers here
};
}
async findElement(sessionId, params) {
// Custom element finding logic
return { ELEMENT: 'element-id' };
}
}
module.exports = CustomDriver;
Proxying Commands
Proxying commands allows your driver to forward requests to another server. This is useful for scenarios where your driver needs to interact with an existing WebDriver server.
const { BaseDriver } = require('@appium/base-driver');
class CustomDriver extends BaseDriver {
constructor(opts) {
super(opts);
this.proxyReqRes = true; // Enable proxying
}
async proxyCommand(url, method, body) {
// Custom proxy logic
return await this.jwproxy.command(url, method, body);
}
}
module.exports = CustomDriver;
WebdriverIO is a popular automation framework that provides a high-level API for interacting with WebDriver servers. Unlike @appium/base-driver, which is focused on creating custom drivers, WebdriverIO is designed for writing and running tests.
Selenium WebDriver is a widely-used library for browser automation. It provides a set of bindings for various programming languages to interact with WebDriver servers. While @appium/base-driver is focused on creating custom drivers, Selenium WebDriver is aimed at end-users writing automation scripts.
The 'wd' package is a Node.js client for WebDriver/Selenium. It provides a promise-based API for interacting with WebDriver servers. Unlike @appium/base-driver, which is for creating drivers, 'wd' is for writing automation scripts.
This is the parent class that all appium drivers inherit from, along with a collection of globally-used Appium driver utilities. Each utility is documented in its own README in the code:
FAQs
Base driver class for Appium drivers
The npm package @appium/base-driver receives a total of 234,289 weekly downloads. As such, @appium/base-driver popularity was classified as popular.
We found that @appium/base-driver demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.