Hi guys,
Trying run my Ui test for mobile application using selenium & appium but when maven start all suite I can see this error in log
Driver info: driver.version: AndroidDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command '/home/travis/android-sdk-linux/platform-tools/adb -P 5037 -s emulator-5554 shell pm install -g /data/local/tmp/appium_cache/12bb63270ecd4315cfaaa8d8202b809bbfccca11.apk' timed out after 50000ms'. Try to increase the 50000ms adb execution timeout represented by 'androidInstallTimeout' capability
at getResponseForW3CError (/home/travis/.nvm/versions/node/v8.12.0/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:826:9)
at asyncHandler (/home/travis/.nvm/versions/node/v8.12.0/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:447:37)
at <anonymous>
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'travis-job-iot-insurance-mobile-app-ui-18700087', ip: '172.17.0.4', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.52', java.version: '1.8.0_191'
Driver info: driver.version: AndroidDriver
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:208)
at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:217)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
and in appium logs
[UiAutomator2] Unable to force stop app: Error executing adbExec. Original error: 'Command '/home/travis/android-sdk-linux/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop com.x' timed out after 50000ms'. Try to increase the 50000ms adb execution timeout represented by 'adbExecTimeout' capability
[UiAutomator2] Unable to remove port forward 'Error executing adbExec. Original error: 'Command '/home/travis/android-sdk-linux/platform-tools/adb -P 5037 -s emulator-5554 forward --remove tcp\:8200' exited with code 1'; Stderr: 'adb: error: listener 'tcp:8200' not found'; Code: '1''
my .travis.yml looks like
services:
- xvfb
before_script:
- appium --log-level info > appium_log.txt &
- echo no | avdmanager create avd --force -n test -k "system-images;android-25;google_apis;armeabi-v7a"
- export ANDROID_SDK_ROOT=~/android-sdk-linux
- export DISPLAY=:99.0
- $ANDROID_HOME/emulator/emulator -avd test -gpu off -noaudio -wipe-data &
- sleep 120
script:
- mvn -B test -X
Results :
`Failed tests: createAppiumDriver(appium.tests.eula.TestVerifyEula): Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command '/home/travis/android-sdk-linux/platform-tools/adb -P 5037 -s emulator-5554 shell pm install -g /data/local/tmp/appium_cache/12bb63270ecd4315cfaaa8d8202b809bbfccca11.apk' timed out after 50000ms'. Try to increase the 50000ms adb execution timeout represented by 'androidInstallTimeout' capability(..`
All execution is fine on my local machine. I was playing around with androidInstallTimeout but no luck.
Full build log and the build scripts in your codebase – to see what exact logic you are running and what it produces and look for anything suspicious. Based on Run an android emulator on a headless server - Stack Overflow, the commands you run look okay so I cannot point out any flaws from the top of my head.
If the build is private, you can still give the build link but only Travis support staff will be able to open it. I cannot help you then, I’m afraid.
I think that xvfb is working good. I’ve created docker image and use the same command to run xvfb and success output command from docker is exactly the same like here in Travis. Anyway I can try to install this manually instead of use service.
Also with the same commands I can execute and test in Docker on vm or local success.