【发布时间】:2017-10-21 07:55:57
【问题描述】:
您好,我尝试在移动自动化中从原生页面切换到混合页面。它抛出一个错误 chrome 驱动程序已在使用中。如何在移动自动化中修复它。
【问题讨论】:
标签: mobile automation appium
您好,我尝试在移动自动化中从原生页面切换到混合页面。它抛出一个错误 chrome 驱动程序已在使用中。如何在移动自动化中修复它。
【问题讨论】:
标签: mobile automation appium
如果您需要使用 java 自动化 android 应用程序,您可以使用以下方法在上下文之间切换。
public final String WEBVIEW = "WEBVIEW_com.maxsoft.testextractor";
public final String NATIVE_APP = "NATIVE_APP";
public void switchContextTo(String context){
if (context.toLowerCase().equals(WEBVIEW.toLowerCase())) {
androidDriver.context(WEBVIEW); // set context to WEBVIEW_1
} else {
androidDriver.context(NATIVE_APP); // set context to NATIVE_APP
}
}
【讨论】: