Chromedriver is unable to discover open pages when switching to another webview
See original GitHub issueThe problem
I am running an automation test where upon clicking a button in App1 (WEBVIEW_com.microsoft.aad.automation.testapp), the webview in App2(WEBVIEW_com.azure.authenticator:auth) will be launched. And when trying to send args into WEBVIEW_com.azure.authenticator:auth, the ChromeDrive returned the error: unknown error: unable to discover open pages.
Environment
- Appium v1.6.3
- Windows NT 10.0.14393 x86_64
- Node.js v6.9.5
- Android v5.1.1
- Nexus 10
- ChromeDriver v2.28.455520
Details
[debug] [AndroidDriver] Parsed pid: 25637 pkg: com.azure.authenticator:auth!
[debug] [AndroidDriver] from: u0_a170,25637,137,1646544,182140,ffffffff,00000000,R,com.azure.authenticator:auth
[debug] [AndroidDriver] returning process name: com.azure.authenticator:auth
[debug] [AndroidDriver] Found webviews: ["WEBVIEW_com.microsoft.aad.automation.testapp","WEBVIEW_com.azure.authenticator:auth","WEBVIEW_com.azure.authenticator"]
[debug] [AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_com.microsoft.aad.automation.testapp","WEBVIEW_com.azure.authenticator:auth","WEBVIEW_com.azure.authenticator"]
[debug] [AndroidDriver] Connecting to chrome-backed webview context 'WEBVIEW_com.azure.authenticator:auth'
[debug] [AndroidDriver] A port was not given, using random port: 8000
[debug] [Chromedriver] Changed state to 'starting'
[Chromedriver] Set chromedriver binary as: C:\Users\jinjia\AppData\Roaming\npm\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:"8000 "`) 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: C:\Users\jinjia\AppData\Roaming\npm\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win\chromedriver.exe --url-base=wd/hub --port=8000 --adb-port=5037
[Chromedriver] [STDOUT] Starting ChromeDriver 2.28.455520 (cc17746adff54984afff480136733114c6b3704b) on port 8000
Only local connections are allowed.
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8000/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\":\"10.0.14393\"}}}"
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.microsoft.aad.automation.testapp","androidUseRunningApp":true,"androidDeviceSerial":"R32CA07LPZA"}}}
[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"b1c35b8996a726e5b08133ef68ccbde8","status":13,"value":{"message":"unknown error: unable to discover open pages\n (Driver info: chromedriver=2.28.455520 (cc17746adff54984afff480136733114c6b3704b),platform=Windows NT 10.0.14393 x86_64)"}}
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.microsoft.aad.automation.testapp","androidUseRunningApp":true,"androidDeviceSerial":"R32CA07LPZA"}}}
[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"28cc33b8cc8bd2ec0c7bb86d537d61ef","status":13,"value":{"message":"unknown error: unable to discover open pages\n (Driver info: chromedriver=2.28.455520 (cc17746adff54984afff480136733114c6b3704b),platform=Windows NT 10.0.14393 x86_64)"}}
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.microsoft.aad.automation.testapp","androidUseRunningApp":true,"androidDeviceSerial":"R32CA07LPZA"}}}
[HTTP] <-- POST /wd/hub/session/959700af-4088-4080-b976-1619ebc62170/context - - ms - -
[HTTP] --> GET /wd/hub/session/959700af-4088-4080-b976-1619ebc62170/screenshot {}
[debug] [MJSONWP] Calling AppiumDriver.getScreenshot() with args: ["959700af-4088-4080-b976-1619ebc62170"]
[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"fe41e9cb20834a83420a7b305bbceeb2","status":13,"value":{"message":"unknown error: unable to discover open pages\n (Driver info: chromedriver=2.28.455520 (cc17746adff54984afff480136733114c6b3704b),platform=Windows NT 10.0.14393 x86_64)"}}
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.microsoft.aad.automation.testapp","androidUseRunningApp":true,"androidDeviceSerial":"R32CA07LPZA"}}}
[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"24a402fe164aa46db9edf3b6398e7624","status":13,"value":{"message":"unknown error: unable to discover open pages\n (Driver info: chromedriver=2.28.455520 (cc17746adff54984afff480136733114c6b3704b),platform=Windows NT 10.0.14393 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.28.455520 (cc17746adff54984afff480136733114c6b3704b),platform=Windows NT 10.0.14393 x86_64)
at Chromedriver.callee$2$0$ (../../lib/chromedriver.js:177:15)
at tryCatch (C:\Users\jinjia\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\jinjia\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\jinjia\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (C:\Users\jinjia\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
Link to Appium logs
Issue Analytics
- State:
- Created 7 years ago
- Comments:24 (6 by maintainers)
Top Results From Across the Web
Original error: unknown error: unable to discover open pages
1 Answer 1 · Below command should return device in online mode. adb devices · You have to make sure the chromedriver.exe in...
Read more >Unknown error: unable to discover open pages - Issues/Bugs
Issue: Chromedriver is unable to discover open pages when switching to another webview. The problem I am running an automation test where upon ......
Read more >415 - Error: unable to discover open pages - chromedriver
After chromedriver launches chrome, it tries to connect to the chrome process via the remote debugging port, to retrieve a list of open...
Read more >Fix "Aw, Snap!" page crashes and other page loading errors
If you're getting the "Aw, Snap" error or another error code instead of a webpage, Chrome is having problems loading. You might also...
Read more >Downloads - ChromeDriver - WebDriver for Chrome
Resolved issue 3376: Remove LaunchApp command from ChromeDriver. Resolved issue 3432: Sometimes NavigationTracker fails to detect when the page has finished ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Any solution here? We are facing same problem…
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.