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. 

1 comment:

  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