Not able to access elements in webview when switching from native context

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.

I also gave a delay before accessing elements in the webview as suggested in another message.Tried both in the real device (5.1.1 version) and on an emulator- 4.4.2.Tried with apks build in the release mode as well as debug mode.
Not sure why I’m not able to access the webview elements. I’m using Appium for Windows which has an installer available.

You might need to update version of ChromeDriver that Appium is using. I am on a mac machine, but needed to upgrade my Appium chrome driver last week.

https://discuss.appium.io/t/webview-cannot-be-automated/13311/4

My team ran into same issue when compileversion of Android SDK is changed to 24 in our build.gradle file.
Have a check on that.
Compiling application against Version 23 of Android works fine on 4.4.4

I am still having issues on 5.0 and 6.* on compile version of 23.