I was trying to automate tests for a hybrid app, while switching, it only shows name native context. WebView Context is shown as webview_undefined.
Set<String> contextNames = driver.getContextHandles();
for (String contextName : contextNames)
{
System.out.println(contextName);
if (contextName .contains("WEBVIEW"))
{
driver.context(contextName);
webViewFound = true;
System.out.println("switched to webview");
}
}
I'm using the above code. Can anyone give solution for this !