最近需要做 App 测试,但是没有相关的开发经验,很多东西都迷迷糊糊的。稍微研究了一下 Appium,在此备份总结。
网上相关入门教程很多,但是跟我的情况都不符合。一方面我没有移动 App 开发的经验,另一方面我想要在 Mac 平台下用 Python 开发自动化脚本,再加上 Appium 诞生时间还不长,因此只能借鉴的不多。推荐乙醇的博客:http://www.cnblogs.com/nbkhic/tag/appium/
Mac 下安装 Appium
在 Mac 下安装 Appium,借鉴了这篇文章:http://testerhome.com/topics/1225
运行 appium-doctor 命令后,效果如下:
➜ ~ appium-doctor
Running iOS Checks
✔ Xcode is installed at /Applications/Xcode.app/Contents/Developer
✔ Xcode Command Line Tools are installed.
✔ DevToolsSecurity is enabled.
✔ The Authorization DB is set up properly.
✔ Node binary found at /usr/local/bin/node
✔ iOS Checks were successful.
Running Android Checks
✔ ANDROID_HOME is set to "/Applications/adt-bundle-mac-x86_64-20140702/sdk"
✔ JAVA_HOME is set to "/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home."
✔ ADB exists at /Applications/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb
✔ Android exists at /Applications/adt-bundle-mac-x86_64-20140702/sdk/tools/android
✔ Emulator exists at /Applications/adt-bundle-mac-x86_64-20140702/sdk/tools/emulator
✔ Android Checks were successful.
✔ All Checks were successful
需要注意的是,在配置 ANDROID_HOME 和 JAVA_HOME 的时候,网络上很多资料里都说要修改 .bash_profile 文件,但是我用的是 zsh,因此要修改 .zshrc 文件,如下:
如此,Appium 安装完毕: