Skip to main content

Get Started with Android Testing in AIQ

SetupGet Started with Android Testing in AIQ

Use this checklist to prepare Android testing with AIQ. Exact device, emulator, and driver requirements can vary by AIQ release, so confirm the release-specific prerequisites before execution.

ConfigureSetup Environment Variableschecklist

  • Use a supported Android device or emulator for the AIQ release.
  • Install

    Setthe JAVA_HOMEapplication build intended for testing.

  • Confirm network access to the application and any required test services.
  • Use approved test accounts and resettable test data.

Validation steps

  1. Confirm the device is visible to the execution host.
  2. Run a small smoke test before building longer scenarios.
  3. Review output, screenshots, and logs for device or environment variable.failures.
  4. Document
device model,

AddOS JAVA_HOME/binversion, toapplication PATH environment variable.


Installbuild, and SetupAIQ Androidversion Studio

when
    reporting issues.

    Set ANDROID_HOME environment variable.

    Add ANDROID_HOME/platform-tools and ANDROID_HOME/tools to PATH environment variable.

    Download and install Android SDK Platforms.


    Create Virtual Device (Android Emulator)

      Start Android Studio

      Click Configure

      Click AVD Manager

      Click Create Virtual Device

      Select any Profile

      Click Next

      Select Any System Image

      Click Next

        If button is greyed out, download any System Image

        Provide Name

        Click Finish


        Configure your Appium Server Emulator or physical Android phone file

        The Appium Server configuration file must be updated for your specific environment and Application. This is a JSON file that contains an array of objects. Each object corrresponds to a machine which has Appium running and the Emulator installed or physical Android phone connected. The required keys and values of each object are:

        {
          “serverURL”: “http:/example.com:4723/wd/hub, URL in which Appium runs”,
          “proxyURL”: “http://example.com:9090, optional, URL in which Test Designer runs”,
          “capabilities”: {
            “platformVersion”: “9, Appium seems to automatically detect the version”,
            “udid”: “some identifier, must be in list of adb devices command”,
            “systemPort”: “8200 - 8299, to automate multiple Emulators or physical Android phones”,
            “deviceName”: “Android 1, can be whatever name”
          },
          “app”: “Absolute path to where .apk file is in local file system or URL of .apk file, needed if value for appPackage is empty and value for appActivity is empty”,
          “appPackage”: “Package of AUT, needed if value for app is empty, otherwise is optional if value for app is not empty”,
          “appActivity”: “Main Activity of AUT, needed if value for app is empty, otherwise is optional if value for app is not empty”
        }

        Download the android-emulator-physical.json file and open it in an editor.

        Download here: android-emulator-physical.json

          Replace the udid value in the template with the Identifier number of the Emulator or physical Android phone after running adb devices command.

          Update the appPackage to match your Application’s Package.

          Update the appActivity to match your Application’s Main Activity.


          Create Android AISG

            Open Terminal

            Enter appium and press Enter

            Start AIQ services if not already running

            Log into AIQ and go to AI Scripting > Create AISG

            Click Mobile
            If Mobile is disabled, request an updated AIQ license

            Select Android in the Platform box

            Select Package in the Source box

            Select Tags in the Scan Type box (SmartTags not yet supported for Mobile)

            Confirm Visual Hints are enabled

            Click Browse in the Appium Servers box.

            Select the Appium Server Simulator description file created earlier in the setup

            Click Next

            Proceed with the AISG creation

              Enter a name in Execution Name box

              Click Load a Dataset from CSV file and check the Datasets in the list or check Default and enter variables and values

              Click Create

              AISG starts the Application and begins discovering its elements

              As Inputs Found updates, map any Custom Actions until the desired end point is reached in the Application

              If proxyURL is not empty in Appium Server configuration file, Appvance certificate installed in Emulator or physical Android phone, Application is compiled to use Appvance certificate and proxy settings of Simulator or physical iPhone configured to point to value of proxyURL

                Click Requests tab to view captured Requests performed during AISG

                Download Requests Report

                If Validations Workbench file is supplied, click Validations tab to view successful and failed Validations

                Download scripts in JS format (DS not yet supported for Mobile) to run in JS Edit & Play or in a Scenario


                Notes

                  To run tests in Emulators, these must be already running since Appium won’t start them up. If capability “avd”: “name of Emulator” is provided, Appium will start only this Emulator.

                  If capability “app”: “absolute path or URL of .apk file” is provided, Appium will try to install Application if not installed.

                  After connecting physical Android phone to computer, Trust this computer dialog may show, click Accept button and checkbox to remember setting.

                  It is normal if Appium logs show many entries with ECONNRESET error.

                  If Appium logs show ECONNREFUSED or socket hangup errors, remove AUT from memory, shutdown Emulator or disconnect physical Android phone, restart Appium, restart Emulator or reconnect physical Android phone.


                  Last updated: JuneSeptember 26,18, 20232026

                  If you have any feedback on this topic, please contact us at documentation@appvance.ai