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-uiautomator2-server
Advanced tools
The appium-uiautomator2-server npm package is a server component for the Appium automation framework that uses Google's UiAutomator2 library to automate Android applications. It allows for advanced interactions with Android devices, including finding elements, performing gestures, and executing commands.
Finding Elements
This feature allows you to find elements on the screen using various strategies such as accessibility id, class name, XPath, etc.
const { UiAutomator2Driver } = require('appium-uiautomator2-driver');
const driver = new UiAutomator2Driver();
await driver.findElement('accessibility id', 'myElementId');
Performing Gestures
This feature allows you to perform touch gestures like tap, swipe, and pinch on the device screen.
const { UiAutomator2Driver } = require('appium-uiautomator2-driver');
const driver = new UiAutomator2Driver();
await driver.performTouch([{ action: 'tap', options: { x: 100, y: 200 } }]);
Executing Commands
This feature allows you to execute shell commands on the Android device, providing a way to interact with the device at a lower level.
const { UiAutomator2Driver } = require('appium-uiautomator2-driver');
const driver = new UiAutomator2Driver();
await driver.execute('mobile: shell', { command: 'input text', args: ['Hello World'] });
WebdriverIO is a popular automation framework that supports multiple browser and mobile automation protocols, including Appium. It provides a high-level API for interacting with web and mobile applications, making it easier to write and maintain tests compared to using appium-uiautomator2-server directly.
Detox is an end-to-end testing library for mobile apps developed by Wix. It is designed to work with React Native applications and provides a high-level API for writing tests. Unlike appium-uiautomator2-server, Detox is specifically tailored for React Native and offers a more integrated experience for those applications.
A netty server that runs on the device listening for commands and executes using UiAutomator V2.
build the android project using below commands
gradle clean assembleServerDebug assembleServerDebugAndroidTest
push both src and test apks to the device and execute the instrumentation tests.
adb shell am instrument -w io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner
build the unitTest flavor using the below commands
gradle clean assembleE2ETestDebug assembleE2ETestDebugAndroidTest
unitTest flavor contains tests for handlers and can be invoked by using following command
gradle clean connectedE2ETestDebugAndroidTest
the above command takes care about installing the AUT apk in to the testing device/emulator before running the tests.
you can also invoke the test using below command
adb shell am instrument -w io.appium.uiautomator2.e2etest.test/androidx.test.runner.AndroidJUnitRunner
Note: AUT apk should be installed before executing above command.
FAQs
A netty server with uiautomator2 handlers
The npm package appium-uiautomator2-server receives a total of 246,647 weekly downloads. As such, appium-uiautomator2-server popularity was classified as popular.
We found that appium-uiautomator2-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.