public void switchToWebview() throws IOException, InterruptedException{
//Thread.sleep(30000L);
try{
Set<String> contextNames = driver.getContextHandles();
for (String contextName : contextNames) {
System.out.println(contextNames); //prints out something like NATIVE_APP \n WEBVIEW_1
}
driver.context("WEBVIEW_com.shaadi.android");
//driver.switchTo().window("WEBVIEW_0");
}catch(Exception e){
e.printStackTrace();
}
}
//Thread.sleep(30000L);
try{
Set<String> contextNames = driver.getContextHandles();
for (String contextName : contextNames) {
System.out.println(contextNames); //prints out something like NATIVE_APP \n WEBVIEW_1
}
driver.context("WEBVIEW_com.shaadi.android");
//driver.switchTo().window("WEBVIEW_0");
}catch(Exception e){
e.printStackTrace();
}
}
No comments:
Post a Comment