Can't switch context to webview " A new session could not be created"
See original GitHub issueThe problem
Trying to automate “Kiwi Browser” on real device, but once the app is open, can’t switch to web view context.
Environment
- Appium version (or git revision) that exhibits the issue: 1.21.0
- Desktop OS/version used to run Appium: Ubuntu 20.04.2 LTS
- Node.js version (unless using Appium.app|exe): v13.14.0
- Mobile platform/version under test: Android 11
- Real device or emulator/simulator: Real device
Details
Appium is unable to start a new session on the webview context, this what the appium server says:
session not created: please close 'com.kiwibrowser.browser' and try again","stacktrace":"#0 0x559744c178f3 <unknown>\n#1 0x5597446fcba8 <unknown>\n#2 0x559744723400 <unknown>\n#3 0x55974471c1c7 <unknown>\n#4 0x559744755995 <unknown>\n#5 0x55974474fd63 <unknown>\n#6 0x559744726144 <unknown>\n#7 0x559744727135 <unknown>\n#8 0x559744c46c3e <unknown>\n#9 0x559744c5c6b7 <unknown>\n#10 0x559744c47b95 <unknown>\n#11 0x559744c5db05 <unknown>\n#12 0x559744c3c2ab <unknown>\n#13 0x559744c78248 <unknown>\n#14 0x559744c783c8 <unknown>\n#15 0x559744c9333d <unknown>\n#16 0x7f8b31fd6609 start_thread
Link to Appium logs
Issue Analytics
- State:
- Created 2 years ago
- Comments:29 (11 by maintainers)
Top Results From Across the Web
Appium v1.13.0-beta.3]Can't switch context webview on Android
I can't switch to WEBVIEW, I tried many versions but failed. ... Failed to start Chromedriver session: A new session could not be...
Read more >cannot set context to WEBVIEW - android - Stack Overflow
So I need to switch the context to WEBVIEW to be able to use css selectors. The app is built with WebView.setWebContentsDebuggingEnabled(true) ....
Read more >Can't switch context webview on Android - Appium Discuss
I am Test automation on EDGE browser Android. I can't switch to WEBVIEW, I tried many versions but failed. Environment Appium version (or ......
Read more >Appium can not switch to webview :WebDriverException
As the sample code shows, it is not "switchTo" anymore. driver.context(contextName) is the syntax now. I'm not sure what the NullPointerException is caused...
Read more >Not able to Communicate with Browser Screen on Mobile App ...
This is expected! Unless you start the session with a web app the webview context will not be debuggable (hybrid apps are supported...
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
The next step would be to try to automate it with Chromedriver directly, no Appium involved. If that is possible, then it can definitely work with Appium and it’s just a matter of getting things hooked up correctly. If that’s not possible, then it’s also likely not possible with Appium (since Appium uses Chromedriver).
Typically, if you can inspect via Chrome it’s possible for Chromedriver to work, but as this is a new browser I’ve never heard of, I’m not sure.
Yeah, sorry. Looks like there are only two possible ways forward: