I'm trying to get the available application context and want to switch to the webview context but appium getting only Navive App.
Also application is WebView enabled.
- Appium version: 1.10.1
- ChromeDriver version: 2.44
- Desktop OS/version: Windows 10
- Node.js version: 10.14.2
- Package manager:Npm
- Mobile platform/version: Android/8.1.0
- Real device or emulator/simulator:google pixel 2 emulator
Appium CLI or Appium.app|exe:Tried with both
public void webView() { try { Set<String> context = driver.getContextHandles(); for(String cont: context) { System.out.println("Available Context : " + cont); if(cont.contains("WEBVIEW")) { driver.context(cont); System.out.println("current context :"+cont); } else { System.out.println("Opps"); } } } catch (InterruptedException e) { e.printStackTrace(); } }
I expect the output as Native App and WebView of application will be get but the actual output is only getting Native App.