Unknown error: unable to discover open pages

[debug] [AndroidDriver] WEBVIEW_20059 mapped to pid 20059
[debug] [AndroidDriver] Getting process name for webview
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘D:\SoftWare\SDK\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“06694a9b006097fb”,“shell”,“ps”]
[debug] [AndroidDriver] Parsed pid: 20059 pkg: com.meitu.wheecam!
[debug] [AndroidDriver] from: u0_a92,20059,215,1313872,150064,00000000,R,com.meitu.wheecam
[debug] [AndroidDriver] returning process name: com.meitu.wheecam
[debug] [AndroidDriver] Found webviews: [“WEBVIEW_com.meitu.wheecam”]
[debug] [AndroidDriver] Available contexts: [“NATIVE_APP”,“WEBVIEW_com.meitu.wheecam”]
[debug] [AndroidDriver] Connecting to chrome-backed webview context ‘WEBVIEW_com.meitu.wheecam’
[debug] [Chromedriver] Changed state to ‘starting’
[Chromedriver] Set chromedriver binary as: D:\MyProgram\nodejs\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win\chromedriver.exe
[Chromedriver] Killing any old chromedrivers, running: FOR /F “usebackq tokens=5” %a in (netstat -nao ^| findstr /R /C:"9515 ") do (FOR /F “usebackq” %b in (TASKLIST /FI "PID eq %a" ^| findstr /I chromedriver.exe) do (IF NOT %b=="" TASKKILL /F /PID %a))
[Chromedriver] No old chromedrivers seemed to exist
[Chromedriver] Spawning chromedriver with: D:\MyProgram\nodejs\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win\chromedriver.exe - -url-base=wd/hub --port=9515 --adb-port=5037
[Chromedriver] [STDOUT] Starting ChromeDriver 2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067) on port 9515
Only local connections are allowed.
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://127.0.0.1:9515/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”:“Windows NT”,“version”:“6.1 SP1”}}}"
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {“desiredCapabilities”:{“chromeOptions”:{“and roidPackage”:“com.meitu.wheecam”,“androidUseRunningApp”:true,“androidDeviceSerial”:“06694a9b006097fb”}}}

[debug] [JSONWP Proxy] Got response with status 200: {“sessionId”:“bd84ed249d591dec868efe7db78b31dd”,“status”:13,“value”:{“message”:“unknown error: una ble to discover open pages\n (Driver info: chromedriver=2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067),platform=Windows NT 6.1 SP1 x86_64)”}}
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {“desiredCapabilities”:{“chromeOptions”:{“and roidPackage”:“com.meitu.wheecam”,“androidUseRunningApp”:true,“androidDeviceSerial”:“06694a9b006097fb”}}}
[debug] [AndroidBootstrap] Emitting alert message…
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Emitting system alert message
[debug] [JSONWP Proxy] Got response with status 200: {“sessionId”:“db72e5b40e300ca12be45258c5de5030”,“status”:13,“value”:{“message”:"unknown error: unable to discover open pages\n (Driver info: chromedriver=2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067),platform=Windows NT 6.1 SP1 x86_64)"}}
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {“desiredCapabilities”:{“chromeOptions”:{“and roidPackage”:“com.meitu.wheecam”,“androidUseRunningApp”:true,“androidDeviceSerial”:“06694a9b006097fb”}}}
[debug] [JSONWP Proxy] Got response with status 200: {“sessionId”:“7597f9b337fccbd22cf16ba8c4610d54”,“status”:13,“value”:{“message”:“unknown error: unable to discover open pages\n (Driver info: chromedriver=2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067),platform=Windows NT 6.1 SP1 x86_64)”}}
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {“desiredCapabilities”:{“chromeOptions”:{“androidPackage”:“com.meitu.wheecam”,“androidUseRunningApp”:true,“androidDeviceSerial”:“06694a9b006097fb”}}}

