测试背景:自动化测试混合页 app

测试数据
1.Appium(版本 1.6.1)
2.测试使用安卓真机,android version 5.1
3.chromedriver 版本 2.37,chrome 版本 66

问题描述
检测到 native 和 webview 页面后转换到 webview 是卡主不动,直到超时提示:Failed to start Chromedriver session: An error occurred (Original error: chrome not reachable)

配置数据
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("androidProcess", "WEBVIEW_com.xxx.zhidao");
capabilities.setCapability(ChromeOptions.CAPABILITY, options);

代码体
for (String contextName : contextNames) {
System.out.println(contextName);
System.out.println(driver.context(contextName));//此处打印结果:NATIVE_APP
WEBVIEW_com.xxx.zhidao
}
driver.context("WEBVIEW_com.xxx.zhidao");//执行到此处终止知道超时退出

appium 日志
[Chromedriver] Error: Failed to start Chromedriver session: An error occurred (Original error: chrome not reachable
Chromedriver)
[Chromedriver] at Object.wrappedLogger.errorAndThrow (C:\Users\weiwei_gong\AppData\Local\Programs\Appium\resources\app\node_modules\appium-support\lib\logging.js:78:13)
[Chromedriver] at Chromedriver.callee$2$0$ (C:\Users\weiwei_gong\AppData\Local\Programs\Appium\resources\app\node_modules\appium-chromedriver\lib\chromedriver.js:357:13)
[Chromedriver] at tryCatch (C:\Users\weiwei_gong\AppData\Local\Programs\Appium\resources\app\node_modules\appium-chromedriver\node_modules\babel-runtime\regenerator\runtime.js:67:40)
[Chromedriver] at GeneratorFunctionPrototype.invoke as _invoke
[Chromedriver] at GeneratorFunctionPrototype.prototype.(anonymous function) as throw

已经尝试很多方法了 包括网上说断开代理,依然不能解决问题
请大神指点迷津万分感谢thanks


↙↙↙阅读原文可查看相关链接,并与作者交流