resetApp leads to "chrome not reachable" error on hybrid Android app
See original GitHub issueThe problem
I have a test that starts with the resetApp command and after the app is restarted, I’m getting the "chrome not reachable " error.
Same issue when using closeApp().launchApp() instead of resetApp()
I’m using the “autoWebview: true” and “noReset: true” capabilities. I’ve also tried not to use the autoWebview capability and added a manual connect to the first WebView after app starts - didn’t work, even with sleep period before the first attempt to connect to the Cordova WebView.
The same test works for Cordova on iOS app (same app) and iOS native app with WebView.
Android hybrid app also suffers from this issue after using resetApp() or closeApp().launchApp() and seems to behave better when using the new capability recreateChromeDriverSessions set to true. This capability did NOT solved the issue for Cordova on Android.
Environment
- Appium version (or git revision) that exhibits the issue: 1.4.16, 1.5.2, 1.5.3
- Last Appium version that did not exhibit the issue (if applicable): it used to work, but I can’t remember which version I used
- Desktop OS/version used to run Appium: Windows 8.1
- Node.js version (unless using Appium.app|exe): 4.4.5
- Mobile platform/version under test: Android versions: 4.4.4, 5.0, 5.0.1, 5.1.1
- Real device or emulator/simulator: real device
- Appium CLI or Appium.app|exe: Appium CLI
Details
Error response status: 100, Selenium error: chrome not reachable
(Session info: webview=33.0.0.0)
(Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.3 x86_64)
at exports.newError (D:\dvlp\Github\MobileAutoTests\tests\node_modules\wd\lib\utils.js:139:13)
at callbackWithDataBase (D:\dvlp\Github\MobileAutoTests\tests\node_modules\wd\lib\callbacks.js:75:19)
at D:\dvlp\Github\MobileAutoTests\tests\node_modules\wd\lib\webdriver.js:174:5
at Request._callback (D:\dvlp\Github\MobileAutoTests\tests\node_modules\wd\lib\http-utils.js:87:7)
at Request.init.self.callback (D:\dvlp\Github\MobileAutoTests\tests\node_modules\wd\node_modules\request\request.js:368:22)
at Request.<anonymous> (D:\dvlp\Github\MobileAutoTests\tests\node_modules\wd\node_modules\request\request.js:1219:14)
at IncomingMessage.<anonymous> (D:\dvlp\Github\MobileAutoTests\tests\node_modules\wd\node_modules\request\request.js:1167:12)
at endReadableNT (_stream_readable.js:913:12)
Link to Appium logs
https://gist.github.com/dekelev/2953f849cb0f492781086e9fc1cad34a (Android app using a WebView) https://gist.github.com/dekelev/1117f5b679d2e90f3c5cf292d9f7bf6d (Cordova on Android using a second WebView)
Code To Reproduce Issue
return driver.resetApp() // resetting app to solve issue on Android, where Appium loses control on WebViews after using them in a previous test
.resolve().then(() => {
return driver.waitForElementById('exampleElement')
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top GitHub Comments
I’ve found a workaround:
Set the recreateChromeDriverSessions capability to true. Make sure that the autoWebview capability is set to true.
Add the following steps right after resetApp (or after closeApp().launchApp()):
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.