How to integrate Appium(Maven) tests with Bitrise?


#1

How I need to integrate Appium(Maven) Mobile app automation tests with Bitrise?


#2

Hi @nagulakondavv!

Thanks for your question! Please see these related discussion as they might be of help to you:

But do not hesitate to elaborate on your specific use case and let us know any other questions you may have! :slight_smile:


#3

Hi, Thanks for yoiur reply.

I am getting “remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not find a connected Android device.” as a error


#4

Could you send us a build URL about this issue?


#5

Sure.


#6

Hy @nagulakondavv!

In this build, after your vdt step succeeds there is a start android emulator, that is missing inputs, and there is no emulator running, for that I recommend using this script

# fail if any commands fails
set -e
# debug log
#set -x

cd $ANDROID_HOME/emulator

echo no | avdmanager create avd -n Nexus_5X_API_26 -k "system-images;android-26;google_apis;x86" --force

emulator -avd Nexus_5X_API_26 -no-window -no-audio -debug-init > /dev/null 2>&1 &

echo "Waiting emulator is ready..."

adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done; input keyevent 82'

echo "Emulator is ready!"

but it is IMPORTANT that you use the Ubuntu docker LTS stack.
and put this script step to maybe the second place in the build :upside_down_face:


#7

For the Device testing do we really required Start android emulator step?

and Can you tell me the step needed to execute the automation scripts.


#8

Added the script for start android emulator. execution aborted after waiting for 5400 sec


#9

it may be that the script starts up the emulator so the start step is not required.


#10

If I removed the start emulator step then getting UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not find a connected Android device.” as a error


#11

And adding to the above error message.

[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] TestCases.openApp:28 » WebDriver It is impossible to create a new session beca…


#12

Hey, could you please send me the build’s url?
these snippets usually are way to short to really understand the situation.


#13

ok… here is the build url.


#14

Hy @nagulakondavv!

so it seems you want to run device tests, but there is no device to run them on. but the VDT step succeeded, what are the tests that run on it? aren’t those the same?


#15

ok. how I need to do the device test? how can I get rid of “No device connected issue”

Yes, VDT step is succeeded but in vdt step its just opened the App in a emulator and closed other than that nothing went in vdt step. Do I need to provide any path in vdt step to get the automation code from GIT and execute?


#16

You need to build appropriate testing APK first in prior steps.
VDT cannot be used with Appium.


#17

Then could you try change stack to the LTS ubuntu and start up an emulator with this script at the beggining of the build?

# fail if any commands fails
set -e
# debug log
#set -x

cd $ANDROID_HOME/emulator

echo no | avdmanager create avd -n Nexus_5X_API_26 -k "system-images;android-26;google_apis;x86" --force

emulator -avd Nexus_5X_API_26 -no-window -no-audio -debug-init > /dev/null 2>&1 &

echo "Waiting emulator is ready..."

adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done; input keyevent 82'

echo "Emulator is ready!"

#18

Did that and got a different issue. seems emulator issue was resolved.

Error: org.openqa.selenium.WebDriverException:
It is impossible to create a new session because ‘createSession’ which takes HttpClient, InputStream and long was not found or it is not accessible. what does it mean?

Build URL: https://app.bitrise.io/build/0dd4f7adb49aab20