[debug] [JSONWP Proxy] Got response with status 200: {“sessionId”:“bd84ed249d591dec868efe7db78b31dd”,“status”:13,“value”:{“message”:“unknown error: una ble to discover open pages\n (Driver info: chromedriver=2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067),platform=Windows NT 6.1 SP1 x86_64)”}}
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {“desiredCapabilities”:{“chromeOptions”:{“and roidPackage”:“com.meitu.wheecam”,“androidUseRunningApp”:true,“androidDeviceSerial”:“06694a9b006097fb”}}}
[debug] [AndroidBootstrap] Emitting alert message…
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Emitting system alert message
[debug] [JSONWP Proxy] Got response with status 200: {“sessionId”:“db72e5b40e300ca12be45258c5de5030”,“status”:13,“value”:{“message”:“unknown error: una ble to discover open pages\n (Driver info: chromedriver=2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067),platform=Windows NT 6.1 SP1 x86_64)”}}
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {“desiredCapabilities”:{“chromeOptions”:{“and roidPackage”:“com.meitu.wheecam”,“androidUseRunningApp”:true,“androidDeviceSerial”:“06694a9b006097fb”}}}
[debug] [JSONWP Proxy] Got response with status 200: {“sessionId”:“7597f9b337fccbd22cf16ba8c4610d54”,“status”:13,“value”:{“message”:“unknown error: unable to discover open pages\n (Driver info: chromedriver=2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067),platform=Windows NT 6.1 SP1 x86_64)”}}
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {“desiredCapabilities”:{“chromeOptions”:{“androidPackage”:“com.meitu.wheecam”,“androidUseRunningApp”:true,“androidDeviceSerial”:“06694a9b006097fb”}}}
[debug] [AndroidBootstrap] Emitting alert message…
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Emitting system alert message
[debug] [JSONWP Proxy] Got response with status 200: {“sessionId”:“55ccfd683abedc85004fccaa4c0ca0bf”,“status”:13,“value”:{“message”:“unknown error: unable to discover open pages\n (Driver info: chromedriver=2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067),platform=Windows NT 6.1 SP1 x86_64)”}}
[Chromedriver] Chromedriver exited unexpectedly with code null, signal SIGTERM
[debug] [Chromedriver] Changed state to ‘stopped’
[Chromedriver] Error: unknown error: unable to discover open pages
(Driver info: chromedriver=2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067),platform=Windows NT 6.1 SP1 x86_64)
at Chromedriver.callee$2$0$ (…/…/lib/chromedriver.js:176:15)
at tryCatch (D:\MyProgram\nodejs\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (D:\MyProgram\nodejs\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (D:\MyProgram\nodejs\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (D:\MyProgram\nodejs\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
Error: unknown error: unable to discover open pages
(Driver info: chromedriver=2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067),platform=Windows NT 6.1 SP1 x86_64)
at Chromedriver.callee$2$0$ (…/…/lib/chromedriver.js:176:15)
at tryCatch (D:\MyProgram\nodejs\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (D:\MyProgram\nodejs\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (D:\MyProgram\nodejs\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (D:\MyProgram\nodejs\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
[MJSONWP] Encountered internal error running command: Error: unknown error: unable to discover open pages
(Driver info: chromedriver=2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067),platform=Windows NT 6.1 SP1 x86_64)
at Chromedriver.callee$2$0$ (…/…/lib/chromedriver.js:176:15)
at tryCatch (D:\MyProgram\nodejs\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (D:\MyProgram\nodejs\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (D:\MyProgram\nodejs\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (D:\MyProgram\nodejs\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)

so , now there is no solution to solve this problem?

@smallsharp

It will be in the next version of Appium (1.6.6)

you can install it now and check

npm install -g appium@beta

@Aleksei i updated appium version to 1.6.6-beta.2
and i tried again,the mistake was still there.

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: unknown error: unable to discover open pages
(Driver info: chromedriver=2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067),platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 244.07 seconds
Build info: version: ‘2.53.1’, revision: ‘a36b8b1cd5757287168e54b817830adce9b0158d’, time: ‘2016-06-30 19:26:09’
System info: host: ‘TRBIR0RI3KICQSJ’, ip: ‘192.168.101.201’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0_121’
Driver info: io.appium.java_client.android.AndroidDriver

code:
driver.context(“WEBVIEW_com.meitu.wheecam”);

it works in simulator,not work in cellphone;

@Aleksei
added this property:
setCapability(“recreateChromeDriverSessions”, true);
i use nexus 5,it can context to webview,but can not click on the element.

[Chromedriver] [STDOUT] Starting ChromeDriver 2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067) on port 9515
Only local connections are allowed.
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://127.0.0.1:9515/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”:“Windows NT”,“version”:“6.1 SP1”}}}"
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {“desiredCapabilities”:{“chromeOptions”:{“androidPackage”:“com.meitu.wheecam”,“androidUseRunningApp”:true,“androidDeviceSerial”:“06694a9b006097fb”}}}
[debug] [JSONWP Proxy] Got response with status 200: {“sessionId”:“cdeafb0d2dd4868f315ea3f5573715d8”,“status”:0,“value”:{“acceptSslCerts”:true,“applicationCacheEnabled”:false,“browserConnectionEnabled”:false,“browserName”:“chrome”,“chrome”:{},“cssSelectorsEnabled”:true,“databaseEnabled”:false,“handlesAlerts”:true,“hasTouchScreen”:true,“javascriptEnabled”:true,“locationContextEnabled”:true,“mobileEmulationEnabled”:false,“nativeEvents”:true,“platform”:“ANDROID”,“rotatable”:false,“takesHeapSnapshot”:true,“takesScreenshot”:true,“version”:“44.0.2403.117”,“webStorageEnabled”:true}}
[debug] [Chromedriver] Changed state to ‘online’
[debug] [MJSONWP] Responding to client with driver.setContext() result: null
[HTTP] <-- POST /wd/hub/session/046b4cd9-84c4-4932-a469-b575752a797a/context 200 1371 ms - 76
[HTTP] --> POST /wd/hub/session/046b4cd9-84c4-4932-a469-b575752a797a/element {“using”:“xpath”,“value”:"/html/body/div[2]/div[2]/div/div[1]/img"}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [JSONWP Proxy] Proxying [POST /wd/hub/session/046b4cd9-84c4-4932-a469-b575752a797a/element] to [POST http://127.0.0.1:9515/wd/hub/session/cdeafb0d2dd4868f315ea3f5573715d8/element] with body: {“using”:“xpath”,“value”:"/html/body/div[2]/div[2]/div/div[1]/img"}
[debug] [JSONWP Proxy] Got response with status 200: {“sessionId”:“cdeafb0d2dd4868f315ea3f5573715d8”,“status”:0,“value”:{“ELEMENT”:“0.0016732700169086456-1”}}
[JSONWP Proxy] Replacing sessionId cdeafb0d2dd4868f315ea3f5573715d8 with 046b4cd9-84c4-4932-a469-b575752a797a
[HTTP] <-- POST /wd/hub/session/046b4cd9-84c4-4932-a469-b575752a797a/element 200 133 ms - 109
[HTTP] --> POST /wd/hub/session/046b4cd9-84c4-4932-a469-b575752a797a/element/0.0016732700169086456-1/click {“id”:“0.0016732700169086456-1”}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [JSONWP Proxy] Proxying [POST /wd/hub/session/046b4cd9-84c4-4932-a469-b575752a797a/element/0.0016732700169086456-1/click] to [POST http://127.0.0.1:9515/wd/hub/session/cdeafb0d2dd4868f315ea3f5573715d8/element/0.0016732700169086456-1/click] with body: {“id”:“0.0016732700169086456-1”}
[debug] [JSONWP Proxy] Got response with status 200: {“sessionId”:“cdeafb0d2dd4868f315ea3f5573715d8”,“status”:0,“value”:null}
[JSONWP Proxy] Replacing sessionId cdeafb0d2dd4868f315ea3f5573715d8 with 046b4cd9-84c4-4932-a469-b575752a797a
[HTTP] <-- POST /wd/hub/session/046b4cd9-84c4-4932-a469-b575752a797a/element/0.0016732700169086456-1/click 200 113 ms - 76
[HTTP] --> POST /wd/hub/session/046b4cd9-84c4-4932-a469-b575752a797a/element {“using”:“xpath”,“value”:"/html/body/div[3]/div[2]/div[2]"}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [JSONWP Proxy] Proxying [POST /wd/hub/session/046b4cd9-84c4-4932-a469-b575752a797a/element] to [POST http://127.0.0.1:9515/wd/hub/session/cdeafb0d2dd4868f315ea3f5573715d8/element] with body: {“using”:“xpath”,“value”:"/html/body/div[3]/div[2]/div[2]"}
[debug] [JSONWP Proxy] Got response with status 200: {“sessionId”:“cdeafb0d2dd4868f315ea3f5573715d8”,“status”:0,“value”:{“ELEMENT”:“0.0016732700169086456-2”}}

@Aleksei

[debug] [AndroidBootstrap] Emitting alert message…
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Emitting system alert message
[debug] [JSONWP Proxy] Got response with status 200: {“sessionId”:“824d2200765c40276af3c87f4cd493de”,“status”:100,“value”:{“message”:“chrome not reachable\n (Driver info: chromedriver=2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067),platform=Windows NT 6.1 SP1 x86_64)”}}
[Chromedriver] Chromedriver exited unexpectedly with code null, signal SIGTERM
[debug] [Chromedriver] Changed state to ‘stopped’
[Chromedriver] Error: chrome not reachable
(Driver info: chromedriver=2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067),platform=Windows NT 6.1 SP1 x86_64)
at Chromedriver.callee$2$0$ (…/…/lib/chromedriver.js:182:15)
at tryCatch (D:\MyProgram\nodejs\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (D:\MyProgram\nodejs\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (D:\MyProgram\nodejs\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (D:\MyProgram\nodejs\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
Error: chrome not reachable
(Driver info: chromedriver=2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067),platform=Windows NT 6.1 SP1 x86_64)
at Chromedriver.callee$2$0$ (…/…/lib/chromedriver.js:182:15)
at tryCatch (D:\MyProgram\nodejs\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (D:\MyProgram\nodejs\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (D:\MyProgram\nodejs\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (D:\MyProgram\nodejs\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
[MJSONWP] Encountered internal error running command: Error: chrome not reachable
(Driver info: chromedriver=2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067),platform=Windows NT 6.1 SP1 x86_64)
at Chromedriver.callee$2$0$ (…/…/lib/chromedriver.js:182:15)
at tryCatch (D:\MyProgram\nodejs\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (D:\MyProgram\nodejs\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (D:\MyProgram\nodejs\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (D:\MyProgram\nodejs\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)

sorry i did not work with hybrid. mostly with native plus few webviews inside.

@Aleksei tks anyway , maybe other phone works. :grinning: