Hi all:
In my hybrid application, some screens are integrated with native and HTML5 modules. I can able to get the webview content with below code. While I’m switching into other webview screens, the Appium Driver find the elements from the previous screen. In my app, both the webviews(Screen) has some common CSS value and ClassName. And also, the webview names are common throughout all screens(webviews) in the application.
Set<String> contextNames = driver.getContextHandles(); for(String contextName : contextNames){ System.out.println(contextName); if(contextName.contains("WEBVIEW")) { driver.context(contextName); }
}
I’m using:
Appium v1.3.1
Android real device -v4.4.2
Java Client - v1.6.1
How to kill/close the previous webview??? or Is there any work-around for this??