June 23, 2022

Getting Started with Appium 2.0: Overview of the Core New Features

Industry News

The Appium community has released e a transformational version update after several years of maintaining and building the Appium 1.x versions. Appium 2.0 is a whole new technology that will allow test engineers to cover not only mobile applications, but also desktop apps, Flutter apps, and more. 

What is Appium 2.0? 

Appium is an open source test automation framework for use with native, hybrid and mobile web apps. It drives iOS, Android, and Windows apps using the WebDriver protocol. Appium 2.0 is the latest Appium release.

Let’s explore the core new features that are part of the Appium 2.0 release and then dive into how to get started with testing your mobile app with the new framework. 

Related Resources >> How to Test Network Virtualization With Perfecto and Appium

Appium 2.0 Core New Features 

Here are some of the exciting new features of Appium 2.0:

  • Drivers’ Independence – ability to install and work with de-coupled web drivers based on your application platform (iOS, Android, Windows OS, Flutter, etc.) 
    - Usage e.g.: “appium driver install xcuitest” 
  • Plugin Ecosystem – Ability to modify the Appium framework by adding new features via plugins and through integrations with other technologies. 
    - Usage e.g., “appium plugin install images”, then activate the plugin with your server via: 
    “appium --use-plugins=images” 
  • W3C Compatibility – Similarly to Selenium 4 being fully W3C compliant, with Appium 2.0 you should also ensure you’re sending W3C standard capabilities within your test code (see below e.g.). 
    “ {platformName” :”iOS”, 
       “appium:deviceName”: “iPhone 12”, 
       “appium.automationName”: “XCUITest”, 
        } 

To migrate your test code from Appium 1.x to Appium 2.x, please refer to this useful guide that walks through some potential breaking changes and other useful tips. 

The current Appium Desktop tool is still available but is now being released in two separate packages:  

Getting Started with Appium 2.0 

The first step to getting started with the new Appium 2.0 framework is to install it. 

Installing It can be done through the following node package install command: 

npm install -g appium@next 

After the installation, you would need to install the relevant driver/s for your app under test. Appium 2.0 decouples its supported WebDrivers, hence, you can choose which to install. You can install a single driver or multiple ones. 

As an example, to install the Android uiautomator2 driver, please run the following command from the Appium home directory:

appium driver install uiautomator2 

Assuming a successful installation of the Android driver, you should see the following prompt on your command line tool or IDE (e.g., VS Code).

Prompt on your command line

Running the Appium driver list command after the above installation would display the list of available drivers with their status (e.g., Android is installed). 

List of available drivers and status for Appium 2.0

In addition, to view the list of plugins available to be used with Appium 2.0, run the following command: 

appium plugin list 

Command to view list of plugins

Installing a specific plugin is done via the following command: 

appium plugin install images 

To simply kick off the Appium server, run the Appium command: 

appium server -pa /wd/hub 

The above will launch the Appium server allowing you to than start your test from your IDE. 

Appium, like Selenium, supports different language bindings like Java, JavaScript, Python, and others. 

In the initial example, we will use a JavaScript Android test scenario with a file named index.js that will test a basic mobile native app that is available on the Appium GitHub repository (ApiDemos-debug.apk). 

The test below is built using WebDriver.IO framework, therefore, you will also need to install this framework via the following command: 

npm install webdriverio 

The test will install on an Android virtual device, or a cloud based device the android APK binary, then launch the app and type ‘Hello World!’ into the text box and validate that the string is indeed available as expected. 

Test to install on Android device

To launch the above test after configuring properly both the path to the APK and the mobile platform under test, simply run the node command as follows: 

node index.js 

After running the execution command and launching an Android emulator using the Android SDK AVD manager that comes with Android Studio IDE, you should get the following result: 

Appium test results

In the above screenshot there are three main windows: 

  1. The Appium GUI server that shows that it’s running and the execution log 
  2. The Android Pixel 3a Emulator (AVD) that was launched from the IDE 
  3. The Visual Studio code editor and terminal showing the code sample and the output log with the successful Hello World string. 

To learn more about Appium 2.0, and to properly set up your Appium environment, please refer to the Appium documentation

Expand Your Appium 2.0 Testing With Perfecto

Perfecto and Appium have a seamless integration. Teams can create, run, and analyze your test automation with Appium on real devices in the Perfecto cloud.

With Perfecto and Appium for testing mobile applications, you’ll be able to:

  • Scale your existing Appium testing on multiple platforms.
  • Ensure security for the enterprise.
  • Support advanced automation scenarios, such as image injection, biometric authentication, network virtualization, and others.
  • Find and fix bugs faster through advanced reporting.
  • Integrate test automation into your CI/CD stack.

Explore Testing With Appium & Perfecto in Action

Try Perfecto and Appium today with our free trial, or schedule a custom demo with one of our automation experts to see how testing with Appium and Perfecto can benefit your organizations.

Start Trial