您好,我尝试在移动自动化中从原生页面切换到混合页面。它抛出一个错误: chrome驱动程序已在使用中。如何在移动自动化中修复它。
发布于 2018-04-12 14:32:20
如果你需要使用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
}
}https://stackoverflow.com/questions/44099637
复制相似问题