Thursday, 4 February 2016

How to Run the Automation Test Case on Real Android Device?

It is more accurate if you run your test cases with real device than with emulators. I will post later how to run the test case with emulators but now we will learn how to run test cases on the android devices. This tutorial is generic irrespective of which tool you to write automation. 

The process is simple you need to connect your device with USB cable to your PC  and then you need to enable the USB debugging option.

1. Check if the developer option is enabled for the device or not. To do so open Settings -> check for text "developer options if you find it then. GO TO step 3.


2. Enable Developer Options - Go to Settings -> click on About Phone -> Tap on Build Number continuously for seven times -> You will see the toast saying " you are a developer". You can now find Developer options in Settings.

3.Last step is to enable USB debugging for that first connect device to PC and them click on Developers options and check USB debugging. It will ask you for with pop up the hit on "OK".


Now your device is ready for test case execution.

You can also cross check whether you have done it correctly or not -

1. open command prompt
2. Run command adb devices
3. You can then see the list of connected devices.


Now you and your device is ready for running test cases. in case of any doubt post comments. 

6 comments:

  1. Hello;
    When typing adp device, I have always the following message:

    "Microsoft Windows [version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation. Tous droits réservés.

    C:\Users\uid0152> adb version
    Android Debug Bridge version 1.0.39
    Revision 5943271ace17-android

    C:\Users\uid0152> adb devices
    List of devices attached
    * daemon not running. starting it now at tcp:5037 *
    error: cannot open transport registration socketpair: Input/output error

    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information.
    could not read ok from ADB Server
    * failed to start daemon *
    error: cannot connect to daemon

    C:\Users\uid0152> adb devices
    List of devices attached
    * daemon not running. starting it now at tcp:5037 *
    error: cannot open transport registration socketpair: Input/output error

    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information.
    could not read ok from ADB Server
    * failed to start daemon *
    error: cannot connect to daemon

    C:\Users\uid0152> adb devices
    List of devices attached
    * daemon not running. starting it now at tcp:5037 *
    error: cannot open transport registration socketpair: Input/output error

    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information.
    could not read ok from ADB Server
    * failed to start daemon *
    error: cannot connect to daemon

    C:\Users\uid0152> adb devices
    List of devices attached
    * daemon not running. starting it now at tcp:5037 *
    error: cannot open transport registration socketpair: Input/output error

    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information.
    could not read ok from ADB Server
    * failed to start daemon *
    error: cannot connect to daemon

    C:\Users\uid0152> adb version
    Android Debug Bridge version 1.0.39
    Revision 5943271ace17-android

    C:\Users\uid0152> adb devices
    List of devices attached
    * daemon not running. starting it now at tcp:5037 *
    error: cannot open transport registration socketpair: Input/output error

    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information.
    could not read ok from ADB Server
    * failed to start daemon *
    error: cannot connect to daemon"

    I tried so many solutions , I've enven uninstall/reinstall android studio but it doesn't work. Can you please help me to solve this issue? thanks

    ReplyDelete
  2. Being new to the blogging world I feel like there is still so much to learn. Your tips helped to clarify a few things for me as well as giving..
    Android App Development Company

    ReplyDelete
  3. I just want to say that all the information you have given here is awesome...great and nice blog thanks sharing..Thank you very much for this one. And i hope this will be useful for many people.. and i am waiting for your next post keep on updating these kinds of knowledgeable things...
    Web Design Development Company
    Web design Company in Chennai
    Web development Company in Chennai

    ReplyDelete
  4. I wondered upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.
    iOS App Development Company

    ReplyDelete
  5. great and nice blog thanks sharing..I just want to say that all the information you have given here is awesome...Thank you very much for this one.
    web design Company
    web development Company
    web design Company in chennai
    web development Company in chennai
    web design Company in India
    web development Company in India

    ReplyDelete