Appium Switching between native app to chrome browser throws Error

appium automation with [email protected]

I have an native app running. Now i am trying to open a Mobile Chrome browser
I am using the following code suggested by you from some other query

((AndroidDriver) driver).startActivity(new Activity(“”, “”));

Problem comes only - on a new android device … If i use the code then the mobile chrome browser is not loading. But if i run it post if i open a browser manually its working fine. So this issue with with 1st time browser loading.

I have this challage of 1st time error on android mobile browser because i am using AWS Device Farm which boots or allocates newer machine with every run so my chrome broswer never loads

Here is the error for the above code and capabilities being used

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Cannot start the ‘’ application. Consider checking the driver’s troubleshooting documentation. Original error: ‘’ or ‘’ never started. Consider checking the driver’s troubleshooting documentation.

Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’

System info: host: ‘Mac-Q02H7RH7’, ip: ‘fe80:0:0:0:468:d114:c3e4:f4e8%en0’, ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.16’, java.version: ‘1.8.0_171’
Driver info:
Capabilities {app: /Users/x287202/SouthWest/ap…, app:setWebContentsDebuggingEnabled: true, appPackage:, autoAcceptAlerts: true, autoWebView: true, autoWebviewTimeout: 100, automationName: uiautomator2, databaseEnabled: false, desired: {app: /Users/x287202/SouthWest/ap…, app:setWebContentsDebuggingEnabled: true, autoAcceptAlerts: true, autoWebView: true, autoWebviewTimeout: 100, automationName: uiautomator2, fullContextList: true, newCommandTimeout: 180, platformName: android}, deviceApiLevel: 33, deviceManufacturer: Google, deviceModel: sdk_gphone64_arm64, deviceName: emulator-5554, deviceScreenDensity: 420, deviceScreenSize: 1080x2400, deviceUDID: emulator-5554, fullContextList: true, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, newCommandTimeout: 180, pixelRatio: 2.625, platform: LINUX, platformName: Android, platformVersion: 13, statBarHeight: 63, takesScreenshot: true, viewportRect: {height: 2274, left: 0, top: 63, width: 1080}, warnings: {}, webStorageEnabled: false}

Appreciate any update on this issue.

Possible reason after my analysis and debut might be

  • When the chrome is loaded via aap and package activity on a new device, the chrome comes up with few welcome screen.
  • On those screens chrome expects user intervenion.
    startActivity(new Activity(“”, “”))
    Debugger hangs on the above line. So chrome loading is never completes and its times out while expecting user input.

So a possible solution might be a way to avoid chrome welcome messages if there is a way to do so via appium?
I may be wrong with this analysis but kindly suggest?