The app industry is growing at an unprecedented pace, with 71 billion app downloads recorded in 2020—a 45% increase from 2019. As apps proliferate, the demand for effective testing solutions has surged. Among the most trusted tools in mobile app automation testing is Appium, an open-source framework that has revolutionized the industry.
Appium traces its roots back to 2011 when Dan Cuellar identified a gap in viable test automation tools and set out to create a solution. Since its official launch in 2012, Appium has become the most popular mobile app test automation framework, continually evolving to meet industry needs. With the upcoming release of Appium 2.0, the platform promises groundbreaking updates, fostering collaboration and innovation by empowering developers to create customized drivers and plugins, cementing its position as the go-to ecosystem for mobile test automation.
What is Appium?
Appium is an open-source test automation framework designed for automating native, hybrid, and mobile web apps on iOS, Android, and Windows platforms. It allows testers to write tests once and run them on multiple platforms using the same API, enabling efficient code reuse across diverse devices and operating systems.
For more insights into how Appium can enhance your testing strategy, watch this webinar.
Appium Philosophy
Appium operates on the principle of providing a unified framework for testing across multiple devices. Inspired by Jason Huggins, co-creator of Selenium, Dan Cuellar envisioned Appium as an open-source solution accessible to global testing communities. This commitment has driven Appium’s evolution, making it the most popular framework in mobile app automation testing.
Building on this foundation, Appium 2.0 introduces innovative features designed to increase flexibility, enable customization, and encourage community-driven collaboration.
Appium 2.0 feature highlights
- No More Bundled Appium Download
Driver’s like UIAutomator2, Espresso, XCUITest etc will no longer be bundled with the Appium server. This means that the contribution and development towards different drivers will become easy as the interest in the different drivers will gain more traction. Also since these drivers don’t have much in common, the development of these drivers will draw interest from contributors to better them for use on the Appium Serve. As a result of the ease of bundling, the size of the Appium install will drastically decrease, encouraging more customization of drivers with Appium.
2. Customized Drivers
With Appium 2.0, users can create a driver for different platforms using the appium driver template with minimum lines of code. These drivers can then be used by various appium users. The new drivers can also be used privately on existing Appium driver’s templates that users may have configured from before. This opens an ocean of opportunities for developers to create drivers for the open source community or use them to use it privately or sell them as customized drivers. The options are endless as to how you want to use the appium driver template for the better.
3. Plugins for Special Commands
Since there are a variety of use cases for Appium that involve the use of special commands or unique ways to alter the behaviour of appium to perform a specific command. As the dependencies and the code that support the various features by appium comes with installation, users can install independent plugins for the special commands, or better yet create their own appium plugins. Users can then share the plugins with the world in the similar models of sharing different drivers.
Installation of Appium2.0:
For now, users can use npm install -g appium@next to install the appium server
Installation of drivers:
—————————–
appium driver install xcuitest
appium driver install uiautomator2
Other driver CLI commands:
————————————–
appium driver list
appium driver list –updates
appium driver update <driverName>
Actionable Tips for Testers to Get Started with Appium 2.0
1. Best Practices for Customizing Drivers in Appium 2.0
Appium 2.0’s flexibility in allowing testers to create and manage custom drivers offers significant advantages. Here’s how you can get started:
-
- Understand the Driver Template: Appium 2.0 provides a basic driver template to help you create custom drivers with minimal coding. Familiarize yourself with the structure and functionalities of the template by reviewing the Appium documentation.
-
- Define Your Requirements: Identify the specific needs of your project, such as platform-specific requirements (Android/iOS), app features (e.g., biometrics, location services), or device types. This clarity will guide the customization process.
-
- Leverage Existing Drivers: Before creating a new driver, evaluate if existing drivers like UIAutomator2, Espresso, or XCUITest meet your requirements. If not, build on their base to create something unique.
-
- Keep Your Code Modular: When writing your custom driver, use modular coding practices. This will allow for easier updates, debugging, and reuse.
-
- Test the Driver Thoroughly: Validate your custom driver with diverse test cases to ensure it handles all expected app behaviors. Use both real and simulated devices to verify its compatibility and robustness.
-
- Contribute to the Community: Share your custom driver with the open-source community if it addresses a common need. This can foster collaboration and even attract improvements from other contributors.
2. Best Practices for Creating Plugins in Appium 2.0
Appium 2.0’s plugin architecture allows testers to extend its functionality for specific needs. Here’s how to create plugins effectively:
-
- Identify Gaps in Functionality: Determine scenarios where additional commands or altered behaviors are necessary, such as handling app-specific gestures or validating unique user inputs.
-
- Start Simple: Begin by creating small plugins that address specific functionalities. This will help you understand the plugin creation process before diving into complex use cases.
-
- Follow Naming Conventions: Use clear and descriptive names for your plugins to make them easily identifiable within your team or the community.
-
- Document Your Plugin: Include clear instructions on how to install, configure, and use your plugin. If it’s shared publicly, this will help others adopt it more easily.
-
- Monitor Plugin Performance: Regularly check your plugin for updates or conflicts with new Appium releases. Optimize its performance to ensure it doesn’t slow down test execution.
Strategies for Integrating Appium 2.0 with Popular CI/CD Tools
Integrating Appium 2.0 into your CI/CD pipelines ensures automated testing is a seamless part of your software delivery lifecycle. Here’s how to do it:
1. Set Up Appium in Your CI/CD Environment
-
- Install Appium 2.0 on the Build Server:
-
- Use npm install -g appium@next to install Appium globally.
-
- Install necessary drivers (e.g., appium driver install uiautomator2).
- Configure Device Access:
-
- Ensure your CI/CD tool can connect to real or virtual devices (using platforms like Pcloudy, Sauce Labs, or local device farms).
-
- Use Docker containers to standardize the environment for running tests.
- Use Docker containers to standardize the environment for running tests.
2. Write and Store Test Scripts
-
- Write test scripts using your preferred language and framework (e.g., Python with Pytest, Java with TestNG).
-
- Store scripts in a version control system like GitHub or GitLab for easy access and collaboration.
- Store scripts in a version control system like GitHub or GitLab for easy access and collaboration.
3. Integrate with CI/CD Tools
- Jenkins:
-
- Use the Jenkins Appium Plugin or execute test scripts through shell or batch commands in Jenkins pipelines.
-
- Configure Jenkins to trigger tests automatically after every build or code push.
- CircleCI:
-
- Use a configuration file (.circleci/config.yml) to define workflows for running Appium tests.
-
- Integrate Appium commands and dependencies within Docker containers.
- GitLab CI/CD:
-
- Add Appium tests to the .gitlab-ci.yml file.
-
- Use GitLab Runners to execute tests on specific devices or emulators.
- Use GitLab Runners to execute tests on specific devices or emulators.
4. Manage Test Reports
-
- Use reporting tools like Allure or ExtentReports to generate comprehensive reports of your Appium test runs.
-
- Configure CI/CD tools to archive these reports or send them as email notifications to stakeholders.
- Configure CI/CD tools to archive these reports or send them as email notifications to stakeholders.
5. Optimize for Speed
-
- Parallel Testing: Run tests concurrently on multiple devices or configurations to reduce execution time.
-
- Test Prioritization: Use tools like TestNG or Pytest markers to run critical test cases first.
-
- Smart Execution: Integrate AI tools that identify redundant or flaky tests and optimize their execution.
- Smart Execution: Integrate AI tools that identify redundant or flaky tests and optimize their execution.
6. Monitor and Iterate
-
- Use monitoring tools to assess test performance and system behavior during CI/CD runs.
-
- Regularly update Appium and its plugins/drivers to stay compatible with new mobile OS versions.
Summary
Appium 2.0 is surely going to make the lives of testers more easy as it is set to overcome the hassles of a preset bundling issue. With more and more options to use customized drivers on Appium, we believe the revolution of contributions and collaborations will increase. Overall, Appium 2.0 is going to bring a lot of smiles in the faces of testers, developers, and organizations. We are so thrilled and excited for the launch of Appium 2.0 and can’t wait to get our hands dirty to explore the new features it brings.