Appium Appium 1.6 ios 无缝升级

Gavin · 2016年10月18日 · 最后由 王明海 回复于 2017年02月14日 · 1748 次阅读

自从 xcode8 与 ios10 发布之后,使用 appium 做 ios 自动化测试的就苦逼了。appium 团队在连续发布 1.6 的三个 beat 版本试用之后总是有这样那样的问题,在轻松快乐的国庆假期之后 appium 的团队还真是给力,appium1.6 的正式版本发布了,怀着一颗兴奋的心情迫不及待的投入试用过程中,试用过程如下:

1. appium 1.6 的 npm 安装
npm install -g appium
2. appium1.6 的底层会用到 webdriverAgent,按照如下链接安装
https://github.com/facebook/WebDriverAgent
3. 由于 appium1.6 的升级只是底层的改变,所以对 java-client 写的脚本影响并不是很大,只需要修改如下:
增加: capabilities.setCapability("automationName", "XCUITest");
4. 对脚本影响最大的就是基于 xpath 识别的控件
xcode8 对于自动化测试底层支持已经由以前的 uiautomation 全面换成 xcuitest 了,所有先前的 xpath 已经不能再用了。
暂时 appium 没有发布 GUI 的程序,所以暂时的 xpath 识别可以使用 macaca 的 inspector。
https://testerhome.com/topics/5626

到此 appium 的升级事项准备完毕,就可以开始写脚本了。

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
共收到 18 条回复 时间 点赞

好贴,格式最好调整下。。。。。

格式调整下. 翻译下细节. 给你加精.

Gavin #18 · 2016年10月18日 Author

@seveniruby 好的,我调整一下

踩坑中,发现一个奇葩问题,swipe 滑动屏幕,上下右都可以,往左滑不动。

@run_ice_l 滑动操作支持的不太好,面前输入,点击,稳定性还是可以的。

@seveniruby 格式已调整

请问支持 IOS 真机测试吗

@304764691 暂时还不支持

识别控件可以通过 pagesource,或者 WDA inspector

现在都不支持 iOS 10 的真机吗?

恒温 [该话题已被删除] 中提及了此贴 11月07日 13:05

亲,谢谢分享!appium 1.6 的 npm 安装报错,dmg 的安装包官网没有,能分享一下么?

各位亲帮忙看看,appium 1.6 的 npm 安装报错!大谢啊!我电脑 OS 10.11.5,64 位的。
localhost:~ yongche$ npm install -g appium
/usr/local/bin/appium -> /usr/local/lib/node_modules/appium/build/lib/main.js

appium-chromedriver@2.9.2 install /usr/local/lib/node_modules/appium/node_modules/appium-chromedriver
node install-npm.js

info Chromedriver Install Installing Chromedriver version '2.21' for platform 'mac' and architecture '32'
info Chromedriver Install Opening temp file to write chromedriver_mac32 to...
info Chromedriver Install Downloading http://chromedriver.storage.googleapis.com/2.21/chromedriver_mac32.zip...
RequestError: Error: read ECONNRESET
at new RequestError (/usr/local/lib/node_modules/appium/node_modules/request-promise/lib/errors.js:11:15)
at Request.RP$callback as _callback
at self.callback (/usr/local/lib/node_modules/appium/node_modules/request/request.js:187:22)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at Request.onRequestError (/usr/local/lib/node_modules/appium/node_modules/request/request.js:813:8)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at Socket.socketErrorListener (_http_client.js:308:9)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at emitErrorNT (net.js:1271:8)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
/usr/local/lib
└── (empty)

npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/Cellar/node/6.6.0/bin/node" "/usr/local/bin/npm" "install" "-g" "appium"
npm ERR! node v6.6.0
npm ERR! npm v3.10.7
npm ERR! code ELIFECYCLE

npm ERR! appium-chromedriver@2.9.2 install: node install-npm.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the appium-chromedriver@2.9.2 install script 'node install-npm.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the appium-chromedriver package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install-npm.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs appium-chromedriver
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls appium-chromedriver
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/yongche/npm-debug.log
npm ERR! code 1
localhost:~ yongche$

匿名 #13 · 2016年11月15日

#14 楼 @1214503056 换成 cnpm 去安装

谢谢分享

@gavingao
使用 capabilities.setCapability("automationName", "XCUITest");
报错:
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: A new session could not be created. Details: The desiredCapabilities object was not valid for the following reason(s): automationName XCUITest not part of Appium,Selendroid,WebDriverAgent.

命令行如何启动 appium 和 GUI 模式有什么不同呢 下载了 1.6.2 没有 client 不知道怎么配置 哪位指教下

毛小利 Appium 1.6 里怎么实现左划? 中提及了此贴 01月04日 14:13
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册