appium
Cross-platform automation framework for all kinds of apps, built on top of the W3C WebDriver protocol
Top Related Projects
A browser automation framework and ecosystem.
Windows Application Driver
Calabash for iOS
Automated Functional testing for Android using cucumber
A WebDriver server for iOS that runs inside the Simulator.
Selenium Hub successor running browsers within containers. Scalable, immutable, self hosted Selenium-Grid on any platform with single binary.
Quick Overview
Appium is an open-source automation tool for mobile app testing. It allows developers and QA engineers to automate native, hybrid, and web apps on iOS, Android, and Windows platforms using a single API. Appium supports multiple programming languages and integrates with popular testing frameworks.
Pros
- Cross-platform support for iOS, Android, and Windows
- Language-agnostic, supporting multiple programming languages (e.g., Java, Python, JavaScript)
- Uses standard automation APIs provided by vendors (UIAutomator/XCUITest), reducing the need for app modifications
- Integrates well with popular CI/CD tools and testing frameworks
Cons
- Setup and configuration can be complex, especially for beginners
- Performance can be slower compared to platform-specific tools
- Occasional stability issues, particularly with newer OS versions or device types
- Limited support for some advanced gestures or device-specific features
Code Examples
- Setting up an Android driver (Java):
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "emulator-5554");
capabilities.setCapability(MobileCapabilityType.APP, "/path/to/app.apk");
AndroidDriver<AndroidElement> driver = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
- Finding and clicking an element (Python):
from appium.webdriver.common.mobileby import MobileBy
element = driver.find_element(MobileBy.ACCESSIBILITY_ID, "Login Button")
element.click()
- Performing a swipe gesture (JavaScript):
const { WebDriver, TouchAction } = require('appium-webdriver');
const action = new TouchAction(driver);
action.press({x: 500, y: 1500})
.moveTo({x: 500, y: 200})
.release()
.perform();
Getting Started
-
Install Appium:
npm install -g appium
-
Install platform-specific dependencies (e.g., Xcode for iOS, Android SDK for Android)
-
Start Appium server:
appium
-
Create a test script using your preferred language and Appium client library
-
Run your test script against the Appium server
For detailed setup instructions and more examples, refer to the official Appium documentation: http://appium.io/docs/en/about-appium/getting-started/
Competitor Comparisons
A browser automation framework and ecosystem.
Pros of Selenium
- Wider browser support, including less common browsers
- More mature and established ecosystem with extensive documentation
- Better suited for web application testing across different browsers
Cons of Selenium
- Limited mobile testing capabilities, primarily focused on web browsers
- Steeper learning curve, especially for complex scenarios
- Slower test execution compared to Appium for mobile testing
Code Comparison
Selenium (Java):
WebDriver driver = new ChromeDriver();
driver.get("https://www.example.com");
WebElement element = driver.findElement(By.id("search"));
element.sendKeys("test");
element.submit();
Appium (Java):
AndroidDriver<AndroidElement> driver = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
driver.findElementById("com.example.app:id/search").click();
driver.findElementById("com.example.app:id/search_input").sendKeys("test");
driver.pressKeyCode(AndroidKeyCode.ENTER);
Both Selenium and Appium are popular automation testing frameworks, but they serve different purposes. Selenium is primarily designed for web browser automation, while Appium focuses on mobile app testing. Selenium offers broader browser support and a more established ecosystem, making it ideal for web application testing across various browsers. However, Appium excels in mobile testing, supporting both Android and iOS platforms, and provides a more unified approach to mobile automation. The code examples demonstrate the syntax differences between the two frameworks, with Selenium using web-specific locators and Appium utilizing mobile app identifiers.
Windows Application Driver
Pros of WinAppDriver
- Specifically designed for Windows applications, offering better native support
- Simpler setup and configuration for Windows-only testing environments
- Tighter integration with Windows-specific technologies and frameworks
Cons of WinAppDriver
- Limited to Windows platform, lacking cross-platform capabilities
- Smaller community and ecosystem compared to Appium
- Less frequent updates and potentially slower bug fixes
Code Comparison
WinAppDriver:
var desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.SetCapability("app", "Microsoft.WindowsCalculator_8wekyb3d8bbwe!App");
var session = new WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723"), desiredCapabilities);
Appium:
desired_caps = {
'platformName': 'Windows',
'app': 'Microsoft.WindowsCalculator_8wekyb3d8bbwe!App'
}
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
Both examples demonstrate setting up a session for testing the Windows Calculator app. WinAppDriver uses C# and is more Windows-specific, while Appium's Python example showcases its cross-platform nature and flexibility in language choice.
Calabash for iOS
Pros of Calabash-iOS
- Specifically designed for iOS, offering deep integration with iOS-specific features
- Uses Cucumber for behavior-driven development, allowing for more readable test scenarios
- Supports testing on physical iOS devices without additional setup
Cons of Calabash-iOS
- Limited to iOS platform, unlike Appium's cross-platform capabilities
- Less active community and development compared to Appium
- Steeper learning curve for those unfamiliar with Ruby and Cucumber
Code Comparison
Calabash-iOS (Ruby):
Given /^I am on the Welcome Screen$/ do
element_exists("label marked:'Welcome'")
end
When /^I touch the "Login" button$/ do
touch("button marked:'Login'")
end
Appium (JavaScript):
await driver.waitForElementByAccessibilityId('Welcome');
await driver.elementByAccessibilityId('Login').click();
Both frameworks allow for element interaction and verification, but Calabash-iOS uses a more descriptive, Cucumber-style syntax, while Appium utilizes a more traditional programming approach. Appium's code is generally more concise and familiar to developers used to standard programming languages.
Automated Functional testing for Android using cucumber
Pros of Calabash
- Specifically designed for Android, offering deep integration with the platform
- Uses Cucumber for behavior-driven development (BDD), allowing for more readable test scenarios
- Simpler setup process for Android-only projects
Cons of Calabash
- Limited to Android platform, lacking cross-platform support
- Less active community and development compared to Appium
- Requires knowledge of Ruby for test scripting
Code Comparison
Calabash (Ruby):
Given /^I press the "([^\"]*)" button$/ do |button_text|
touch("button text:'#{button_text}'")
end
Appium (JavaScript):
await driver.findElement(By.xpath(`//android.widget.Button[@text='${buttonText}']`)).click();
Calabash is an open-source automation testing framework specifically for Android applications. It uses Cucumber for writing test scenarios in a natural language format, which can be beneficial for collaboration between developers and non-technical team members.
Appium, on the other hand, is a cross-platform mobile automation tool that supports both Android and iOS. It offers more flexibility in terms of programming languages and has a larger, more active community. Appium uses standard WebDriver protocol, making it easier for those familiar with Selenium to transition to mobile testing.
While Calabash provides a more streamlined experience for Android-only projects, Appium's versatility and broader support make it a more popular choice for teams working on multiple platforms or looking for long-term maintainability.
A WebDriver server for iOS that runs inside the Simulator.
Pros of WebDriverAgent
- Lightweight and focused specifically on iOS automation
- Direct integration with XCTest framework for native iOS testing
- Faster execution for iOS-specific tests due to its specialized nature
Cons of WebDriverAgent
- Limited to iOS platform, lacking cross-platform support
- Requires more setup and configuration compared to Appium's all-in-one solution
- Less extensive community support and fewer available resources
Code Comparison
WebDriverAgent (Objective-C):
- (XCUIElement *)findElementByXPath:(NSString *)xpath
{
return [[self class] throwException:FBElementNotFoundException format:@"Invalid xpath: %@", xpath];
}
Appium (JavaScript):
findElementByXPath(xpath) {
return this.findElOrEls('xpath', xpath, false);
}
WebDriverAgent focuses on iOS-specific implementation using Objective-C, while Appium provides a more generic JavaScript approach for cross-platform support. WebDriverAgent's code is more tightly integrated with iOS frameworks, potentially offering better performance for iOS-specific tasks. Appium's code is more abstracted, allowing for greater flexibility across different platforms but potentially sacrificing some platform-specific optimizations.
Selenium Hub successor running browsers within containers. Scalable, immutable, self hosted Selenium-Grid on any platform with single binary.
Pros of Selenoid
- Faster test execution due to lightweight Docker containers
- Built-in video recording and live streaming of test sessions
- Easier scalability and parallel test execution
Cons of Selenoid
- Limited to web browser automation (no mobile support)
- Steeper learning curve for teams new to Docker
- Less extensive documentation compared to Appium
Code Comparison
Appium (JavaScript):
const driver = await wdio.remote({
capabilities: {
platformName: 'Android',
automationName: 'UiAutomator2',
deviceName: 'emulator-5554',
app: '/path/to/app.apk'
}
});
Selenoid (Python):
capabilities = {
"browserName": "chrome",
"enableVNC": True,
"enableVideo": True
}
driver = webdriver.Remote(
command_executor="http://localhost:4444/wd/hub",
desired_capabilities=capabilities
)
Both Appium and Selenoid are powerful tools for automated testing, but they serve different purposes. Appium excels in mobile app testing across platforms, while Selenoid focuses on efficient web browser testing using Docker containers. The choice between them depends on the specific testing requirements and infrastructure preferences of the development team.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Cross-platform test automation for native, hybrid, mobile web and desktop apps.
Documentation | Get Started | Ecosystem | Changelog | Contributing Guide | Discussion Forum
Appium is an open-source automation framework that provides WebDriver-based automation possibilities for a wide range of different mobile, desktop and IoT platforms. Appium is modular and extensible, and supports multiple programming languages, which means there is an entire ecosystem of related software:
- Drivers add support for automating specific platforms
- Clients allow writing Appium tests in your programming language of choice
- Plugins allow to further extend Appium functionality
Migrating From Appium 1 to Appium 2
As of January 1st, 2022, the Appium team no longer maintains or supports Appium 1. All officially supported platform drivers are only compatible with Appium 2.
Please read the Migration Guide if you are still using Appium 1.
[!WARNING] If you use Appium Desktop or Appium Server GUI, you will not be able to upgrade to Appium 2, as both of these tools have been deprecated. Please use Appium Inspector in combination with a standalone Appium 2 server.
Installation
Appium can be installed using npm
(other package managers are not currently supported). Please
check the installation docs for the
system requirements and further information.
If upgrading from Appium 1, make sure Appium 1 is fully uninstalled (npm uninstall -g appium
).
Unexpected errors might appear if this has not been done.
npm i -g appium
Note that this will only install the core Appium server, which cannot automate anything on its own. Please install drivers for your target platforms in order to automate them.
Drivers
Appium supports app automation across a variety of platforms, like iOS, Android, macOS, Windows, and more. Each platform is supported by one or more "drivers", which know how to automate that particular platform. You can find a full list of officially-supported and third-party drivers in Appium Ecosystem's Drivers page.
Driver management is done using Appium's Extension command-line interface:
# Install an official driver from npm (see documentation for a list of such drivers)
appium driver install <driver-name>
# Install any driver from npm
appium driver install --source=npm <driver-name>
# See documentation for installation from other sources
# List already installed drivers
appium driver list --installed
# Update a driver (it must be already installed)
# This will NOT update the major version, in order to prevent breaking changes
appium driver update <driver-name>
# Update a driver to the most recent version (may include breaking changes)
appium driver update <driver-name> --unsafe
# Uninstall a driver (it won't last forever, will it?)
appium driver uninstall <driver-name>
Clients
Client libraries enable writing Appium tests in different programming languages. There are officially-supported clients for Java, Python, Ruby, and .NET C#, as well as third-party clients for other languages. You can find a full list of clients in Appium Ecosystem's Clients page.
Plugins
Plugins allow you to extend server functionality without changing the server code. The main difference between drivers and plugins is that the latter must be explicitly enabled on Appium server startup (all installed drivers are enabled by default):
appium --use-plugins=<plugin-name>
You can find a full list of officially-supported and third-party plugins in Appium Ecosystem's Plugins page.
Similarly to drivers, plugin management is also done using Appium's Extension command-line interface:
# Install an official plugin from npm (see documentation for a list of such plugins)
appium plugin install <plugin-name>
# Install any plugin from npm
appium plugin install --source=npm <plugin-name>
# See documentation for installation from other sources
# List already installed plugins
appium plugin list --installed
# Update a plugin (it must be already installed)
# This will NOT update the major version, in order to prevent breaking changes
appium plugin update <plugin-name>
# Update a plugin to the most recent version (may include breaking changes)
appium plugin update <plugin-name> --unsafe
# Uninstall a plugin
appium plugin uninstall <plugin-name>
Server Command Line Interface
In order to start sending commands to the Appium server, it must be running on the URL and port where your client library expects it to listen. Appium's command-line interface is used to launch and configure the server:
# Start the server on the default host (0.0.0.0) and port (4723)
appium server
# You can also omit the 'server' subcommand
appium
# Start the server on the given host, port and use a custom base path prefix (the default prefix is '/')
appium --address 127.0.0.1 --port 9000 --base-path /wd/hub
Appium supports execution of parallel server processes, as well as parallel driver sessions within a single server process. Refer the corresponding driver documentations regarding which mode is optimal for the particular driver or whether it supports parallel sessions.
Why Appium?
- You usually don't have to recompile your app or modify it in any way, due to the use of standard automation APIs on all platforms.
- You can write tests with your favorite dev tools using any WebDriver-compatible language such as Java, Python, Ruby and C#. There are also third party client implementations for other languages.
- You can use any testing framework.
- Some drivers like
xcuitest
anduiautomator2
have built-in mobile web and hybrid app support. Within the same script, you can switch seamlessly between native app automation and webview automation, all using the WebDriver model that's already the standard for web automation. - You can run your automated tests locally and in a cloud. There are multiple cloud providers that support various Appium drivers (mostly targeting iOS and Android mobile automation).
- Appium Inspector can be used to visually inspect the page source of applications across different platforms, facilitating easier test development.
Investing in the WebDriver protocol means you are betting on a single, free, and open protocol for testing that has become a web standard. Don't lock yourself into a proprietary stack.
For example, if you use Apple's XCUITest library without Appium, you can only write tests using Obj-C/Swift, and you can only run tests through Xcode. Similarly, with Google's UiAutomator or Espresso, you can only write tests in Java/Kotlin. Appium opens up the possibility of true cross-platform native app automation, for mobile and beyond!
If you are looking for a more comprehensive description of what this is all about, please read our documentation on How Does Appium Work?.
Sponsors
Appium has a Sponsorship Program! If you or your company uses Appium and wants to give back financially to the project, we use these funds to encourage development and contributions, as well as support other open source projects we rely on. Become a sponsor via our OpenCollective page.
Development and Strategic Partners
Appium is incredibly grateful to our Development and Strategic Partners for their sustained contribution of project development and leadership!
Other Sponsors
A full list of sponsors is available at our Sponsors page.
License
@appium/logger
package is under ISC License.
Top Related Projects
A browser automation framework and ecosystem.
Windows Application Driver
Calabash for iOS
Automated Functional testing for Android using cucumber
A WebDriver server for iOS that runs inside the Simulator.
Selenium Hub successor running browsers within containers. Scalable, immutable, self hosted Selenium-Grid on any platform with single binary.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot