Low-level android automation with adb

schedule Jun 14th 01:45 - 02:30 PM place Grand Ball Room 2 people 40 Interested

When we speak about Android automation, the first thing that comes to mind is Appium, however, what if Appium doesn't serve all your Android automation needs, at least not in the most efficient way?

When I was asked to create a test automation framework for our android service (no GUI), I needed to choose the right tool for the mission. After several weeks of researching many options (both commercial and open source). I realized that ADB is my best call because of the following reasons:
• ADB provides a faster to run solution for controlling an android device
• ADB is in a lower level of Android OS therefore it's more flexible
• ADB is going through less code components (like appium client, appium server etc..) and as a result is more reliable

In this tutorial I will share my journey towards deciding to use Android Debug Bridge when it comes to non-gui android application and how I have implemented my choice.
After this tutorial, you will have a better understanding of what is ADB, how it works, and how you can start and apply automation for the Low-Level layer of Android OS with ADB and Python.

 
4 favorite thumb_down thumb_up 10 comments visibility_off  Remove from Watchlist visibility  Add to Watchlist
 

Learning Outcome

After this tutorial, you will have a better understanding of what is ADB, how it works, and how you can start and apply automation for the Low-Level layer of Android OS with ADB and Python.

Target Audience

anyone who want to expand his knowledge with android automation and adb

schedule Submitted 6 months ago

Public Feedback

comment Suggest improvements to the Speaker
  • Naresh Jain
    By Naresh Jain  ~  5 months ago
    reply Reply

    Can you share how some of the ADB strategies could be incorporated into Appium?

    • Tomer Cohen
      By Tomer Cohen  ~  5 months ago
      reply Reply

      Hey Naresh,

      Appium uses adb to communicate with android devices, my talk is not about the combination of the two, but about when and how we should use adb instead of appium.

      • Naresh Jain
        By Naresh Jain  ~  5 months ago
        reply Reply

        Tom,

        I understand that your talk is about when to use adb instead of appium. So I'm implying that there are certain advantages of using adb over appium in certain situations. Hence my ask, if possible, can you suggest what should be done in appium to address those gaps?

        • Tomer Cohen
          By Tomer Cohen  ~  5 months ago
          reply Reply

          the major gap between the two is that adb is much faster than appium for the low-level tasks, because less components are involved in the process of communication with the device.

          i'm not sure that thing can be changed. I believe appium is slower than adb because appium is much more generic, and can handle more complex situations without the user being aware of it.

          • Naresh Jain
            By Naresh Jain  ~  5 months ago
            reply Reply

            Thanks for the clarification, Tom. Keeping performance aside, are there any other ADB strategies you can think of that could be incorporated into Appium to improve it?

            • Tomer Cohen
              By Tomer Cohen  ~  5 months ago
              reply Reply

              In terms of functionality, not. Appium includes most of the functionality you can achieve with adb and much more. But even if we can run low-level tasks, appium was created to run automation on mobile applications, and running appium without controlling an app would not be trivial.

  • Srinivasan Sekar
    By Srinivasan Sekar  ~  6 months ago
    reply Reply

    Hi Tomer Cohen,

     

    Thank you so much for your submission. The topic seems interesting to me. Can you clarify us with a rough draft of presentation on what are the low-level tasks that you have achieved through ADB and also would like to understand what are the areas do you think appium doesn't suffice in your needs?

    Break up of detailed agenda will also be helpful in this case.

    Regards,

    Srini

    • Tomer Cohen
      By Tomer Cohen  ~  6 months ago
      reply Reply
      Appium is a great framework, but it's designed to test an app through its UI. Not all apps have a graphic user interface, and not all tests should be performed through the user interface. using appium for simple tasks (like getting logcat and dumpsys, taking screenshots, making calls, starting services etc..) can be an overkill. We need install an app, and sending requests to appium server and these are tasks that unnecessary in our case.
       
      I started exploring ADB because I tried to find a way to make the low-level testing easier, faster and sometimes more reliable.
       
      In my talk I want to show how adb helped me with this situation, and also, to give a brief introduction to how adb works and how everyone can write automation with it easily (using python).

       

      בתאריך יום א׳, 9 בדצמ׳ 2018, 10:15, מאת Appium Conf 2019 <info@confengine.com>:
      Dear Tomer Cohen,

      Please note that the proposal: Low-level android automation with adb has received a new comment from Srinivasan Sekar

      Hi Tomer Cohen,

       

      Thank you so much for your submission. The topic seems interesting to me. Can you clarify us with a rough draft of presentation on what are the low-level tasks that you have achieved through ADB and also would like to understand what are the areas do you think appium doesn't suffice in your needs?

      Break up of detailed agenda will also be helpful in this case.

      Regards,

      Srini


      Visit https://confengine.com/appium-conf-2019/proposal/8636#comments to respond to the comment OR simply reply to this email (Please make sure, you delete the previous comment's content from the email before replying.)

      Regards,
      Appium Conf 2019 Team
      comment-10836@reply.confengine.com
      You have received this important update from ConfEngine on behalf of Appium Conf 2019.
      Download ConfEngine's Mobile App to totally personalise your conference experience.
      If you are 100% sure, that this email was sent to you by mistake, please click here to un-subscribe from all future email updates from ConfEngine.

      --0000000000006e71cb057cf9f6e0--


    • Justin Ison
      Justin Ison
      Sr. Software Engineer
      Applitools
      schedule 7 months ago
      Sold Out!
      45 Mins
      Demonstration
      Beginner

      In today’s agile world the time to market is becoming increasingly shorter. There is a constant desire to release ASAP to keep ahead of the competition and to please users with updated/new features. Because of this, we have less time to fully do manual and exploratory testing of our apps. Especially, when you consider all the combinations of OS's, Locales, Accessibility, Orientations & Resolutions apps support. Running anywhere from 1 to 100's of Appium crawler bots (covering all of those combinations) at once we can discover more issues quickly and efficiently without having to write a line of code.

      UI Automation also has its limitations as it only tests for expected results. Crawler bots test the unexpected, by collecting metadata such as logs, app strings, screenshots, memory and reporting back it’s finding for review so we can test all these combinations quickly and more efficiently. In this talk, I will go over the current challenges we face in today's development world, why we need more tools to help us keep pace, and cover how you can build your own Appium crawler.

      I've open sourced this tool and is available here for everyone to use: https://github.com/isonic1/Appium-Native-Crawler

    • Liked Anton Angelov
      keyboard_arrow_down

      Anton Angelov - How to Test the Test Automation Framework?

      Anton Angelov
      Anton Angelov
      CTO
      Automate The Planet
      schedule 6 months ago
      Sold Out!
      45 Mins
      Demonstration
      Intermediate

      Nowadays, more and more companies are building test automation frameworks based on WebDriver and Appium for testing their web and mobile projects. A big part of why there are so many flaky tests is that we don't treat our tests as production code. Moreover, we don't treat our framework as a product. In the talk, you will see examples of how you can automate the testing of your test automation framework and be sure that it is highly reliable. You can get lots of ideas for various types of tests such as learning tests verifying that 3rd party dependencies are not breaking the code, compatibility tests checking that the UI components are working for each mobile control on each OS, cross-platform verifications for testing whether everything is working on multiple OS. Sample test environments for storing different distributions of the framework packages will be presented.

    • Liked Srinivasan Sekar
      keyboard_arrow_down

      Srinivasan Sekar / Sai Krishna - Native mobile commands in Appium

      45 Mins
      Tutorial
      Intermediate

      Apple and Google’s test automation framework does not natively support W3C standards for few web driver spec implementations directly for e.g TouchActions interface in XCTest, etc. Although test automation frameworks support a rich set of those functions specific to platforms, Appium does provide ways to directly invoke these functions e.g gestures, biometric handling, etc.

      Many special behaviors and workarounds are made available and achieved only through executing platform-specific native commands of Appium. For instance, there are 100+ issues been reported on date picker or handling picker wheel in the appium organization but it can be achieved quite easily by executing native mobile commands.

      There are so many that testers might not get chance to go through each one of these and get acquainted with all of those. Native mobile commands help to handle much complex use cases like biometric handling, talking to Siri, performance profiling, etc quite easily.

    • Liked Jonah Stiennon
      keyboard_arrow_down

      Jonah Stiennon - Find Elements By Accessibility Id

      Jonah Stiennon
      Jonah Stiennon
      Partner
      Cloud Grey
      schedule 6 months ago
      Sold Out!
      20 Mins
      Talk
      Intermediate

      You'll find many written sources which assert that AccessibilityId is the preferred selector to use for finding elements, but why is this the case? What's wrong with XPath?

      In this talk, we will discuss Accessibility Id's in depth. How Appium uses them to find elements on iOS, Android, and web, and how developers add these Id's to apps. We will specifically focus on the performance impact of using XPath selectors instead of Accessibility Id's.

      We will demonstrate techniques we can use to improve the performance of XPath selectors if accessibility Id's are missing, and discuss strategies for convincing managers and app developers to add accessibility Id's to the apps we automate.

    • Liked Jonah Stiennon
      keyboard_arrow_down

      Jonah Stiennon - All Desired Capabilities

      Jonah Stiennon
      Jonah Stiennon
      Partner
      Cloud Grey
      schedule 6 months ago
      Sold Out!
      90 Mins
      Tutorial
      Intermediate

      Appium has so many desired capabilities! How many exactly? Let's count!

      Join Appium contributor Jonah Stiennon as he iterates through every desired capability supported by Appium.

      Many special behaviors and specific workarounds are made available only through desired capabilities. Often the key to selecting an element reliably, launching an app, or avoiding a timeout, is picking the right set of desired capabilities. There's so many that testers don't get the chance to sit down and become acquainted with them all.

      There's too many to easily memorize and documentation can be sparse. Jonah will introduce novel ways to classify, visualize, and organize all of the desired capabilities, making it easier to find ones which can be useful.

    • Liked Wim Selles
      keyboard_arrow_down

      Wim Selles - Building your own native app visual testing module with Appium

      Wim Selles
      Wim Selles
      Solution Architect
      Sauce Labs
      schedule 6 months ago
      Sold Out!
      45 Mins
      Case Study
      Beginner

      We all know that Appium can do (almost) everything what you tell it to do, but in the end we always ask it to do the same thing. We ask Appium to automate our happy and or our error flow. The result can give us the confirmation that the user can still buy a product, or verify if his bank account still has a positive balance.

      But what if we need to know more than that - what if we also need to verify the layout of our app? The answer would be easy, as there are plenty of open-source or paid solutions that can help you with that. However, almost all of these solutions focus on web/hybrid apps, not on native iOS and or Android apps.

      I faced this challenge when I was automating a React Native app for my customer. There was no image comparison tool that could do what I wanted it to do, so I rolled up my sleeves and started building my own. In this talk we’ll be walking down the path I’ve been taking and I’ll explain:

      • Why I used ResembleJS as my core visual comparison solution
      • The things I’ve learned about Appium in the process (pro tips!)
      • The differences between iOS and Android and how I managed to solve this in one cross-platform solution
      • The pros and cons of my solution
    • 45 Mins
      Case Study
      Intermediate

      Experimentation and quick feedback is the key to success of any product, while of course ensuring a good quality product with new and better features is being shipped out at a decent / regular frequency to the users.

      In this session, we will discuss how to enable experimentation, get quick feedback and reduce risk for the product by using a case study of a media / entertainment domain product, used by millions of users across 10+ countries - i.e. - we will discuss Testing Strategy and the Release process an Android & iOS Native app - that will help enable CI & CD.

      To understand these techniques, we will quickly recap the challenges and quirks of testing Native Apps and how that is different than Web / Mobile Web Apps.

      The majority of the discussion will focus on different techniques / practices related to Testing & Releases that can be established to achieve our goals, some of which are listed below:

      • Functional Automation approach - identify and automate user scenarios, across supported regions
      • Testing approach - what to test, when to test, how to test!
      • Manual Sanity before release - and why it was important!
      • Staged roll-outs via Google’s Play Store and Apple’s App Store
      • Extensive monitoring of the release as users come on board, and comparing the key metrics (ex: consumer engagement) with prior releases
      • Understanding Consumer Sentiments (Google’s Play Store / Apple’s App Store review comments, Social Media scans, Issues reported to / by Support, etc.)

    • Liked Angie Jones
      keyboard_arrow_down

      Angie Jones - Your Tests Lack Vision: Adding Eyes to Your Automation Framework

      Angie Jones
      Angie Jones
      Sr. Developer Advocate
      Applitools
      schedule 5 months ago
      Sold Out!
      45 Mins
      Demonstration
      Intermediate

      Automation has come a long way in assisting with regression testing efforts. Teams worldwide are successfully running hundreds of functional regression tests at every check-in. While this provides a great source of confidence, critical regression bugs are still missed using this approach. That’s because these tests can only assert on what their human programmer asks them to. Additional errors with functionality, UX, and usability often go uncaught using today’s most common test automation techniques.

      For this reason, the top companies in all sectors of the industry are turning to visual validation. Visual validation is a relatively new concept that can be used to enhance existing automated tests and provide an easy way to perform those difficult checks for things like UX, localization, usability, responsive design, and cross-device testing.

      In this talk, you’ll learn how visual validation works, see a live integration into an existing Appium test code base, and discuss the pros and cons of using various visual validation techniques.

    • Liked Sravan Kumar
      keyboard_arrow_down

      Sravan Kumar - Bootcamp to understand Appium android internals

      Sravan Kumar
      Sravan Kumar
      Sr. Software Engineer
      Badoo
      schedule 6 months ago
      Sold Out!
      45 Mins
      Tutorial
      Intermediate

      Appium is a world's most popular open source mobile test automation framework developed using WebDriver protocol and I am fortunate enough to get a chance to contribute to appium-uiautomator2-server and appium-uiautomator2-driver modules.

      The goal of the session is to help the Appium community to have a better understanding of Appium and how it works.

      In this session, I will be discussing Appium architecture specifically towards its Android modules(UiAutomator2 and Espresso), how the communication happens between Appium modules and how to add new handler/API in appium

    • Liked Sai Krishna
      keyboard_arrow_down

      Sai Krishna / Srinivasan Sekar - Life Cycle of an Appium command

      45 Mins
      Talk
      Beginner

      Every command you write using Appium Client Library will be converted to JSON Wire Protocol over HTTP which in turn will be passed to the drivers(AndroidDriver, IOSDriver). The respective driver doesn’t just send or execute the command directly on the device. Appium has a Lifecycle of modules which sends the command to the devices.

      Abstract:

      The goal of the session is to help the Appium community to have a better understanding of Appium and how it works internally.

      Will discuss on following aspects:

      • What happens under the hood when the session is created, mainly how appium connect to the corresponding device, installing the app, launching the app and the different steps involved in the process.

      • Command life cycle - How client request converted into an HTTP request, how received request passes through appium drivers(ios-driver & AndroidDriver) and the respective driver don’t just send or execute the command directly on the device. Appium has a Lifecycle of modules which sends the command to the devices.

      • How the final response passed to the client through different layers.
    • Liked Bijoya Chatterjee
      keyboard_arrow_down

      Bijoya Chatterjee - Trust Issues with UI Automation

      45 Mins
      Talk
      Beginner

      UI Test Automation is notorious for stability issues. UI automation is almost synonymous with "Flaky Test". We discuss taking a proactive strategy towards test automation flakiness as opposed to a reactive approach where we look at failures and then decide the course of action. How can we in the test automation community use and develop tools that helps eliminate flakiness and also identifies flaky tests before they are not just run but even before they are merged. How do we create these tools in a service model that plugs into our Continuous Integration pipelines ?

    • Liked Bruno Alassia
      keyboard_arrow_down

      Bruno Alassia - Go beyond the software, automate hardware scenarios on Android Emulators

      Bruno Alassia
      Bruno Alassia
      Sr. Software Engineer
      SauceLabs
      schedule 7 months ago
      Sold Out!
      45 Mins
      Talk
      Intermediate

      Explore the limits Appium can help you achieve to control the Android Emulator behavior. Automate network emulation, receive fake SMS and phone calls, change the battery states and levels and a lot more, all using real-life test cases. What happens to my app if I lost connection? How does my UI react to an incoming phone call? And more.

      https://slides.com/vrunoa/appium-conf-2019#/

      https://github.com/vrunoa/appium-conf-2019

    • Liked Aisyah Dzulqaidah
      keyboard_arrow_down

      Aisyah Dzulqaidah - Cloud Based Mobile Application Testing with Appium

      Aisyah Dzulqaidah
      Aisyah Dzulqaidah
      TEST ENGINEER
      BBM
      schedule 6 months ago
      Sold Out!
      20 Mins
      Demonstration
      Beginner

      Testing our mobile application using real device is not scalable and need high maintenance. As the test is bigger , we need to make our test is parallel to make it faster and efficient. We also need to test it agains many variety of device and OS version. Running testing using device cloud is the solution, so in this session I will show you how to setup and run parallel automation testing using Android device emulator and iOS simulator. In this case, I wil show the demonstration using Genymotion Cloud, Appium, and Robot Framework.

    • Liked Rajdeep
      keyboard_arrow_down

      Rajdeep - There is more in Espresso Driver's Element than you think/ WhiteBox testing using Appium

      Rajdeep
      Rajdeep
      Sr. Test Automation Engineer
      Badoo
      schedule 6 months ago
      Sold Out!
      45 Mins
      Demonstration
      Intermediate

      Have you been in a situation when some cases are impossible to test because Appium doesn't have support? Appium is improving continuously and release of espresso-driver is an example of this.
      Espresso driver opens up possibilities of white-box testing using Appium. One of which is the ability to call platform methods on elements via backdoor without modifying Application under test. What it means is, if the Android platform supports some actions or properties on an element, then Appium will support it out of the box.
      For an automation engineer, that's a very powerful addition. I was fortunate enough to work on this feature and would like to showcase what are the various tricky cases where this feature can be applied. There will be real examples shown with a sample android app. I will also introduce one more small bonus feature at the end, about flashing elements on screen ;)

    • Liked Anton Angelov
      keyboard_arrow_down

      Anton Angelov - The 5th Generation of Test Automation Frameworks

      Anton Angelov
      Anton Angelov
      CTO
      Automate The Planet
      schedule 6 months ago
      Sold Out!
      45 Mins
      Talk
      Intermediate

      The need for test automation nowadays is undeniable. For choosing the right solution for our context, we need to know what are our options and fully understand them. We will talk about the five generations of test automation frameworks, what they include, who uses/used them and how they are related to the evolution of the QA profession.

      The full-stack test automation frameworks are the 5th generation of tools. You will hear why they are different, what they include and why this is important. Understanding the evolution of the automation tooling entirely will help you define better the requirements for your test solution or give you ideas on what to improve in your existing one. As a bonus, you will see demonstrations of sample features of such a framework and get inspired how to build them yourself.

    • Liked Anand Bagmar
      keyboard_arrow_down

      Anand Bagmar - Build your own MAD-LAB - for Mobile Test Automation for CD

      45 Mins
      Case Study
      Intermediate

      In this age of a variety of cloud-based-services for virtual Mobile Test Labs, building a real-(mobile)-device lab for Test Automation is NOT a common thing – it is difficult, high maintenance, expensive! Yet, I had to do it!

      Attend this talk to understand the Why, What and How I built my own MAD-LAB (Mobile Automation Devices LAB). The discussion will include –

      • Understanding the context,
      • Why no cloud-based solution worked for me,
      • The automation strategy for Android / iOS / Web platform,
      • The tech-stack (cucumber-jvm / Appium), and,
      • The core implementation to build your own MAD-LAB! (already open-sourced)
      • How this results in Continuous Delivery (CD)
    • Liked Eran Kinsbruner
      keyboard_arrow_down

      Eran Kinsbruner / Uzi Eilon - Future-Proofing Testers in the Age of AI, ML, and Bots

      45 Mins
      Talk
      Advanced

      We're all hearing the buzzwords of AI, machine learning, chatbots, and next-generation testing. Does this mean that the days of traditional testing as we know and practice it are over? Eran Kinsbruner doesn't think so. Join him to learn about the clear transformation happening toward smarter testing techniques and tools. These approaches will drive better pipeline efficiency and release velocity with high quality, and Eran thinks this means good things for the testing practice and practitioners. You'll discover the key trends that are happening around AI, machine learning, and bots in the web and mobile landscapes, and get the ability to identify some early adopters who are taking the lead in these domains. Learn some key requirements and skills that are required for a test engineer to shift toward the future of automation, as well as the changes testers will need to undergo in order to become future leaders in this space.

    • Liked Surbhit Aggarwal
      keyboard_arrow_down

      Surbhit Aggarwal / Tarun Narula - Reporting, Tracking & Analyzing Play store Reviews using automation

      45 Mins
      Talk
      Beginner

      How many of you have written a negative play store review? Did you get a response back? In how much time? Was your query resolved?

      How would you like if you got a quick response to your comment (say within 15 mins). Your query is then tracked & you are provided a quick resolution. It would be fabulous. Right? Absolutely!

      As user base of any Application increases customer satisfaction becomes a key factor in order to maintain an upper hand among your competitors.

      Most companies have dedicated teams to reply to Play Store reviews but as the number of reviews increase there is no way to keep a track of it.

      By using Google Play Store Reviews API's we have automated logging of these reviews into JIRA. For each negative review a JIRA ticket is created & assigned to the customer support team within a few minutes for their follow up. In case a Bug/Suggestion is valid the JIRA Ticket can then be assigned to the concerned department who can take action on them.

      Using JIRA, the reviews can further be categorised to find out areas we can improve upon.

      In this talk we will explain how we can build an ecosystem using some Google & JIRA APIs to enhance the overall app user experience.

    • Liked Prachujya Saikia
      keyboard_arrow_down

      Prachujya Saikia / Shabir Shariff - Connecting APIs to help automate IoT Endpoints

      45 Mins
      Demonstration
      Beginner

      Promising a convenient life by enabling machine-to-machine and machine-to-human communication, IoT (Internet of things) technologies are fast gaining ground. In the not-too-distant future, we might see refrigerators automatically ordering items that need replenishing and cars steering us around on their own. This means designers, developers and QA engineers will have more opportunities than ever before to significantly impact the lives of millions.

      There will never be enough QA engineers for testing IoT offerings, because there will be numerous layers and devices to test for functionality, interoperability, security, and more. Although a certain high level of manual testing will be required for , having more to test means that they will need to prioritize and automate whatever you can. This would increase the demand for better automation testing, leading to a rise in the number of sophisticated testing models in the connected world.

      APIs connecting our connected world should be automated as much as possible because without a fully functioning API, there will simply not be connected to the Internet anymore. Creating API tests manually, based on a written description, can be time-consuming and inaccurate.

      An API, typically based on JavaScript Object Notation (JSON), is often layered on top of the transport protocol. This transport layer helps interact with the device. Automation Engineers can use these protocols and APIs to automate IoT devices. The Automation framework must be able to support these protocols and APIs in order to be effective.

      An IoT gateway helps connect smart IoT endpoints with sensors over cloud. With the help of the rest APIs of the IoT endpoints we have developed a test environment where all APIs are integrated with our automation framework.

      In this talk, we will demonstrate how to integrate established connection between IoT endpoints and cloud server with automation environment to help teams to bring APIs into automation of IoT devices which helps in detecting reliability, functionality of IoT endpoints.

    • Liked sandeep yadav
      keyboard_arrow_down

      sandeep yadav / Tarun Narula - What to do when tests fail

      20 Mins
      Demonstration
      Beginner

      What to do when your tests fail? Read on...

      Retry your test case on Jenkins:

      As much as we want to keep user interface tests free of failures, timing issues and page element errors pop up from time to time in automated UI checks. If not a test bug, these often reflect the nature of the app under test, its behavior under certain conditions like the internet connection or the machine slowing down suddenly or the page not loading properly. Such errors can be annoying in tests and if we ever want to continue using them, we’ll have to re-run them some of the time to make sure that errors do exist.


      Send slack notifications

      Using Slack for official communication? How about getting notified about execution details instantly through slack. Sounds interesting. Right?


      Send SMS from Jenkin

      Need a reminder for re-setting a soon to expire password in your automation code?

      Using library you will be able to get updates of your test case execution instantly. You can receive error or failure reason on SMS so that action can be taken proactively.


      Rebuild the job

      We can define certain rules using jenkins so that in case our tests fail more than the allowed threshold, say X%, we can rerun the suite to rule out any environmental issues.

      In this talk we will be discussing the implementation details of the above points so that you know what you can do when your tests fail!