iOS 13.3 Appium not responding after switchContext to WebView
See original GitHub issueThe problem
Appium stops responding after attempting to switchContext(‘WEBVIEW…’).
Environment
- Appium version: 1.16.0
- Node.js version: 10.17.0
- Npm: 6.13.3
- Mobile platform/version under test: iOS 13.3
- Real device or emulator/simulator: Simulator
- Appium CLI or Appium.app|exe: CLI via webdriver.io
Details
In my setup I have a cordova app that successfully installs and launches. When attempting to switch to the webview context, Appium stops responding. The POST requests to /context time out.
Might be a wdio thing but if I enter debug first (browser.debug()
) and browser.switchContext('WEBVIEW...')
no response is received, further commands are ignored.
This issue does not occur on an iOS 13.2.2 simulator. Here’s how to install older simulators if you need to get around this.
Similar to #13361 and #13799 but they’re running older iOS versions.
Link to Appium logs
Code To Reproduce Issue [ Good To Have ]
This is using the wdio cli with Mocha. You probably get the idea of what it’s doing otherwise.
let pollCount = 0;
const pollForWebview = async () => {
const contexts = await browser.getContexts();
const webContext = contexts.find(context => context.startsWith('WEBVIEW'));
if(webContext) return webContext;
if(pollCount < 3) return browser.pause(1000).then(pollForWebview);
}
describe('app:', () => {
it('loads', async () => {
console.log('hello!');
const webContext = await pollForWebview();
await browser.switchContext(webContext);
const context = await browser.getContext();
console.log(context);
});
});
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Can't switch context to webview - Issues/Bugs - Appium Discuss
In the inspector i see only “no context” and can't switch to a webview context like the tutorial explains. When i try to...
Read more >Can't switch context to webview - Issues/Bugs - Appium Discuss
Hello I am testing a native app in appium and i'd like to test a part in the app where it redirects into...
Read more >How to switch context from native to Webview? - Support
Hi,. I have a problem in switching my Hybrid application from Native APP context view to Web Context view with new Appium 1.6.4...
Read more >iOS Can't switch context or even list contexts - Issues/Bugs
In my tests, I'm trying to determine if specific elements are displayed on the screen in a web view. I've tried different variations...
Read more >Set Context - Appium
iOS - attempt to connect to the application through the remote debugger; Android - start a Chromedriver process and begin a session to...
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
Thanks for getting this together! I will see what I can do!
Excellent! Glad it got working!