-3

So here is my code I see the app open in the emulator then close and I still get this error

** Variables ** 
${REMOTE_URL} http://localhost:4723/wd/hub
${PLATFORM_NAME_ANDROID} Android
${DEVICE_NAME_ANDROID} emulator-5554
${APP_ANDROID} /Users/william_flow/Documents/Code/xxx/App/base.apk
${APP_PACKAGE} com.xxx.android
${AUTOMATION_NAME} appium
${RESET_OFF} true
${AppAct} com.xxx.android.flavor.full.activities.HomeActivity

** Test Cases *
Open Android app
Open Application ${REMOTE_URL} app=${APP_ANDROID} 
automationName=${AUTOMATION_NAME} 
platformName=${PLATFORM_NAME_ANDROID} 
deviceName=${DEVICE_NAME_ANDROID} appPackage=${APP_PACKAGE} 
noReset=${RESET_OFF}
sleep 5s

I run it I see it run in my simulator and it Fails saying

Open Android app | FAIL |
WebDriverException: Message: An unknown server-side error occurred 
while processing the command. Original error: Cannot start the 
‘com.xxx.android’ application. Visit 
https://github.com/appium/appium/blob/master/docs/en/writing-running- 
appium/android/activity-startup.md for troubleshooting. Original 
error: ‘com.xxx.android.activities.MainActivity’ or 
‘com.xxx.android.com.xxx.android.activities.MainActivity’ never 
started. Visit 
https://github.com/appium/appium/blob/master/docs/en/writing-running- 
appium/android/activity-startup.md for troubleshooting

so what am I doing wrong?

1 Answers1

0

I have modfied your code, so that it becomes more redable and get executed easily

*** Settings ***
Documentation    This script starts apps on two phones
Library          AppiumLibrary
Library          Collections

*** Variables ***
${REMOTE_URL}  http://localhost:4723/wd/hub
${PLATFORM_NAME_ANDROID}  Android
${DEVICE_NAME_ANDROID}  emulator-5554
${APP_ANDROID}  /Users/william_flow/Documents/Code/xxx/App/base.apk
${APP_PACKAGE}  com.xxx.android
${AUTOMATION_NAME}  appium
${RESET_OFF}  true
${AppAct}  com.xxx.android.flavor.full.activities.HomeActivity

*** Test Cases ***
First test case
    Open Android app

*** Keywords ***
Open Android app
    Open Application  ${REMOTE_URL}  app=${APP_ANDROID}  automationName=${AUTOMATION_NAME}  platformName=${PLATFORM_NAME_ANDROID}  deviceName=${DEVICE_NAME_ANDROID}  appPackage=${APP_PACKAGE}  noReset=${RESET_OFF}  appActivity=${AppAct}
    sleep 5s

Couple of Key points

  1. appActivity was missing
  2. Assuming appium server is running at 4723
  3. Assuming Appium library is installed
  4. You may also want to have a look on this link Automating mobile App using Robot Framework and Appium

If you can address above 4 points , your error should get resolved!!

pankaj mishra
  • 2,555
  • 2
  • 17
  • 31