Appium——unknown error: cannot activate web view
测试步骤:
1、 打开必应APP(如果出现欢迎界面和定位服务弹窗,需要点掉)
2、 点击搜索按钮
3、 输入JAVA到搜索框
4、 点击搜索网页
5、 观察显示搜索出来的结果是否含有java
6. 如果失败则截图

当用例运行为Fail,提示截图失败:cannot activate webview,这是由于切换到webview并查找到元素之后,没有切换到native导致的
[2016-08-12 17:03:14] [ERROR] [SearchPage_001_SearchDemo_Test] ,截图失败,原因:unknown error: cannot activate web view
(Session info: webview=33.0.0.0)
(Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 41 milliseconds
Build info: version: '2.52.0', revision: '4c2593cfc3689a7fcd7be52549167e5ccc93ad28', time: '2016-02-11 11:22:43'
System info: host: 'QH-20140222HXUT', ip: '192.168.56.1', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_65'
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities [{app=F:\eclipseworkspace\appiumautotest\res\app\android\bing.apk, appPackage=com.microsoft.bing, networkConnectionEnabled=true, warnings={}, databaseEnabled=false, deviceName=192.168.26.101:5555, platform=LINUX, appActivity=com.microsoft.clients.bing.app.MainActivity, desired={app=F:\eclipseworkspace\appiumautotest\res\app\android\bing.apk, appPackage=com.microsoft.bing, appActivity=com.microsoft.clients.bing.app.MainActivity, platformVersion=4.4.4, automationName=Appium, sessionOverride=true, unicodeKeyboard=true, platformName=Android, deviceName=appium-test-avd, resetKeyboard=true}, platformVersion=4.4.4, webStorageEnabled=false, locationContextEnabled=false, automationName=Appium, browserName=Android, takesScreenshot=true, javascriptEnabled=true, sessionOverride=true, unicodeKeyboard=true, platformName=Android, resetKeyboard=true}]
Session ID: e50d2a5d-6ae2-46d7-b4de-86b3868a4464
在截图saveScreenShot(tr, driver)之前,切换到native
public void onTestFailure(ITestResult tr) {
super.onTestFailure(tr);
logger.warn(tr.getName() + " 测试用例执行失败!");
AppiumDriver<?> driver = (AppiumDriver<?>) testContext.getAttribute("APPIUM_DRIVER"); // 这里就是取driver
driver.context("NATIVE_APP");
saveScreenShot(tr, driver);
}
再次运行,截图成功

Appium——unknown error: cannot activate web view的更多相关文章
- 3-4 1449 web view
1.app类型 不同类型的应用 区别 native app 纯原声app,Android用Java些,iOS用object c写 hybrid app 套用原声应用的外壳,既有原生的UI页面,又通过内 ...
- Promise is rejected: Error: 2 UNKNOWN: error starting container: API error (404): {"message":"network build-blockchain-insurance-app_default not found"}出错的解决方案
错误描述: docker logs web 现象: > blockchain-for-insurance@2.1.0 serve /app > cross-env NODE_ENV=pro ...
- Selenium2学习-041-chromedriver:org.openqa.selenium.WebDriverException: unknown error: cannot determine loading status from unexpected alert open
今天在写WebDriver处理弹出框(alert.confirm.prompt)演示实例脚本分发给朋友时,在其执行时未能成功执行,对应的部分错误详情如下: org.openqa.selenium.We ...
- java.net.UnknownHostException: promote.cache-dns.local: unknown error
一.错误 程序启动时提示如下错误: java.net.UnknownHostException: promote.cache-dns.local: unknown error 直译就是: 主机名pro ...
- 真机调试 —— An unknown error occurred.
iOS开发中,总会遇见各种各样的问题.今天我就在真机调试的时候出现 An unknown error occurred. 不知道什么鬼,百度一下,各种胡说八道. 解决办法: 1.退出Xcode,重新运 ...
- An unknown error occurred & “”的 iPhone is busy: Processing symbol files
An unknown error occurred & ""的 iPhone is busy: Processing symbol files An unknown err ...
- git报错 error: cannot stat ‘'web/js': Permission denied
切换分支时报错: error: cannot stat ‘'web/js': Permission denied 解决方法:退出编辑器.浏览器.资源管理器等,然后再切换就可以了.
- [ERROR][org.springframework.web.context.ContextLoader][main] Context initialization failed org.sprin
做一个SSH为基础框架的webapp小DEMO,复制了一把以前可以跑的代码,竟发现无法初始化数据源,报错如下: [ERROR][org.springframework.web.context.Cont ...
- CentOS报错:Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock32 error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
今天安装完带图形界面的CentOS 7后,在Terminal中运行yum安装命令时报了以下错误: Could not retrieve mirrorlist http://mirrorlist.cen ...
随机推荐
- idea快捷键 好的网址收藏
http://blog.csdn.net/u010800804/article/details/48491395http://blog.csdn.net/wei83523408/article/det ...
- Anaconda+Tensorflow环境安装与配置
转载请注明出处:http://www.cnblogs.com/willnote/p/6746499.html Anaconda安装 在清华大学 TUNA 镜像源选择对应的操作系统与所需的Python版 ...
- BZOJ1835,LG2605 [ZJOI2010]基站选址
题意 有N个村庄坐落在一条直线上,第i(i>1)个村庄距离第1个村庄的距离为\(D_i\) 需要在这些村庄中建立不超过K个通讯基站,在第i个村庄建立基站的费用为\(C_i\) 如果在距离第i个村 ...
- AGC014E Blue and Red Tree
题意 There is a tree with \(N\) vertices numbered \(1\) through \(N\). The \(i\)-th of the \(N−1\) edg ...
- 将一个list转成json数组-晚上坐49路回去打卡
- flynn 开源paas 平台安装试用
flynn 是一个不错的开源paas 平台,基于git 以及容器技术,开发模型与 heroku 基本一样,同时构建方式就是基于heroku 的buildpacks 安装 官方文档提示说明是ubuntu ...
- MySQL Group Replication
group replication是一种全新的高可用,高扩张的MySQL集群服务.高一致性,基于原生复制及paxos协议的组复制技术,以插件方式提供一致数据安全保证:高容错性,大多数服务正常就可继续工 ...
- asterisk channel driver dev ref
入口函数load_module load_config ast_channel_register console_tech ast_cli_register_multiple ...
- webpack的3个路径配置项: assetsRoot、assetsSubDirectory、assetsPublicPath
在 vue-cli 构建模版的配置文件config.js中有assetsRoot,assetsSubDirectory和assetsPublicPath这三个路径配置项 assetsRoot:构建输出 ...
- spring的IDE:STS (Spring Tool Suite)
STS 比 eclipse 新增的内容: 在 New =>Other... 中新增了 Spring 文件夹,里面新增了 Spring Legacy Project 和 Spring Starte ...