方法

    public void swith_app(AndroidDriver AndroidDriver){
        //切换到源生app
        System.out.println(AndroidDriver.getContextHandles());//输出现有的context
        System.out.println("切换到NATIVE_APP");
        AndroidDriver.context("NATIVE_APP");
        
    }
    
    public void swith_web(AndroidDriver AndroidDriver){
        //切换到webview
        System.out.println(AndroidDriver.getContextHandles());
        System.out.println("切换到WEBVIEW_com.tencent.mm:tools");
        AndroidDriver.context("WEBVIEW_com.tencent.mm:tools");
        
    }

 

相关文章:

  • 2021-09-15
  • 2022-12-23
  • 2021-05-17
  • 2021-04-15
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
  • 2022-01-10
  • 2022-12-23
  • 2021-06-09
相关资源
相似解决方案