Unable to run Appium tests on Android Emulator on Bitrise CI

Background
The app requires:

  • Permission: ACCESS_FINE_LOCATION should be granted.
  • Location state should be set as “Authorized Always” or “Authorized when in use”

Issue
The app does not launch when the tests get executed on CI.
URL: https://app.bitrise.io/build/78d3916292374b53#?tab=log

  • ADB Logs and Video recording are available in the Apps and Artifacts Tab for reference.

On Android Emulator with API Level: 29, and Tag: google_apis
The tests

  • are written in TypeScript/JavaScript and use @wdio/sync and Appium.
  • Run successfully locally using bitrise-cli on Mac OS X, 10.15.7.

The Android Emulator is created and initialised using the bitrise step avd-manager, and a delay is introduced by using the step wait-for-android-emulator.
During the test run (on Bitrise CI), the appium settings app launches, but the app that is getting tested does not launch.

Error
Since the app does not launch, there is a NoSuchElementError error.

[0-1] 2021-01-18T09:16:49.346Z INFO webdriver: RESULT {
  error: 'no such element',
  message: 'An element could not be located on the page using the given search parameters.',
  stacktrace: 'NoSuchElementError: An element could not be located on the page using the given search parameters.\n' +
    '    at AndroidUiautomator2Driver.findElOrEls (/bitrise/src/node_modules/appium-android-driver/lib/commands/find.js:75:11)\n' +
    '    at processTicksAndRejections (internal/process/task_queues.js:97:5)'

Hi @ridebeam-tools
Thank you for reaching out to Bitrise.
From the looks of it, this seems like a performance issue of Appium.
I would like to suggest that you can do a trial of Bitrise’s Elite plan which has faster machines and takes less time to run a build.
Let me know if you would like to proceed with that.

Thanks
Chaitanya

Thanks for the reply.
I have tried the following on Bitrise

  • Android Emulator without Google Apis: The application launches but is unable to obtain location services and this issue occurs.
  • Android Emulator with Google Apis: The application fails to launch.

I have recorded a video (1min 43 seconds, using ADB screen record) and the speed of the Android Emulator does not seem to be a concern. The app is not sluggish upon launch. It does not launch at all.
I have tried a few other approaches too and have raised a support ticket.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.