Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

appium

Package Overview
Dependencies
Maintainers
8
Versions
427
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

appium

Automation for Apps.

  • 2.11.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
183K
decreased by-37.24%
Maintainers
8
Weekly downloads
 
Created

What is appium?

Appium is an open-source tool for automating mobile, web, and hybrid applications on iOS, Android, and Windows platforms. It allows you to write tests using the WebDriver protocol and supports multiple programming languages such as Java, JavaScript, Python, and more.

What are appium's main functionalities?

Automate Mobile Applications

This code demonstrates how to automate an Android mobile application using Appium. It initializes a WebDriver client with the necessary capabilities and performs a click action on an element identified by its accessibility ID.

const wdio = require('webdriverio');
const opts = {
  port: 4723,
  capabilities: {
    platformName: 'Android',
    platformVersion: '9',
    deviceName: 'emulator-5554',
    app: '/path/to/the/app.apk',
    automationName: 'UiAutomator2'
  }
};
(async () => {
  const client = await wdio.remote(opts);
  await client.init();
  await client.elementByAccessibilityId('SomeElement').click();
  await client.quit();
})();

Automate Web Applications on Mobile Browsers

This code demonstrates how to automate a web application on a mobile browser using Appium. It initializes a WebDriver client with the necessary capabilities for a Chrome browser on an Android emulator, navigates to a URL, and retrieves the page title.

const wdio = require('webdriverio');
const opts = {
  port: 4723,
  capabilities: {
    platformName: 'Android',
    platformVersion: '9',
    deviceName: 'emulator-5554',
    browserName: 'Chrome',
    automationName: 'UiAutomator2'
  }
};
(async () => {
  const client = await wdio.remote(opts);
  await client.url('http://example.com');
  const title = await client.getTitle();
  console.log('Title:', title);
  await client.quit();
})();

Automate Hybrid Applications

This code demonstrates how to automate a hybrid application using Appium. It initializes a WebDriver client with the necessary capabilities for an iOS device, switches to the webview context, navigates to a URL, and retrieves the page title.

const wdio = require('webdriverio');
const opts = {
  port: 4723,
  capabilities: {
    platformName: 'iOS',
    platformVersion: '13.3',
    deviceName: 'iPhone 11',
    app: '/path/to/the/app.app',
    automationName: 'XCUITest'
  }
};
(async () => {
  const client = await wdio.remote(opts);
  await client.init();
  await client.context('WEBVIEW_1');
  await client.url('http://example.com');
  const title = await client.getTitle();
  console.log('Title:', title);
  await client.quit();
})();

Other packages similar to appium

Keywords

FAQs

Package last updated on 16 Sep 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc