appium / appium

Cross-platform automation framework for all kinds of apps, built on top of the W3C WebDriver protocol
http://appium.io/
Apache License 2.0
18.71k stars 6.06k forks source link

Unable to switch to WebView context on Android O #8958

Closed jbruckne closed 6 years ago

jbruckne commented 7 years ago

The problem

I have created a brand new empty android project and only added a WebView loading Amazon.com. All the test does is switch to the WebView context. This test works fine on Android 7.0 but hangs on Android O with the error message "chrome not reachable".

Environment

Details

The android app is a brand new android project with this onCreate method in the MainActivity:

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        WebView webview = new WebView(this);
        setContentView(webview);

        WebView.setWebContentsDebuggingEnabled(true);
        webview.setWebViewClient(new WebViewClient());
        webview.setEnabled(true);
        webview.loadUrl("http://www.amazon.com");
    }

The test to switch to webview context:


public class SimpleTest {

    protected AndroidDriver driver;

    protected void prepareAndroidForAppium() throws MalformedURLException {
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability("device", "Android");
        capabilities.setCapability("deviceName", "HT7150200171");
        //capabilities.setCapability("deviceName", "00eb9785375094e6");
        capabilities.setCapability("platformName", "Android");
        capabilities.setCapability("appPackage", "com.example.jbruckn.simplewebview");
        capabilities.setCapability("appActivity", "com.example.jbruckn.simplewebview.MainActivity");
        capabilities.setCapability("autoWebview", "true");
        driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
    }

    @Test
    public void test() throws MalformedURLException, InterruptedException {
        prepareAndroidForAppium();

        driver.context(driver.getContextHandles().toArray()[1].toString());
    }

}

Link to Appium logs

https://gist.github.com/jbruckne/3087a38fbb9a1e95c54ace809222c0a0

Each time the following request is made for the context switch, it hangs for about half a minute.

[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.example.jbruckn.simplewebview","androidUseRunningApp":true,"androidDeviceSerial":"HT7150200171"}}}
mykola-mokhnach commented 7 years ago

You probably need to try different chromedriver version.

jbruckne commented 7 years ago

I've tried the default and the newest 2.31

mykola-mokhnach commented 7 years ago

Are there any errors in adb logcat output?

jbruckne commented 7 years ago

No. Is there a way to see the chromedriver logs?

                            Process com.example.jbruckn.simplewebview created for activity com.example.jbruckn.simplewebview/.MainActivity
                            PID: 25608   UID:    GIDs: 

               zygote64  I  Late-enabling -Xcheck:jni
         WebViewFactory  I  Loading com.android.chrome version 59.0.3071.125 (code 307112552)
       cr_LibraryLoader  I  Time to load native libraries: 4 ms (timestamps 7160-7164)
               chromium  I  [INFO:library_loader_hooks.cc(144)] Chromium logging enabled: level = 0, default verbosity = 0
       cr_LibraryLoader  I  Expected native library version number "59.0.3071.125", actual native library version number "59.0.3071.125"
  cr_ChildConnAllocator  W  Create a new ChildConnectionAllocator with package name = com.android.chrome, inSandbox = true
      cr_BrowserStartup  I  Initializing chromium process, singleProcess=false
                 Adreno  I  QUALCOMM build                   : 7142022, Ib5823dd10c
                         I  Build Date                       : 06/23/17
                         I  OpenGL ES Shader Compiler Version: EV031.18.00.00
                         I  Local Branch                     : O11A
                         I  Remote Branch                    :
                         I  Remote Branch                    :
                         I  Reconstruct Branch               :
                         I  PFP: 0x005ff087, ME: 0x005ff063
               cr_media  W  Requires BLUETOOTH permission
         OpenGLRenderer  D  HWUI GL Pipeline
       cr_LibraryLoader  I  Using linker: org.chromium.base.library_loader.ModernLinker
         OpenGLRenderer  I  Initialized EGL, version 1.4
                         D  Swap behavior 2
      VideoCapabilities  W  Unrecognized profile 2130706433 for video/avc
                         W  Unrecognized profile 2130706434 for video/avc
                         I  Unsupported profile 4 for video/mp4v-es
  NetworkSecurityConfig  D  No Network Security Config specified, using platform default
               zygote64  I  Do partial code cache collection, code=30KB, data=28KB
                         I  After code cache collection, code=30KB, data=28KB
                         I  Increasing code cache capacity to 128KB
                         I  Do partial code cache collection, code=61KB, data=50KB
                         I  After code cache collection, code=61KB, data=50KB
                         I  Increasing code cache capacity to 256KB
                         I  Do full code cache collection, code=123KB, data=89KB
                         I  After code cache collection, code=114KB, data=68KB
                         I  Do partial code cache collection, code=122KB, data=73KB
                         I  After code cache collection, code=122KB, data=73KB
                         I  Increasing code cache capacity to 512KB

                            Process com.example.jbruckn.simplewebview (PID: 25608) ended
abhatt09 commented 7 years ago

can you try with chromeDriver 2.20 ? It works fine for me on Android 6.0 and 5.1.1

jbruckne commented 7 years ago

I just tried with 2.20, no change.

jbruckne commented 7 years ago

Were you able to reproduce my issue on your end with Android O?

abhatt09 commented 7 years ago

@jbruckne for us with CD 2.20 and Android 4.4.1 web-view is working fine. You might even want to refer to similar issue that was logged #8172 (can not switch to webview)

jbruckne commented 7 years ago

The issue I'm referring to is with Android O or Android 8.0 not 4.4. The issue you linked to didn't seem too similar outside of web view not working correctly.

jlipps commented 7 years ago

chrome not reachable is a chromedriver error. I'm not sure why you're experiencing it. What version of Chrome are you running on Android 0?

jbruckne commented 7 years ago

Chrome version 59.0.3061.125 is installed on the pixel I'm testing with. Is there a way to read the chromedriver logs from appium?

jbruckne commented 7 years ago

I also just updated to appium 1.6.6-beta4 with chromedriver 2.30 and there is no change. Still getting "chrome not reachable".

vrunoa commented 7 years ago

I'm able to reproduce the issue on Android O emulators, using the latest version of chromedriver(2.31) is also trowing chrome not reachable.

I'm also seeing it's failing to parse the webview name correctly(_["WEBVIEWundefined"])

[debug] [ADB] Running '/Users/vruno/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","shell","cat","/proc/net/unix"]

[debug] [AndroidDriver] WEBVIEW_4882 mapped to pid 4882
[debug] [AndroidDriver] Getting process name for webview
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/vruno/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","shell","ps"]

[debug] [AndroidDriver] Parsed pid: 4882 pkg: undefined!
[debug] [AndroidDriver] from: u0_a84,4882,1326,1531664,146444,0,R,com.saucelabs.android.emulators.test.app
[debug] [AndroidDriver] returning process name: undefined
[debug] [AndroidDriver] Found webviews: ["WEBVIEW_undefined"]
[debug] [AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_undefined"]
[debug] [MJSONWP] Responding to client with driver.getContexts() result: ["NATIVE_APP","WEBVIEW_undefined"]
[HTTP] <-- GET /wd/hub/session/80f104e9-b42b-4e5d-9c00-ae4d8e0ead2b/contexts 200 256 ms - 106
[HTTP] --> POST /wd/hub/session/80f104e9-b42b-4e5d-9c00-ae4d8e0ead2b/context {"sessionId":"80f104e9-b42b-4e5d-9c00-ae4d8e0ead2b","name":"WEBVIEW_undefined"}
[debug] [MJSONWP] Calling AppiumDriver.setContext() with args: ["WEBVIEW_undefined","80f104e9-b42b-4e5d-9c00-ae4d8e0ead2b"]
[debug] [AndroidDriver] Getting a list of available webviews
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/vruno/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","shell","cat","/proc/net/unix"]
[debug] [AndroidDriver] WEBVIEW_4882 mapped to pid 4882
[debug] [AndroidDriver] Getting process name for webview
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/vruno/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","shell","ps"]
[debug] [AndroidDriver] Parsed pid: 4882 pkg: undefined!
[debug] [AndroidDriver] from: u0_a84,4882,1326,1531664,146516,0,R,com.saucelabs.android.emulators.test.app
[debug] [AndroidDriver] returning process name: undefined
[debug] [AndroidDriver] Found webviews: ["WEBVIEW_undefined"]
[debug] [AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_undefined"]
[debug] [AndroidDriver] Connecting to chrome-backed webview context 'WEBVIEW_undefined'
[debug] [AndroidDriver] A port was not given, using random port: 8001

Chrome tests in Android O are working, no chromedriver update needed. So this issue is only for webviews.

vrunoa commented 7 years ago

Run a test on my Google Pixel with Android 7.1.2 - chrome webview 59 and it works, so I guess it's something specific to Android O and maybe not chrome or chromedriver (?)

jbruckne commented 7 years ago

Any update? Android O will be launching today so this is a high priority issue with my team. Am I able to retrieve the Chromedriver logs from an appium run?

RealLau commented 7 years ago

Same issue: Android 5.1.1 & Appium@1.6.5 & Chromedriver(2.24/2.31/2.30 all tried) & Chrome Browser(60.0.3112.78 64bit).

jlipps commented 7 years ago

Looks like we need to revisit our webview process parsing in Android O. I bet the process output format changed (we're getting undefined instead of com.saucelabs.android.emulators.test.app). Going to add this to our tracker to investigate.

RealLau commented 7 years ago

@jlipps Thanks for the reply. I don't know much about android O, but I'd like to offer an info: the app which I'm testing is developing by this way: one process is the app main process, the other(webview process) will be created only when the webview is needed, and after that, the webview process will be force killed.

above, Just for ur reference only. :)

rachuta commented 7 years ago

webview process names are not listing from "adb shell ps" command

I am using the latest ADB and when I ran the above command, I get all the process names.

Starting ChromeDriver 2.32.498537 (cb2f855cbc7b82e20387eaf9a43f6b99b6105061) on port 7205
Only local connections are allowed.
[7.146][INFO]: COMMAND InitSession {
   "desiredCapabilities": {
      "chromeOptions": {
         "androidDeviceSerial": "FA6990300756",
         "androidPackage": "com.amazon.mShop.android.shopping",
         "androidUseRunningApp": true
      }
   }
}
[7.147][DEBUG]: Sending adb command: host:devices
[7.147][DEBUG]: Received adb response: FA6A10316245 device
FA6990300756    device

[7.147][DEBUG]: Sending adb command: host:transport:FA6990300756|shell:pm path com.amazon.mShop.android.shopping
[7.708][DEBUG]: Received adb response: package:/data/app/com.amazon.mShop.android.shopping-d4T8uh-Dlyu4UsvIpkoLFQ==/base.apk

[7.708][DEBUG]: Sending adb command: host:transport:FA6990300756|shell:ps
[7.860][DEBUG]: Received adb response: USER           PID  PPID     VSZ    RSS WCHAN            ADDR S NAME
shell        10086   658   10212   2044 0          70170530f8 R ps

[7.861][DEBUG]: DevTools request: http://localhost:12698/json/version
[7.864][DEBUG]: DevTools request failed
[7.915][DEBUG]: DevTools request: http://localhost:12698/json/version
[7.916][DEBUG]: DevTools request failed
[7.966][DEBUG]: DevTools request: http://localhost:12698/json/version
[7.967][DEBUG]: DevTools request failed
[8.017][DEBUG]: DevTools request: http://localhost:12698/json/version
[8.018][DEBUG]: DevTools request failed
[8.068][DEBUG]: DevTools request: http://localhost:12698/json/version
[8.070][DEBUG]: DevTools request failed
imurchie commented 7 years ago

Does this continue with the full Android O release? I can get webview contexts on a Pixel running Android 8.0.0.

imurchie commented 7 years ago

Hmmm. Might have spoken too soon. I can see the webviews, but ChromeDriver still does not want to connect.

vrunoa commented 7 years ago

@imurchie same problem on my Pixel 😞, also with chromedriver 2.31

imurchie commented 7 years ago

I've confirmed that Chromedriver by itself fails in this situation. I've opened a ticket there and am experimenting further locally.

https://bugs.chromium.org/p/chromedriver/issues/detail?id=2013

yongchristophertang commented 7 years ago

Also encounter this issue. But I am not testing on Android O. I am testing Android 5.1.1 and using the chromedriver 2.28. But the weirdest thing is I have two cases on the same app and same device which both launch the webview page for testing. The results were that one succeeded while the other failed...

The Appium logs are:

[Chromedriver] Error: chrome not reachable
  (Driver info: chromedriver=2.28.455517 (2c6d2707d8ea850c862f04ac066724273981e88f),platform=Mac OS X 10.11.6 x86_64)
    at Chromedriver.callee$2$0$ (../../lib/chromedriver.js:176:15)
    at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
imurchie commented 7 years ago

@yongchristophertang Please create a new issue with the full description including the full logs. This issue is specifically about Android O.

MeghanaBK commented 7 years ago

Hi all, am facing the same issue on my Android 8.0.0 Pixel device. Every time I run my test, app gets installed but fails to login and shows 'Chrome not reachable' in Appium logs. Any solution found please do share.

Here are the capabilities>> [Appium] appPackage: ‘com.ACTUAL.APP_PACKAGEID’ [Appium] appActivity: ‘com.ACTUAL.APP_PACKAGEID.activity.LauncherActivity’ [Appium] platformVersion: ‘8.0.0’ [Appium] browserName: ‘Chrome’ [Appium] platformName: ‘Android’ [Appium] deviceName: ‘Pixel’ [AndroidDriver] AndroidDriver version: 1.20.0

Chrome Version used in device: 60.0.3112.116 Appium Version used: 1.6.5, 1.7.0-beta MAC OS version used to run Appium: 10.11.6

imurchie commented 7 years ago

The solution is to build a custom version of Chromedriver, unfortunately. They are aware of the problem.

lanzelot1989 commented 6 years ago

Is it possible that this has been introduced with a update of the system images of the Android SDK/emulators?

I did not have this problem with a 7.1.1 emulator before updating the SDKs, now I have it with every new emulator I create.

Driver.Contexts (C#) always returns "Found webviews: []" in the logs.

imurchie commented 6 years ago

If you update Appium to the latest (npm uninstall -g appium && npm install -g appium@beta) you will get Chromedriver 2.33, which can handle Android O webviews.

Alternatively, you can update Chromedriver using one of the methods here: https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/web/chromedriver.md

lanzelot1989 commented 6 years ago

Thanks @imurchie, but it turns out that we had to set this setting. This is documented well, but we forgot to do this. It worked until we updated to the latest Android SDK/emulator system images (I am guessing that some kind of security patch may has had an influence here).

imurchie commented 6 years ago

So.. it works or it does not, to automate with Appium 1.7.1?

lanzelot1989 commented 6 years ago

Short answer: Yes, it works now, running Android 7.1.1 and Appium 1.7.1.

dpgraham commented 6 years ago

Re-opening. I'm having this issue with 1.7.1 on Pixel O emulator.

dpgraham commented 6 years ago

The issue was that my Android O emulator had a version of Chrome < 60

vrunoa commented 6 years ago

@dpgraham sad to hear this, chrome 58 is the default for android O

dpgraham commented 6 years ago

Yeah this is a pretty big problem. @vrunoa do you have any ideas for a workaround?

HSerg commented 6 years ago

Workarounds for emulator:

  1. Upgrade Chrome to Chrome 60+ (via adb -e shell pm install -r ...)
  2. Use "platforms;android-27" & "system-images;android-27;google_apis;x86"
ruberzen commented 6 years ago

I´m using Chrome 62 on a emulator with android API 27 x86 is available the webview context:

[ADB] Running 'c:\Users\rgranados\AppData\Local\Android\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","cat","/proc/net/unix"] [AndroidDriver] Found webviews: ["WEBVIEW_chrome"] [AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_chrome"] [AndroidDriver] Connecting to chrome-backed webview context 'WEBVIEW_chrome' [AndroidDriver] A port was not given, using random port: 8000 [Chromedriver] Changed state to 'starting' [Chromedriver] Set chromedriver binary as: C:\Users\rgranados\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win\chromedriver.exe

BUT now, and again, I have the "chrome not reachable" problem:

[JSONWP Proxy] Got response with status 200: {"sessionId":"cb9c76c1f33e6745d8e96cad81ade9d1","status":100,"value":{"message":"chrome not reachable\n (Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 6.1.7601 SP1 x86_64)"}} [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.pagatodo.marabunta.dolphy","androidUseRunningApp":true,"androidDeviceSerial":"emulator-5554"},"loggingPrefs":{"performance":"ALL"}}}

The app was showing Twitter login on the webview.

For someone else does this problem continue to occur?

HSerg commented 6 years ago

@ruberzen, check driver.getCurrentPackage().

FA-tvonmoll commented 6 years ago

Same (or similar) issue. Attempting to switch to the web context results in chrome not reachable. Appium hangs indefinitely (I've been killing it after a few minutes of no activity) after the point in the logs below.

[debug] [MJSONWP] Calling AppiumDriver.setContext() with args: ["WEBVIEW_chrome","d6a8da73-4887-48f9-a2b2-8a54bf9f275c"]
[debug] [AndroidDriver] Getting a list of available webviews
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/xxxxxxxx/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","shell","cat","/proc/net/unix"]
[debug] [AndroidDriver] Found webviews: ["WEBVIEW_chrome"]
[debug] [AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_chrome"]
[debug] [AndroidDriver] Connecting to chrome-backed webview context 'WEBVIEW_chrome'
[debug] [AndroidDriver] A port was not given, using random port: 8001
[debug] [Chromedriver] Changed state to 'starting'
[Chromedriver] Set chromedriver binary as: /usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver
[debug] [Chromedriver] Killing any old chromedrivers, running: pkill -15 -f "/usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver.*--port=8001"
[Chromedriver] No old chromedrivers seemed to exist
[debug] [Chromedriver] Cleaning any old adb forwarded port socket connections
[debug] [ADB] List forwarding ports
[debug] [ADB] Running '/Users/xxxxxxx/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","forward","--list"]
[Chromedriver] Spawning chromedriver with: /usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver --url-base=wd/hub --port=8001 --adb-port=5037 --verbose
[debug] [Chromedriver] Chromedriver version: '2.33.506106'
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8001/wd/hub/status] with no body
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8001/wd/hub/status] with no body
[debug] [JSONWP Proxy] Got response with status 200: "{\"sessionId\":\"\",\"status\":0,\"value\":{\"build\":{\"version\":\"alpha\"},\"os\":{\"arch\":\"x86_64\",\"name\":\"Mac OS X\",\"version\":\"10.12.6\"}}}"
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8001/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"XXXXXXXXXX","androidUseRunningApp":true,"androidDeviceSerial":"emulator-5554"}}}
[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"32bcfc89eda41d9b52a64079191bb06a","status":100,"value":{"message":"chrome not reachable\n  (Driver info: chromedriver=2.33.506106 (8a06c39c4582fbfbab6966dbb1c38a9173bfb1a2),platform=Mac OS X 10.12.6 x86_64)"}}
[Chromedriver] Error: Failed to start Chromedriver session: An error occurred (Original error: chrome not reachable
  (Driver info: chromedriver=2.33.506106 (8a06c39c4582fbfbab6966dbb1c38a9173bfb1a2),platform=Mac OS X 10.12.6 x86_64))
    at Object.wrappedLogger.errorAndThrow (/usr/local/lib/node_modules/appium/node_modules/appium-support/lib/logging.js:69:13)
    at Chromedriver.callee$2$0$ (/usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/lib/chromedriver.js:217:13)
    at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
    at <anonymous>
 Error: Failed to start Chromedriver session: An error occurred (Original error: chrome not reachable
  (Driver info: chromedriver=2.33.506106 (8a06c39c4582fbfbab6966dbb1c38a9173bfb1a2),platform=Mac OS X 10.12.6 x86_64))
    at Object.wrappedLogger.errorAndThrow (/usr/local/lib/node_modules/appium/node_modules/appium-support/lib/logging.js:69:13)
    at Chromedriver.callee$2$0$ (/usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/lib/chromedriver.js:217:13)
    at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
    at <anonymous>
pankajmeel06 commented 6 years ago

Hi, I need help in automating Android O web views. I have tried below combinations: chromedriver2.34 —> 61.0.3163.98 —> Not working chromedriver2.33 —> 60.0.3112.116 —> Not working chromedriver2.33 —> 61.0.3163.81 —> Not working Please help me if any one has got working web view with chrome apk/chrome driver combination?

kirillbilchenko commented 6 years ago

the same any luck with this problem?

HSerg commented 6 years ago

For some applications - the app-webview should be searched using the com.android.chrome package (i.e. not application packages). This can be checked via driver.getCurrentPackage(). P.S. extractChromeAndroidPackageFromContextName capability works similar, but does not help.

kirillbilchenko commented 6 years ago

I see exactly the same behaviour on my real device, asus nexus 7 I have two contexts available for switching directly to application, that are not main target in capabilities. Appium logs:

[MJSONWP] Calling AppiumDriver.setContext() with args: ["NATIVE_APP","afd394e8-29d7-4a69-a7fc-3a0196c71d83"]
[AndroidDriver] Getting a list of available webviews
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running '/Users/xxx/Documents/AndroidSDK/android-sdk-macosx/platform-tools/adb' with args: ["-P",5037,"-s","077b69b8","shell","cat","/proc/net/unix"]
[AndroidDriver] Found webviews: []
[AndroidDriver] Available contexts: ["NATIVE_APP"]
[MJSONWP] Responding to client with driver.setContext() result: null
[HTTP] <-- POST /wd/hub/session/afd394e8-29d7-4a69-a7fc-3a0196c71d83/context 200 78 ms - 76 
[HTTP] --> GET /wd/hub/session/afd394e8-29d7-4a69-a7fc-3a0196c71d83/contexts {}
[MJSONWP] Calling AppiumDriver.getContexts() with args: ["afd394e8-29d7-4a69-a7fc-3a0196c71d83"]
[AndroidDriver] Getting a list of available webviews
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running '/Users/xxx/Documents/AndroidSDK/android-sdk-macosx/platform-tools/adb' with args: ["-P",5037,"-s","077b69b8","shell","cat","/proc/net/unix"]
[AndroidDriver] Found webviews: ["WEBVIEW_chrome"]
[AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_chrome"]
[MJSONWP] Responding to client with driver.getContexts() result: ["NATIVE_APP","WEBVIEW_chrome"]
[HTTP] <-- GET /wd/hub/session/afd394e8-29d7-4a69-a7fc-3a0196c71d83/contexts 200 188 ms - 103 
[HTTP] --> POST /wd/hub/session/afd394e8-29d7-4a69-a7fc-3a0196c71d83/context {"name":"WEBVIEW_chrome"}
[MJSONWP] Calling AppiumDriver.setContext() with args: ["WEBVIEW_chrome","afd394e8-29d7-4a69-a7fc-3a0196c71d83"]
[AndroidDriver] Getting a list of available webviews
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running '/Users/xxx/Documents/AndroidSDK/android-sdk-macosx/platform-tools/adb' with args: ["-P",5037,"-s","077b69b8","shell","cat","/proc/net/unix"]
[AndroidDriver] Found webviews: ["WEBVIEW_chrome"]
[AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_chrome"]
[AndroidDriver] Connecting to chrome-backed webview context 'WEBVIEW_chrome'
[Chromedriver] Changed state to 'starting'
[Chromedriver] Set chromedriver binary as: /usr/local/Cellar/chromedriver/2.35/bin/chromedriver
[Chromedriver] Killing any old chromedrivers, running: pkill -15 -f "/usr/local/Cellar/chromedriver/2.35/bin/chromedriver.*--port=9515"
[Chromedriver] No old chromedrivers seemed to exist
[Chromedriver] Cleaning any old adb forwarded port socket connections
[ADB] List forwarding ports
[ADB] Running '/Users/xxx/Documents/AndroidSDK/android-sdk-macosx/platform-tools/adb' with args: ["-P",5037,"-s","077b69b8","forward","--list"]
[ADB] Removing forwarded port socket connection: 12537 
[ADB] Running '/Users/xxx/Documents/AndroidSDK/android-sdk-macosx/platform-tools/adb' with args: ["-P",5037,"-s","077b69b8","forward","--remove","tcp:12537"]
[Chromedriver] Spawning chromedriver with: /usr/local/Cellar/chromedriver/2.35/bin/chromedriver --url-base=wd/hub --port=9515 --adb-port=5037 --verbose
[Chromedriver] Chromedriver version: '2.35.528157'
[Chromedriver] [STDOUT] Starting ChromeDriver 2.35.528157 (4429ca2590d6988c0745c24c8858745aaaec01ef) on port 9515
[Chromedriver] [STDOUT] Only local connections are allowed.
[JSONWP Proxy] Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
[JSONWP Proxy] Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
[JSONWP Proxy] Got response with status 200: "{\"sessionId\":\"\",\"status\":0,\"value\":{\"build\":{\"version\":\"alpha\"},\"os\":{\"arch\":\"x86_64\",\"name\":\"Mac OS X\",\"version\":\"10.13.2\"}}}"
[JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"xxx.xxxx.xxxx","androidUseRunningApp":true,"androidDeviceSerial":"077b69b8"}}}
[Chromedriver] [STDERR] [1516218978.651][INFO]: COMMAND InitSession {
[Chromedriver] [STDERR]    "desiredCapabilities": {
[Chromedriver] [STDERR]       "chromeOptions": {
[Chromedriver] [STDERR]          "androidDeviceSerial": "077b69b8",
[Chromedriver] [STDERR]          "androidPackage": "xxx.xxxx.xxxx",
[Chromedriver] [STDERR]          "androidUseRunningApp": true
[Chromedriver] [STDERR]       }
[Chromedriver] [STDERR]    }
[Chromedriver] [STDERR] }
[Chromedriver] [STDERR] [1516218978.652][DEBUG]: Sending adb command: host:devices
[Chromedriver] [STDERR] [1516218978.652][DEBUG]: Received adb response: 077b69b8    device
[Chromedriver] [STDERR] [1516218978.652][DEBUG]: Sending adb command: host:transport:077b69b8|shell:pm path xxx.xxxx.xxxx
[Chromedriver] [STDERR] [1516218979.845][DEBUG]: Received adb response: package:/data/app/xxx.xxxx.xxxx-1/base.apk
[Chromedriver] [STDERR] [1516218979.845][DEBUG]: Sending adb command: host:transport:077b69b8|shell:ps && ps -A
[Chromedriver] [STDERR] [1516218979.954][DEBUG]: Received adb response: USER      PID   PPID  VSIZE  RSS   WCHAN            PC  NAME
[Chromedriver] [STDERR] root      1     0     2216   868   sys_epoll_ 00000000 S /init
[Chromedriver] [STDERR] root      2     0     0      0       kthreadd 00000000 S kthreadd
[Chromedriver] [STDERR] root      3     2     0      0     run_ksofti 00000000 S ksoftirqd/0
[Chromedriver] [STDERR] root      6     2     0      0     cpu_stoppe 00000000 S migration/0
[Chromedriver] [STDERR] root      16    2     0      0     rescuer_th 00000000 S khelper
[Chromedriver] [STDERR] root      17    2     0      0     rescuer_th 00000000 S suspend_sys_syn
[Chromedriver] [STDERR] root      18    2     0      0     rescuer_th 00000000 S suspend
[Chromedriver] [STDERR] root      23    2     0      0     irq_thread 00000000 S irq/203-msmdata
[Chromedriver] [STDERR] root      24    2     0      0     bdi_sync_s 00000000 S sync_supers
[Chromedriver] [STDERR] root      25    2     0      0     bdi_forker 00000000 S bdi-default
[Chromedriver] [STDERR] root      26    2     0      0     rescuer_th 00000000 S kblockd
[Chromedriver] [STDERR] root      27    2     0      0     msm_slim_r 00000000 S msm_slim_ctrl_r
[Chromedriver] [STDERR] root      28    2     0      0     hub_thread 00000000 S khubd
[Chromedriver] [STDERR] root      29    2     0      0     irq_thread 00000000 S irq/84-msm_iomm
[Chromedriver] [STDERR] root      30    2     0      0     irq_thread 00000000 S irq/84-msm_iomm
[Chromedriver] [STDERR] root      31    2     0      0     irq_thread 00000000 S irq/96-msm_iomm
[Chromedriver] [STDERR] root      32    2     0      0     irq_thread 00000000 S irq/96-msm_iomm
[Chromedriver] [STDERR] root      33    2     0      0     irq_thread 00000000 S irq/94-msm_iomm
[Chromedriver] [STDERR] root      34    2     0      0     irq_thread 00000000 S irq/94-msm_iomm
[Chromedriver] [STDERR] root      35    2     0      0     irq_thread 00000000 S irq/92-msm_iomm
[Chromedriver] [STDERR] root      36    2     0      0     irq_thread 00000000 S irq/92-msm_iomm
[Chromedriver] [STDERR] root      37    2     0      0     irq_thread 00000000 S irq/100-msm_iom
[Chromedriver] [STDERR] root      38    2     0      0     irq_thread 00000000 S irq/100-msm_iom
[Chromedriver] [STDERR] root      39    2     0      0     irq_thread 00000000 S irq/86-msm_iomm
[Chromedriver] [STDERR] root      40    2     0      0     irq_thread 00000000 S irq/86-msm_iomm
[Chromedriver] [STDERR] root      41    2     0      0     irq_thread 00000000 S irq/90-msm_iomm
[Chromedriver] [STDERR] root      42    2     0      0     irq_thread 00000000 S irq/90-msm_iomm
[Chromedriver] [STDERR] root      43    2     0      0     irq_thread 00000000 S irq/88-msm_iomm
[Chromedriver] [STDERR] root      44    2     0      0     irq_thread 00000000 S irq/102-msm_iom
[Chromedriver] [STDERR] root      45    2     0      0     irq_thread 00000000 S irq/102-msm_iom
[Chromedriver] [STDERR] root      46    2     0      0     irq_thread 00000000 S irq/98-msm_iomm
[Chromedriver] [STDERR] root      47    2     0      0     irq_thread 00000000 S irq/98-msm_iomm
[Chromedriver] [STDERR] root      48    2     0      0     irq_thread 00000000 S irq/243-msm_iom
[Chromedriver] [STDERR] root      49    2     0      0     irq_thread 00000000 S irq/243-msm_iom
[Chromedriver] [STDERR] root      50    2     0      0     irq_thread 00000000 S irq/269-msm_iom
[Chromedriver] [STDERR] root      51    2     0      0     irq_thread 00000000 S irq/269-msm_iom
[Chromedriver] [STDERR] root      52    2     0      0     rescuer_th 00000000 S l2cap
[Chromedriver] [STDERR] root      53    2     0      0     rescuer_th 00000000 S a2mp
[Chromedriver] [STDERR] root      54    2     0      0     rescuer_th 00000000 S cfg80211
[Chromedriver] [STDERR] root      55    2     0      0     rescuer_th 00000000 S rpciod
[Chromedriver] [STDERR] root      57    2     0      0     rescuer_th 00000000 S modem_notifier
[Chromedriver] [STDERR] root      58    2     0      0     rescuer_th 00000000 S smd_channel_clo
[Chromedriver] [STDERR] root      59    2     0      0     rescuer_th 00000000 S smsm_cb_wq
[Chromedriver] [STDERR] root      61    2     0      0     rescuer_th 00000000 S qmi
[Chromedriver] [STDERR] root      62    2     0      0     rescuer_th 00000000 S nmea
[Chromedriver] [STDERR] root      63    2     0      0     rescuer_th 00000000 S msm_ipc_router
[Chromedriver] [STDERR] root      64    2     0      0     rescuer_th 00000000 S apr_driver
[Chromedriver] [STDERR] root      65    2     0      0         kswapd 00000000 S kswapd0
[Chromedriver] [STDERR] root      66    2     0      0     fsnotify_m 00000000 S fsnotify_mark
[Chromedriver] [STDERR] root      67    2     0      0     rescuer_th 00000000 S nfsiod
[Chromedriver] [STDERR] root      68    2     0      0     rescuer_th 00000000 S cifsiod
[Chromedriver] [STDERR] root      69    2     0      0     rescuer_th 00000000 S crypto
[Chromedriver] [STDERR] root      84    2     0      0     rescuer_th 00000000 S mdp_dma_wq
[Chromedriver] [STDERR] root      85    2     0      0     rescuer_th 00000000 S mdp_vsync_wq
[Chromedriver] [STDERR] root      86    2     0      0     rescuer_th 00000000 S mdp_pipe_ctrl_w
[Chromedriver] [STDERR] root      87    2     0      0     rescuer_th 00000000 S mdp_cursor_ctrl
[Chromedriver] [STDERR] root      88    2     0      0     msm_fb_com 00000000 S msmfb_commit_th
[Chromedriver] [STDERR] root      89    2     0      0     rescuer_th 00000000 S hdmi_hdcp
[Chromedriver] [STDERR] root      90    2     0      0     irq_thread 00000000 S irq/111-hdmi_ms
[Chromedriver] [STDERR] root      91    2     0      0     rescuer_th 00000000 S dtv_work
[Chromedriver] [STDERR] root      92    2     0      0     msm_fb_com 00000000 S msmfb_commit_th
[Chromedriver] [STDERR] root      93    2     0      0     rescuer_th 00000000 S vidc_worker_que
[Chromedriver] [STDERR] root      94    2     0      0     rescuer_th 00000000 S vidc_timer_wq
[Chromedriver] [STDERR] root      95    2     0      0     rescuer_th 00000000 S smux_notify_wq
[Chromedriver] [STDERR] root      96    2     0      0     rescuer_th 00000000 S smux_tx_wq
[Chromedriver] [STDERR] root      97    2     0      0     rescuer_th 00000000 S smux_rx_wq
[Chromedriver] [STDERR] root      98    2     0      0     rescuer_th 00000000 S smux_loopback_w
[Chromedriver] [STDERR] root      99    2     0      0     rescuer_th 00000000 S diag_wq
[Chromedriver] [STDERR] root      100   2     0      0     rescuer_th 00000000 S hsic_diag_wq
[Chromedriver] [STDERR] root      101   2     0      0     rescuer_th 00000000 S hsic_2_diag_wq
[Chromedriver] [STDERR] root      102   2     0      0     rescuer_th 00000000 S smux_diag_wq
[Chromedriver] [STDERR] root      103   2     0      0     rescuer_th 00000000 S diag_cntl_wq
[Chromedriver] [STDERR] root      104   2     0      0     rescuer_th 00000000 S diag_dci_wq
[Chromedriver] [STDERR] root      105   2     0      0     rescuer_th 00000000 S kgsl-3d0
[Chromedriver] [STDERR] root      106   2     0      0     rescuer_th 00000000 S anx7808_work
[Chromedriver] [STDERR] root      107   2     0      0     irq_thread 00000000 S irq/295-anx7808
[Chromedriver] [STDERR] root      110   2     0      0     irq_thread 00000000 S irq/330-wcd9xxx
[Chromedriver] [STDERR] root      111   2     0      0     rescuer_th 00000000 S spi_qsd.0
[Chromedriver] [STDERR] root      114   2     0      0     rescuer_th 00000000 S usbnet
[Chromedriver] [STDERR] root      115   2     0      0     rescuer_th 00000000 S smb345_wq
[Chromedriver] [STDERR] root      117   2     0      0     rescuer_th 00000000 S bq27541_battery
[Chromedriver] [STDERR] root      118   2     0      0     rescuer_th 00000000 S msm_otg_acok_wq
[Chromedriver] [STDERR] root      119   2     0      0     rescuer_th 00000000 S msm_otg_id_pin_
[Chromedriver] [STDERR] root      120   2     0      0     rescuer_th 00000000 S mdm_bridge
[Chromedriver] [STDERR] root      121   2     0      0     rescuer_th 00000000 S ks_bridge:1
[Chromedriver] [STDERR] root      122   2     0      0     rescuer_th 00000000 S ks_bridge:2
[Chromedriver] [STDERR] root      123   2     0      0     rescuer_th 00000000 S ks_bridge:3
[Chromedriver] [STDERR] root      124   2     0      0     rescuer_th 00000000 S ks_bridge:4
[Chromedriver] [STDERR] root      125   2     0      0     rescuer_th 00000000 S k_rmnet_mux_wor
[Chromedriver] [STDERR] root      126   2     0      0     rescuer_th 00000000 S f_mtp
[Chromedriver] [STDERR] root      127   2     0      0     sleep_thre 00000000 S file-storage
[Chromedriver] [STDERR] root      128   2     0      0     rescuer_th 00000000 S uether
[Chromedriver] [STDERR] root      129   2     0      0     rescuer_th 00000000 S kpsmoused
[Chromedriver] [STDERR] root      130   2     0      0     rescuer_th 00000000 S elan_wq
[Chromedriver] [STDERR] root      131   2     0      0     rescuer_th 00000000 S i2c_touchsensor
[Chromedriver] [STDERR] root      132   2     0      0     rescuer_th 00000000 S lid_wq
[Chromedriver] [STDERR] root      133   2     0      0     rescuer_th 00000000 S dvfs_test_workq
[Chromedriver] [STDERR] root      134   2     0      0     dbs_sync_t 00000000 D dbs_sync/0
[Chromedriver] [STDERR] root      135   2     0      0     dbs_sync_t 00000000 D dbs_sync/1
[Chromedriver] [STDERR] root      136   2     0      0     dbs_sync_t 00000000 D dbs_sync/2
[Chromedriver] [STDERR] root      137   2     0      0     dbs_sync_t 00000000 D dbs_sync/3
[Chromedriver] [STDERR] root      138   2     0      0     cpufreq_in 00000000 S kinteractiveup
[Chromedriver] [STDERR] root      139   2     0      0     rescuer_th 00000000 S binder
[Chromedriver] [STDERR] root      141   2     0      0     mmc_queue_ 00000000 S mmcqd/0
[Chromedriver] [STDERR] root      143   2     0      0     rescuer_th 00000000 S detection
[Chromedriver] [STDERR] root      144   2     0      0     rescuer_th 00000000 S button_press
[Chromedriver] [STDERR] root      145   2     0      0     rescuer_th 00000000 S button_release
[Chromedriver] [STDERR] root      146   2     0      0     rfcomm_run 00000000 S krfcommd
[Chromedriver] [STDERR] root      147   2     0      0     rescuer_th 00000000 S msm-cpufreq
[Chromedriver] [STDERR] root      148   2     0      0     rescuer_th 00000000 S rq_stats
[Chromedriver] [STDERR] root      149   2     0      0     rescuer_th 00000000 S deferwq
[Chromedriver] [STDERR] root      150   1     1956   636   poll_sched 00000000 S /sbin/ueventd
[Chromedriver] [STDERR] root      152   2     0      0     rescuer_th 00000000 S ext4-dio-unwrit
[Chromedriver] [STDERR] root      155   2     0      0     bdi_writeb 00000000 S flush-179:0
[Chromedriver] [STDERR] root      157   2     0      0     kjournald2 00000000
[Chromedriver] [STDERR] S jbd2/mmcblk0p23
[Chromedriver] [STDERR] root      158   2     0      0     rescuer_th 00000000 S ext4-dio-unwrit
[Chromedriver] [STDERR] root      162   2     0      0     kjournald2 00000000 S jbd2/mmcblk0p30
[Chromedriver] [STDERR] root      163   2     0      0     rescuer_th 00000000 S ext4-dio-unwrit
[Chromedriver] [STDERR] root      164   2     0      0     kjournald2 00000000 S jbd2/mmcblk0p4-
[Chromedriver] [STDERR] root      165   2     0      0     rescuer_th 00000000 S ext4-dio-unwrit
[Chromedriver] [STDERR] root      171   2     0      0     rescuer_th 00000000 S IPCRTR
[Chromedriver] [STDERR] root      172   2     0      0     rescuer_th 00000000 S ipc_rtr_q6_ipcr
[Chromedriver] [STDERR] logd      173   1     15564  3996  sys_rt_sig 00000000 S /system/bin/logd
[Chromedriver] [STDERR] root      174   1     9136   2036  hrtimer_na 00000000 S /system/bin/vold
[Chromedriver] [STDERR] root      179   2     0      0     kauditd_th 00000000 S kauditd
[Chromedriver] [STDERR] root      184   1     2456   384   sys_epoll_ 00000000 S /sbin/healthd
[Chromedriver] [STDERR] root      185   1     3064   1088  sys_epoll_ 00000000 S /system/bin/lmkd
[Chromedriver] [STDERR] system    186   1     2948   1084  binder_thr 00000000 S /system/bin/servicemanager
[Chromedriver] [STDERR] system    187   1     164740 8776  sys_epoll_ 00000000 S /system/bin/surfaceflinger
[Chromedriver] [STDERR] root      189   1     17224  1788  hrtimer_na 00000000 S /system/bin/netd
[Chromedriver] [STDERR] root      190   1     3688   1460  __skb_recv 00000000 S /system/bin/debuggerd
[Chromedriver] [STDERR] drm       193   1     15848  2900  binder_thr 00000000 S /system/bin/drmserver
[Chromedriver] [STDERR] root      196   1     3000   1332  unix_strea 00000000 S /system/bin/installd
[Chromedriver] [STDERR] keystore  198   1     5760   2072  binder_thr 00000000 S /system/bin/keystore
[Chromedriver] [STDERR] nobody    200   1     8008   1236  poll_sched 00000000 S /system/bin/rmt_storage
[Chromedriver] [STDERR] radio     201   1     6232   892   futex_wait 00000000 S /system/bin/bridgemgrd
[Chromedriver] [STDERR] root      202   1     25300  1148  futex_wait 00000000 S /system/bin/thermald
[Chromedriver] [STDERR] root      203   1     9496   1108  futex_wait 00000000 S /system/bin/mpdecision
[Chromedriver] [STDERR] root      205   1     1504900 37744 poll_sched 00000000 S zygote
[Chromedriver] [STDERR] system    206   1     5268   1428  binder_thr 00000000 S /system/bin/gatekeeperd
[Chromedriver] [STDERR] camera    208   1     17156  2720  poll_sched 00000000 S /system/bin/mm-qcamera-daemon
[Chromedriver] [STDERR] system    210   1     4140   1128     do_wait 00000000 S /system/bin/qseecomd
[Chromedriver] [STDERR] shell     211   1     12228  620   poll_sched 00000000 S /sbin/adbd
[Chromedriver] [STDERR] system    224   210   6256   696   sys_rt_sig 00000000 S /system/bin/qseecomd
[Chromedriver] [STDERR] system    629   205   1739052 122896 sys_epoll_ 00000000 S system_server
[Chromedriver] [STDERR] root      832   2     0      0     VosWDThrea 00000000 S WD_Thread
[Chromedriver] [STDERR] root      833   2     0      0     VosMCThrea 00000000 S MC_Thread
[Chromedriver] [STDERR] root      834   2     0      0     VosTXThrea 00000000 S TX_Thread
[Chromedriver] [STDERR] root      835   2     0      0     VosRXThrea 00000000 S RX_Thread
[Chromedriver] [STDERR] wifi      854   1     5996   2280  poll_sched 00000000 S /system/bin/wpa_supplicant
[Chromedriver] [STDERR] media_rw  857   174   7016   2168  inotify_re 00000000 S /system/bin/sdcard
[Chromedriver] [STDERR] u0_a20    873   205   1004072 86648 sys_epoll_ 00000000 S com.android.systemui
[Chromedriver] [STDERR] shell     1332  211   3304   1228  __skb_recv b6df7900 S logcat
[Chromedriver] [STDERR] u0_a22    1388  205   1641380 33024 sys_epoll_ 00000000 S com.google.android.googlequicksearchbox:interactor
[Chromedriver] [STDERR] u0_a53    1403  205   1006760 77300 sys_epoll_ 00000000 S com.google.android.inputmethod.latin
[Chromedriver] [STDERR] root      1433  2     0      0     rescuer_th 00000000 S IPCRTR
[Chromedriver] [STDERR] root      1434  2     0      0     rescuer_th 00000000 S ipc_rtr_smd_ipc
[Chromedriver] [STDERR] u0_a7     1451  205   1046816 94672 sys_epoll_ 00000000 S com.google.android.gms.persistent
[Chromedriver] [STDERR] nfc       1459  205   874572 38872 sys_epoll_ 00000000 S com.android.nfc
[Chromedriver] [STDERR] u0_a77    1483  205   855636 26732 sys_epoll_ 00000000 S com.nuance.xt9.input
[Chromedriver] [STDERR] radio     1496  205   876824 43260 sys_epoll_ 00000000 S com.android.phone
[Chromedriver] [STDERR] u0_a12    1512  205   1722892 113840 sys_epoll_ 00000000 S com.android.launcher
[Chromedriver] [STDERR] system    1995  205   854764 30896 sys_epoll_ 00000000 S com.android.keychain
[Chromedriver] [STDERR] u0_a16    2017  205   1144824 123336 sys_epoll_ 00000000 S com.android.vending
[Chromedriver] [STDERR] u0_a89    2109  205   1616000 61596 sys_epoll_ 00000000 S com.vkontakte.android
[Chromedriver] [STDERR] root      3155  2     0      0     worker_thr 00000000 S kworker/0:0
[Chromedriver] [STDERR] u0_a1204  3419  205   876536 37008 sys_epoll_ 00000000 S io.appium.settings
[Chromedriver] [STDERR] u0_a53    5131  205   893344 38704 sys_epoll_ 00000000 S com.google.android.inputmethod.latin:train
[Chromedriver] [STDERR] root      5887  2     0      0     worker_thr 00000000 S kworker/0:4
[Chromedriver] [STDERR] system    6171  205   931272 66120 sys_epoll_ 00000000 S com.android.settings
[Chromedriver] [STDERR] u0_a33    7008  205   1241744 102324 sys_epoll_ 00000000 S com.android.chrome
[Chromedriver] [STDERR] u0_a56    8499  205   1802420 76888 sys_epoll_ 00000000 S com.google.android.apps.maps
[Chromedriver] [STDERR] root      8756  2     0      0     rescuer_th 00000000 S msm_sat0
[Chromedriver] [STDERR] root      10995 2     0      0     worker_thr 00000000 S kworker/0:1
[Chromedriver] [STDERR] root      12002 2     0      0     worker_thr 00000000 S kworker/0:2
[Chromedriver] [STDERR] shell     13308 211   3048   980   __skb_recv b6e79900 S logcat
[Chromedriver] [STDERR] root      13321 2     0      0     worker_thr 00000000 S kworker/u:1
[Chromedriver] [STDERR] u0_a5     13625 205   866112 39680 sys_epoll_ 00000000 S android.process.media
[Chromedriver] [STDERR] root      13780 2     0      0     worker_thr 00000000 S kworker/0:3
[Chromedriver] [STDERR] shell     14000 211   1327032 26960 futex_wait b6cfe5e8 S app_process
[Chromedriver] [STDERR] u0_a1293  14022 205   901748 53892 sys_epoll_ 00000000 S io.appium.uiautomator2.server
[Chromedriver] [STDERR] u0_a1295  14103 205   1742692 137776 sys_epoll_ 00000000 S xxx.xxxx.xxxx
[Chromedriver] [STDERR] nobody    15011 1     11376  1168  poll_sched 00000000 S /system/bin/sensors.qcom
[Chromedriver] [STDERR] u0_a33    15388 205   998852 56668 sys_epoll_ 00000000 S com.android.chrome:privileged_process0
[Chromedriver] [STDERR] u0_i19    15455 205   997316 57196 sys_epoll_ 00000000 S com.android.chrome:sandboxed_process0
[Chromedriver] [STDERR] root      15862 2     0      0     cpu_stoppe 00000000 S migration/1
[Chromedriver] [STDERR] root      15863 2     0      0     worker_thr 00000000 S kworker/1:0
[Chromedriver] [STDERR] root      15864 2     0      0     run_ksofti 00000000 S ksoftirqd/1
[Chromedriver] [STDERR] root      15865 2     0      0     worker_thr 00000000 S kworker/1:1
[Chromedriver] [STDERR] root      15868 2     0      0     worker_thr 00000000 S kworker/1:2
[Chromedriver] [STDERR] shell     15877 211   2772   924   sys_rt_sig b6e50b48 S /system/bin/sh
[Chromedriver] [STDERR] shell     15879 15877 2708   1016           0 b6dea870 R ps
[Chromedriver] [STDERR] shell     16625 211   2772   924   sys_rt_sig b6e3cb48 S /system/bin/sh
[Chromedriver] [STDERR] shell     16629 16625 2772   924   sys_rt_sig b6e99b48 S sh
[Chromedriver] [STDERR] shell     16631 16629 1352328 38040 sys_epoll_ b6d46894 S /system/bin/app_process32
[Chromedriver] [STDERR] u0_a80    17663 205   898176 39368 sys_epoll_ 00000000 S com.rhmsoft.fm:service
[Chromedriver] [STDERR] u0_a7     17842 205   1295464 134068 sys_epoll_ 00000000 S com.google.android.gms
[Chromedriver] [STDERR] u0_a22    18186 205   1667156 54352 sys_epoll_ 00000000 S com.google.android.googlequicksearchbox:search
[Chromedriver] [STDERR] u0_a1257  18632 205   1215900 120324 sys_epoll_ 00000000 S com.koushikdutta.vysor
[Chromedriver] [STDERR] root      19686 2     0      0     worker_thr 00000000 S kworker/u:0
[Chromedriver] [STDERR] u0_a4     19746 205   856672 30312 sys_epoll_ 00000000 S com.android.defcontainer
[Chromedriver] [STDERR] u0_a62    19779 205   889776 45496 sys_epoll_ 00000000 S com.android.packageinstaller
[Chromedriver] [STDERR] u0_a3     19913 205   861352 36156 sys_epoll_ 00000000 S android.process.acore
[Chromedriver] [STDERR] u0_a14    19938 205   854312 28860 sys_epoll_ 00000000 S com.android.musicfx
[Chromedriver] [STDERR] u0_a79    19965 205   858952 29120 sys_epoll_ 00000000 S jp.co.omronsoft.iwnnime.ml
[Chromedriver] [STDERR] u0_a80    20010 205   894216 39480 sys_epoll_ 00000000 S com.rhmsoft.fm
[Chromedriver] [STDERR] u0_a38    22024 205   861172 32260 sys_epoll_ 00000000 S com.android.documentsui
[Chromedriver] [STDERR] u0_a7     22115 205   863256 32812 sys_epoll_ 00000000 S com.google.process.gapps
[Chromedriver] [STDERR] u0_a11    22351 205   860108 31760 sys_epoll_ 00000000 S com.google.android.partnersetup
[Chromedriver] [STDERR] media     24065 1     103096 10388 binder_thr 00000000 S /system/bin/mediaserver
[Chromedriver] [STDERR] shell     24574 211   3304   1228  __skb_recv b6dda900 S logcat
[Chromedriver] [STDERR] root      26115 2     0      0     worker_thr 00000000 S kworker/u:3
[Chromedriver] [STDERR] root      31048 2     0      0     worker_thr 00000000 S kworker/u:2
[Chromedriver] [STDERR] shell     31657 211   3304   1228  __skb_recv b6df0900 S logcat
[Chromedriver] [STDERR] u0_a65    32338 205   1593676 37900 sys_epoll_ 00000000 S com.google.android.apps.photos
[Chromedriver] [STDERR] USER      PID   PPID  VSIZE  RSS   WCHAN            PC  NAME
[Chromedriver] [STDERR] [1516218979.955][DEBUG]: Sending adb command: host-serial:077b69b8:forward:tcp:12178;localabstract:webview_devtools_remote_14103
[Chromedriver] [STDERR] [1516218979.956][DEBUG]: DevTools request: http://localhost:12178/json/version
[Chromedriver] [STDERR] [1516218979.975][DEBUG]: DevTools request failed
[Chromedriver] [STDERR] [1516218980.025][DEBUG]: DevTools request: http://localhost:12178/json/version
[Chromedriver] [STDERR] [1516218980.026][DEBUG]: DevTools request failed
[Chromedriver] [STDERR] [1516218980.077][DEBUG]: DevTools request: http://localhost:12178/json/version
[Chromedriver] [STDERR] [1516218980.079][DEBUG]: DevTools request failed
[Chromedriver] [STDERR] [1516218980.129][DEBUG]: DevTools request: http://localhost:12178/json/version
[Chromedriver] [STDERR] [1516218980.130][DEBUG]: DevTools request failed
[Chromedriver] [STDERR] [1516218980.181][DEBUG]: DevTools request: http://localhost:12178/json/version
[Chromedriver] [STDERR] [1516218980.183][DEBUG]: DevTools request failed
[Chromedriver] [STDERR] [1516218980.234][DEBUG]: DevTools request: http://localhost:12178/json/version
[Chromedriver] [STDERR] [1516218980.236][DEBUG]: DevTools request failed
[Chromedriver] [STDERR] [1516218980.286][DEBUG]: DevTools request: http://localhost:12178/json/version
[Chromedriver] [STDERR] [1516218980.288][DEBUG]: DevTools request failed
[Chromedriver] [STDERR] [1516218980.338][DEBUG]: DevTools request: http://localhost:12178/json/version
[Chromedriver] [STDERR] [1516218980.341][DEBUG]: DevTools request failed
[Chromedriver] [STDERR] [1516218980.392][DEBUG]: DevTools request: http://localhost:12178/json/version
[Chromedriver] [STDERR] [1516218980.394][DEBUG]: DevTools request failed
[Chromedriver] [STDERR] [1516218980.445][DEBUG]: DevTools request: http://localhost:12178/json/version
[Chromedriver] [STDERR] [1516218980.447][DEBUG]: DevTools request failed
[Chromedriver] [STDERR] [1516218980.498][DEBUG]: DevTools request: http://localhost:12178/json/version
[Chromedriver] [STDERR] [1516218980.500][DEBUG]: DevTools request failed
[Chromedriver] [STDERR] [1516218980.550][DEBUG]: DevTools request: http://localhost:12178/json/version
[Chromedriver] [STDERR] [1516218980.553][DEBUG]: DevTools request failed
[Chromedriver] [STDERR] [1516218980.603][DEBUG]: DevTools request: http://localhost:12178/json/version
[Chromedriver] [STDERR] [1516218980.607][DEBUG]: DevTools request failed
[Chromedriver] [STDERR] [1516218980.658][DEBUG]: DevTools request: http://localhost:12178/json/version
[Chromedriver] [STDERR] [1516218980.660][DEBUG]: DevTools request failed
[Chromedriver] [STDERR] [1516218980.711][DEBUG]: DevTools request: http://localhost:12178/json/version
[Chromedriver] [STDERR] [1516218980.715][DEBUG]: DevTools request failed
[Chromedriver] [STDERR] [1516218980.766][DEBUG]: DevTools request: http://localhost:12178/json/version
[Chromedriver] [STDERR] [1516218980.768][DEBUG]: DevTools request failed
[Chromedriver] [STDERR] [1516218980.819][DEBUG]: DevTools request: http://localhost:12178/json/version
[Chromedriver] [STDERR] [1516218980.821][DEBUG]: DevTools request failed
[Chromedriver] [STDERR] [1516218980.871][DEBUG]: DevTools request: http://localhost:12178/json/version
[Chromedriver] [STDERR] [1516218980.873][DEBUG]: DevTools request failed
[Chromedriver] [STDERR] [1516218980.924][DEBUG]: DevTools request: http://localhost:12178/json/version
[Chromedriver] [STDERR] [1516218980.927][DEBUG]: DevTools request failed
[Chromedriver] [STDERR] [1516218980.978][DEBUG]: DevTools request: http://localhost:12178/json/version
[Chromedriver] [STDERR] [1516218980.980][DEBUG]: DevTools request failed
[Chromedriver] [STDERR] [1516218981.030][DEBUG]: DevTools request: http://localhost:12178/json/version
[Chromedriver] [STDERR] [1516218981.034][DEBUG]: DevTools request failed
[Chromedriver] [STDERR] [1516218981.084][DEBUG]: DevTools request: http://localhost:12178/json/version
[Chromedriver] [STDERR] [1516218981.087][DEBUG]: DevTools request failed
[Chromedriver] [STDERR] [1516218981.137][DEBUG]: DevTools request: http://localhost:12178/json/version
ashishyadav2020 commented 6 years ago

did anyone find any solution for real devices, facing same. I'm having details as:

Appium: v1.8.0-beta (REV 8093a3512132f226b2076ca83a3262fe717fe3e2) Chrome on device: 64 Chrome driver version: '2.35.528161' Device: Real device (Xiaomi Mi A1) Android Version: O (8.0.0)

adb: Android Debug Bridge version 1.0.39 Version 0.0.1-4500957 Installed as C:\Android\sdk\platform-tools\adb.exe

Chehovich commented 6 years ago

same on LG Aristo Appium 1.7.2 Chrome 64 Android 7.0

j320 commented 6 years ago

So after reading almost every thread related to this issue, in the end what did it for me was locating elements using valid xPaths from the UiAutomator, other native or web locators didn't work. It's a weird workaround but there seems to be some issues with Chromedriver and this is the only one that worked for me.

I really hope it works for all of you!

teragoon commented 6 years ago

run with "dc.setCapability("showChromedriverLog", true);" when "driver.context("WEBVIEW_NAME")" if will you find this.. .... [debug] [ADB] Running 'c:\adt-bundle-windows-x86_64-20130522\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","192.168.48.52:26555","shell","cat","/proc/net/unix"] [debug] [AndroidDriver] WEBVIEW_7707 mapped to pid 7707 ... [Chromedriver] [STDERR] [3.481][DEBUG]: DevTools request: http://localhost:12733/json/version [Chromedriver] [STDERR] [3.688][DEBUG]: DevTools request failed .... so try this.. adb.exe forward tcp:12733 localabstract:webview_devtools_remote_7707

galenyjl commented 6 years ago

Appium 1.7.2 Android 7.1.1 Chrome 61 ChromeWebdriver 2.32 (Tried several versions) Still met the issue "chrome not reachable (Driver info: chromedriver=2.32.498537 (cb2f855cbc7b82e20387eaf9a43f6b99b6105061),platform=Mac OS X 10.12.6 x86_64))"

Can anyone help? Many thanks

vrunoa commented 6 years ago

@galenyjl try using chromedriver 2.33 https://chromedriver.storage.googleapis.com/2.33/notes.txt Use the chromedriverExecutable capability