I’m seeing “No such context found” exception and also “webview” does not appear for my hybrid app in real device. How to resolve this issue? Please help me to solve this.
// Switching code
Set contextNames = driver.getContextHandles();
for (String contextName : contextNames) {
System.out.println( contextName );
if (contextName.contains( “WEBVIEW” )) {
driver.context( contextName );
System.out.println( contextName );
try {
Thread.sleep( 1500 );
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}