I’m automating a native android app. On the app when I click on a link it opens our website in a webview context. I want to switch between native and webview context for validation purposes.
The developer has set the property setWebcontentsDebuggingEnabled() on the app and the apk is built for Android 4.4.
I’m able to view both the context :: Native and Webview and I’m able to switch to the webview context using the following code.
Set availableContexts = driver.getContextHandles();
System.out.println("Total No of Context Found After we reach to WebView = "+ availableContexts.size());
for(String context : availableContexts) {
if(context.contains("WEBVIEW")){
System.out.println("Context Name is " + context);
driver.context(context);
}
}
Issue is , I’m not able to access the child elements in the android.webkit.WebView. But I’m able to use “Chrome Remote debugger” to inspect the elements.
Any inputs will be highly appreciated.