• #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:最后一句 欢迎资讯 应该是 欢迎咨询 吧?

  • #4 楼 @kristina 能帮到你就好。那你下次就可以根据 log 来自己找答案了。
    PS:我还没达到大神级别……只是我比较喜欢解决问题而已

  • #34 楼 @mingway_hu 谢谢!抱歉那时候没看到……

  • Appium 报错后查错指南 at 2015年03月15日

    #7 楼 @lihuazhang 有这功能吗?
    我看到首页的帖子貌似每天都在变,最前面的总是最新的。

    我觉得有些帖子还是需要置顶的,可以仿照其他论坛把置顶帖做成合集,甚至把某个 wiki 置顶也行。如【安装包】Appium 国内下载地址(百度云盘,已更新至 1.3.6),这个帖子就很值得置顶。

  • @mingway_hu 可以把我们开源团队最近完成的新的翻译文档链接附上吗?
    文档地址:https://github.com/appium/appium/tree/master/docs/cn
    谢谢!

  • Appium 报错后查错指南 at 2015年03月15日

    #4 楼 @seveniruby 我建议增加置顶帖这个功能,把一些小白经常问的问题放在置顶帖。
    你说的功能非常不错!能具体说说吗?应用源代码变更量大吗?

  • Appium 报错后查错指南 at 2015年03月14日

    @xuxu 好主意,欢迎各位遇到其它错误后在这里跟帖补充,让新手们更快学会自主解决问题。

  • #8 楼 @anonymity 最后两行是程序入口。加上这两行就能直接运行这个 py 文件来杀进程了。

  • UIAutomator 2.0 发布了 at 2015年03月13日

    #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 名称。

  • UIAutomator 2.0 发布了 at 2015年03月13日

    谢谢分享!

    大致看了一下官方文档的更新,大致内容是把 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

  • appium 的 xpath 用法咨询。 at 2015年03月12日

    额,我觉得你需要的是系统学习一下 xpath 这门语言……
    可以去维基百科看看:http://zh.wikipedia.org/wiki/XPath

    xpath 说到底就是一个在 xml 文档中定位 xml 元素的语言。用 index 虽然方便,但适应性很弱(上面这么多层,某一层变了你就悲剧了)

  • #21 楼 @tester_felix

    1. 源码环境和运行环境区别:源码环境需要从源码安装(废话),因此需要按照很多依赖库(seledroid,node.js 的依赖库等等),组建时间较长且需要修改某些系统设置,使用目的是进行 appium 的开发/源码学习。运行环境则主要是用 apppium 来测试手机应用,重点在使用 appium,希望安装依赖库这类问题越少越好(所以用 exe 或者.app 是最简单的,而且还能随时切换版本)。当然,源码环境也可以做运行环境。

    2. appium for ios 的资料确实不多,你可以参考官方文档(github 的或者官方网站的),官方讨论区 (https://discuss.appium.io/) 等,testerhome 也有不少好文的,你也可以搜索一下。总的来说,appium 作为 ios 和 android 通用的框架,大部分地方都是通用的,但有些特有的地方(如应用签名、使用 ios predicate)需要通过学习一些 ios 开发知识来补充(我也正在学习中)。

    3. 如何入门 appium:我的入门方法:自己搞个简单 app(学习应用开发),通过官方 sample-code 学习编写简单的脚本(学习 webdriver API),学习其他流行的移动开发框架(了解某些地方 appium 为何如此设计/如此使用,共有的就是最需要学习的),测试自己开发或市面现有的复杂 app(了解如何测试一个实际应用。实际应用总会有各种自定义控件,学习测试自定义控件才是落地的)。

    最后说一点:国外网站大多是英文,所以英文水平也是必备的。每次学习到一个知识点最好写一篇博客/帖子记录一下,一方面方便后面自己查阅,另一方面也是知识库储备。

  • 非常赞同。
    我一般遇到问题先 google,再 stackoverflow,然后源码(能拿到的话),最后提问(或者报 bug)。

  • ok,解决了就好。😄

  • 这个不大清楚哦。目前看到的文档只提到支持 chrome 或者基于 chrome 内核且可被 chromedriver 驱动的浏览器。
    你可以试试。
    话说你要测的到底是在浏览器里用的 web app 还是内置浏览器的 hybrid app?