BreadcrumbHomeResourcesBlog Getting Started With Appium 2.0: Overview of The Core New Features June 23, 2022 Getting Started with Appium 2.0: Overview of the Core New Features Industry NewsBy Eran KinsbrunerThe 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 AppiumAppium 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: Appium desktop (Server) - https://github.com/appium/appium-desktop Appium element inspector - https://github.com/appium/appium-inspector 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).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). In addition, to view the list of plugins available to be used with Appium 2.0, run the following command: appium plugin list 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. 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: In the above screenshot there are three main windows: The Appium GUI server that shows that it’s running and the execution log The Android Pixel 3a Emulator (AVD) that was launched from the IDE 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 PerfectoPerfecto 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 ActionTry 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
Eran Kinsbruner DevOps Chief Evangelist & Sr. Director at Perforce Software, Perfecto Eran Kinsbruner is a person overflowing with ideas and inspiration, beyond that, he makes them happen. He is a best-selling author, continuous-testing and DevOps thought-leader, patent-holding inventor (test exclusion automated mechanisms for mobile J2ME testing), international speaker, and blogger. With a background of over 20 years of experience in development and testing, Eran empowers clients to create products that their customers love, igniting real results for their companies.