During my tests, I pass the Webview and interact with the related fields with the following code. Everything is fine until here.
((AndroidDriver) getDriver()).context((String) handles.toArray()[1]);
Object[] windowHandles = getDriver().getWindowHandles().toArray();
getDriver().switchTo().window(windowHandles[windowHandles.length - 3].toString());
System.out.println("Current Context " + ((AndroidDriver) getDriver()).getContext());
Then I switch context native and exit and closeApp
when I want to enter the same webview, I’m switching the context again as above. again and do another test operation. it does not enter the webview window I want.