方法
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"); }