Wednesday 2 December 2015

for selendroid switch to webview

 public void switchToWebviewSelendroid() 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();
          }
      }

No comments:

Post a Comment