果断收藏~
赞一个!
robotframework 的测试用例用文本编辑器写确实比较费劲,而且介乎于表格与编程语言之间,编程的写得费劲,手工的表示看不懂。不过优势是根据编写方式的不同有很强的适应性,既可以关键字驱动,也可以数据驱动或者其他驱动方式。
PS:我们项目目前测试框架的 Mobile 部分就是基于 appiumlibrary 的,实际使用过程中会发现它提供的方法远不能满足项目需要,不少方法还得自己写。。。
#9 楼 @myf_1127 inspector 能正常打开的前提是被测应用已经被 appium 打开了。
对应文档:https://github.com/appium/appium-dot-app#inspector--recorder
有点失落很正常,毕竟是自己带领团队做出来的东西,团队成员未经允许就拿走了,换做我也会失落一段时间。
但换个角度想想,随着业务发展,这些旧代码肯定要修改/重构,他最多也就是带走了一个目前可用的工具,工具不改进很快就会被淘汰的。
至于追究责任,这是公司的事情了,你也没必要太操心。
#24 楼 @weamylady 同上,我也不是大神。我目前对 Appium 以外的框架都停留在了解水平。。。
关于第二个解决方案,那个 js 文件的注释不就写了怎么运行嘛:
/*
* Small tool, launching and monitoring ios-web-kit-proxy, and relauching
* on predefined errors.
*
* Usage:
* ./bin/ios-webkit-debug-proxy-launcher.js [args]
* args: ios-webkit-debug-proxy args (they will be passed over)
*
* Example:
* ./bin/ios-webkit-debug-proxy-launcher.js -c <UDID>:27753 -d
*
* Note:
* For iOS8.1 try this first:
* brew install --HEAD ideviceinstaller
*/
就是装了 node.js 后,运行./bin/ios-webkit-debug-proxy-launcher.js [args](这里的路径你自己知道怎么改了吧,参数列表请看https://github.com/google/ios-webkit-debug-proxy说明)。如果是 iOS 8.1,先用brew install --HEAD ideviceinstaller安装 ideviceinstaller 后再运行ios-webkit-debug-proxy-launcher.js
然后建议你完整阅读这里的文档先:
https://github.com/testerhome/appium/tree/master/docs/cn/appium-setup
解决问题建议首先查文档,然后找官方论坛,然后 google,最后发帖。
你需要的是--full-reset。
请提问关于 appium 的问题前先看看这个帖子:http://testerhome.com/topics/2182
尽量自己解决,解决不了也至少知道具体卡在那里了
你是不是没有把 appium.app 从 dmg 拷到 application 文件夹……
/Volumes/Appium明显是挂载的 dmg 镜像地址……
如果后面还有Couldn't find ideviceinstaller错误,请看官方 issue:https://github.com/appium/appium/issues/2276
工作年限不够……
既然是大公司,建议加上公司名称吧。
PS:最后一句 欢迎资讯 应该是 欢迎咨询 吧?
#34 楼 @mingway_hu 谢谢!抱歉那时候没看到……
#7 楼 @lihuazhang 有这功能吗?
我看到首页的帖子貌似每天都在变,最前面的总是最新的。
我觉得有些帖子还是需要置顶的,可以仿照其他论坛把置顶帖做成合集,甚至把某个 wiki 置顶也行。如【安装包】Appium 国内下载地址(百度云盘,已更新至 1.3.6),这个帖子就很值得置顶。
@mingway_hu 可以把我们开源团队最近完成的新的翻译文档链接附上吗?
文档地址:https://github.com/appium/appium/tree/master/docs/cn
谢谢!
#4 楼 @seveniruby 我建议增加置顶帖这个功能,把一些小白经常问的问题放在置顶帖。
你说的功能非常不错!能具体说说吗?应用源代码变更量大吗?
@xuxu 好主意,欢迎各位遇到其它错误后在这里跟帖补充,让新手们更快学会自主解决问题。
#8 楼 @anonymity 最后两行是程序入口。加上这两行就能直接运行这个 py 文件来杀进程了。
#2 楼 @weamylady 估计按照 google 规划,webview 是 chromedriver 来负责的,android 的测试框架专心搞原生应用。
Appium 文档里明确写了 chrome 在 x86 模拟器上除非自己编译,否则是装不上或者存在各种问题的。请用 avd 的 arm 模拟器或真机。
文档地址:
英文原文:https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/mobile-web.md
中文译文:https://github.com/testerhome/appium/blob/master/docs/cn/writing-running-appium/mobile-web.cn.md
附上一下我能正常启动的 Log,用的是和你附上的一模一样的代码。appium 版本 1.3.4,mac:10.10.1:
...
info: [debug] Not pre-launching simulator
info: [debug] Not installing to real device since we're on sim
info: [debug] Starting command proxy.
info: [debug] Instruments socket server started at /tmp/instruments_sock
info: [debug] Starting instruments
info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
info: Launching instruments
info: [debug] Attempting to run app on iPhone 5 (8.1 Simulator)
info: [debug] Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w "iPhone 5 (8.1 Simulator)" com.apple.mobilesafari -e UIASCRIPT "/Users/hengjiechen/Library/Application Support/appium/bootstrap/bootstrap-a4a902c9cce7b6cb.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {"DYLD_INSERT_LIBRARIES":"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd6/InstrumentsShim.dylib","LIB_PATH":"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd6"}
info: [debug] And launch timeouts (in ms): {"global":90000}
info: [debug] [INST] Waiting for device to boot...
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.4","revision":"c8c79a85fbd6870cd6fc3d66d038a115ebe22efe"},"isShuttingDown":false},"sessionId":"ac192025-332c-4922-9c67-851dd6c93fa6"}
info: <-- GET /wd/hub/status 200 4.170 ms - 178 {"status":0,"value":{"build":{"version":"1.3.4","revision":"c8c79a85fbd6870cd6fc3d66d038a115ebe22efe"},"isShuttingDown":false},"sessionId":"ac192025-332c-4922-9c67-851dd6c93fa6"}
info: Instruments is ready to receive commands
info: [debug] Instruments launched. Starting poll loop for new commands.
info: [debug] Setting bootstrap config keys/values
info: [debug] Pushing command to appium work queue: "target = $.target();\nau = $;\n$.isVerbose = true;\n"
info: [debug] Socket data received (2 bytes)
info: [debug] Socket data being routed.
info: [debug] Sending command to instruments: target = $.target();
au = $;
$.isVerbose = true;
info: [debug] [INST] 2015-03-13 14:44:54 +0000 Debug: evaluation finished
2015-03-13 14:44:54 +0000 Debug: responding with:
info: [debug] [INST] 2015-03-13 14:44:54 +0000 Debug: Running system command #1: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":true}...
info: [debug] Socket data received (27 bytes)
info: [debug] Socket data being routed.
info: [debug] Got result from instruments: {"status":0,"value":true}
info: [debug] Setting initial orientation to PORTRAIT
info: [debug] Pushing command to appium work queue: "au.setScreenOrientation('PORTRAIT')"
对比 log 可以发现你第一条和我不一样的 log 为:
info: [debug] [INST STDERR] 2015-03-13 14:47:06.294 instruments[873:31261] WebKit Threading Violation - initial use of WebKit from a secondary thread.
查找 stackoverflow 找到:http://stackoverflow.com/questions/25919234/webkit-threading-violation-initial-use-of-webkit-from-a-secondary-thread-in-ui。 大致解释是这是由 Xcode 6 命令行工具变化引起的。
你去那里看看能否解决你的问题?
PS:这不是 appium 的问题,是 Instruments 启动 Simulator 的问题,请对症下药,不要纠结 appium。
Sorry,刚才下好 drozer 后试了一下,发现你这条命令在我这里运行正常:
drozer Console (v2.3.4)
dz> run app.package.list -f sieve
com.mwr.example.sieve (Sieve)
app.package.list前后无论是否加单引号都可以正常执行。
因为重现不了你的问题,所以只能帮到这里了。
你用的是 drozer-agent-2.3.4.apk 这个 apk 是吧?
文档里的 package 名称是错的,正确的应该是com.mwr.dz
你可以在安装并启动 app 后用下面的命令获取当前显示的 app 的报名和 activity 名称(用于 linux 或 mac,windows 的话应该是把 grep 换成 findstr):
$ adb shell dumpsys window windows | grep mFocusedApp
mFocusedApp=AppWindowToken{5294c5d4 token=Token{52957184 ActivityRecord{529570d4 u0 com.mwr.dz/.activities.MainActivity t2}}}
其中com.mwr.dz是包名,.activities.MainActivity是 activity 名称。
谢谢分享!
大致看了一下官方文档的更新,大致内容是把 Android 的自动化测试工具合并成了一个 Testing Support Library(包含在最新的 Android Support Repository 中,可在 SDK Manager 里面下载安装),里面包含 AndroidJUnitRunner(一个 Junit test runner,Android 2.2 (API level 8) or higher), Espresso(UI 测试框架,可用来做单个应用的功能测试,偏向白盒,Android 2.2 (API level 8) or higher), UI Automator(UI 测试框架,可用来做跨应用的功能测试,偏向黑盒,Android 4.3 (API level 18) or higher)。
PS: 那个短连接我老是打不开,补充一个长连接:http://developer.android.com/tools/testing-support-library/index.html
额,我觉得你需要的是系统学习一下 xpath 这门语言……
可以去维基百科看看:http://zh.wikipedia.org/wiki/XPath
xpath 说到底就是一个在 xml 文档中定位 xml 元素的语言。用 index 虽然方便,但适应性很弱(上面这么多层,某一层变了你就悲剧了)