question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't switch context to webview " A new session could not be created"

See original GitHub issue

The 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

https://pastebin.com/rKsD6GyE

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:29 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
jlippscommented, Oct 28, 2021

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.

0reactions
jlippscommented, Oct 28, 2021

Yeah, sorry. Looks like there are only two possible ways forward:

  1. Use the devtools protocol instead of webdriver
  2. Contact the Kiwi browser and ask them to make things compatible with Chromedriver or to release their own webdriver implementation, which would then be easy enough to incorporate into Appium as we have done with Chromedriver.
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found