We are encountering an issue when starting a session with Appium (v2.13.1) using the UiAutomator2 driver (v3.9.6) on Chrome for Android. Instead of opening the test tab in a maximized view, Chrome sometimes starts in the tab grid view. This behaviour is new—previously, Chrome would always open with a single tab in full-screen mode.
Previously, Chrome would start with a single tab opened in full-screen mode, and we’re unsure what has changed in Chrome [133.0.6943.121], ChromeDriver [133.0.6943.126], Appium, or the UiAutomator2 driver to cause this.
We’d appreciate any insights, including:
Has anyone else experienced this issue?
Is this a known issue or expected behavior?
Could this be caused by a change in Chrome itself?
Are there any workarounds or solutions?
Any feedback or suggestions would be greatly appreciated!
Context:
Appium version and UiAutomator2 driver version:
"dependencies": {
"appium": "^2.13.1",
"appium-uiautomator2-driver": "^3.9.6",
// few other drivers/plugins
}
I’ve never heard of this and don’t know why this is happening to you, but if you would post a full log, preferably as a git gist then I will take a thorough look at it.
@wreed thank you for your response. We were investigating further these last days and concluded that it seems to be an issue with the Chrome version shipped in Samsung devices (at least it seems more likely to be reproducible in those). I was able to reproduce just issuing vanilla adb commands such as am force-stop com.android.chrome, am start com.android.chrome and pm clear com.android.chrome repeatedly without any appium component involved. I was also able to reproduce with a variety of Appium versions, including pre-2.0 versions such as 1.22.1. So it looks like a bug in Chrome itself.
Our workaround so far is to start Chrome ourselves before the appium session passing -a android.intent.action.VIEW to the am start command which forces Chrome to focus on a new tab and mitigates the issue 100% of the time. Then we need to configure appium with noReset: true capability to avoid appium clearing the running Chrome session on test setup and also androidUseRunningApp: true to the chromeOptions capability to avoid ChromeDriver restarting it.
Unfortunately I don’t think there is a way to modify the Chrome am start command in ChromeDriver in such a way to add intentions, and I was not able to mitigate the issue passing a different main activity.
Yeah to be honest I wouldn’t know either, and also if I should file the bug with Samsung or the Chrome project. The most frustrating thing about it, is that I couldn’t find a way to reliably reproduce. I just noticed that it is more likely to happen in our real device cloud devices than in my personal Samsung device (I was able to reproduce in my S20 FE but just once after several minutes of trying). So I guess the incidence on running tests locally is probably not as high.
I don’t know what to make of it, I’m thinking one difference is that the devices in the DC get rebooted more often but other than that, they should be the same. It is the same version of Chrome. I’ll keep trying to find a way to reliably reproduce and in that case see if I can file a bug somewhere else.