Skip Navigation

Execute an automated test for an
Android
Xamarin app

  1. In
    Visual Studio
    , open
    Android.UITests
    .
  2. Configure the following properties for the data provider class. If you use the default FileDataProvider class, configure the properties in Common.UITests/Resources/data.json. If you use the SimpleDataProvider class, configure the properties in Common.UITests/DataServices/BaseSimpleDataProvider.cs.
    You can change the data provider class in the IDataProvider interface in Common.Android.UITests/Container/ContainerBootstrapper.cs. To sign the test server with a specific
    Android
    Keystore that matches your .apk (see Xamarin.UITest and Signing Android Apps), you must configure Keystore properties.
    Property
    Value
    BinaryPath
    This is the path of the .apk file.
    DeviceIdentifier
    This is the device identifier.
    To get the device identifier, run the following command in the terminal while the device is connected or the emulator is open:
    $ adb devices
    DeviceEcid
    This property applies only to
    iOS
    devices. For
    Android
    , specify an empty string.
    AdbPath
    This is the path of the
    Android
    Debug Bridge (ADB) tool.
    To get the path, run the following command in the terminal:
    $ which adb
    Email
    This is the test user’s email address.
    AccessKey
    This is the user’s 15 or 17 character access key, in the format "xxxxxxxxxxxxxxx", "xxxxx xxxxx xxxxx" or "xxxxx-xxxxx-xxxxx".
    You can generate an access key for the user using the
    UEM
    management console or the BlackBerry Web Services APIs.
    NocAddress
    This is the address of the
    BlackBerry Dynamics
    NOC. For example, “stage11” for the staging NOC and “prod1” for the production NOC.
    Password
    This is the user’s password. The password must meet the password requirements configured in the user’s
    BlackBerry Dynamics
    policy.
    ConfirmPassword
    This is the user’s password. The password must meet the password requirements configured in the user’s
    BlackBerry Dynamics
    policy.
    KeyStorePath
    This is the path to the keystore file.
    KeyStorePassword
    This is the keystore password.
    KeyPassword
    This is the password for the matching private key in the keystore.
    KeyAlias
    This is the alias for the key in the keystore.
    Example
    { "BinaryPath": "/userDownloads/com.good.gd.example.xf.blankapp.apk", "DeviceIdentifier": "123456a1a12ab1a1", "DeviceEcid": "", //For iOS only "AdbPath": "/user/Library/Android/sdk/platform-tools/adb", "Email": "user@acme.com", "AccessKey": "01234 56789 01234", "NocAddress": "stage11", "Password": "abcd", "ConfirmPassword": "abcd" }
  3. Configure the startup project for the test that you want to run.
  4. Connect the
    Android
    device or open the
    Android
    emulator with the device identifier that you specified in step 2.
  5. Run the test.