Appium Appium 可以支持 mac os x 上 App 的自动化测试吗

congxiangwang · 2014年05月14日 · 最后由 jingjie 回复于 2014年10月29日 · 1464 次阅读

Appium 可以支持 mac os x 上 App 的自动化测试吗?目前项目组想自动化 mac 上 App,Appium 框架可以做吗,不能的话,有没有其他开源框架可以做的

共收到 9 条回复 时间 点赞

可以做。

mac 上怎么部署配置 Appium 啊,有没有相关参考的文档,网上搜索的 先安装 node.js&npm ,然后 npm install -g appium, 貌似不成功啊,我用的是 Root 权限安装的

#2 楼 @congxiangwang root 不行的,你自己看官方网站首页,就告诉你 root 会出现问题的

@monkey 我直接 non-root 用户安装 node.js & npm 用的 pkg ,安装 appium 的时候 用 sudo npm install -g appium
安装成功了,但是我运行 appium & 就出现问题了,官网说不能用 sudo,不用 sudo 提示 “please run this command again use root /administrator”

#4 楼 @congxiangwang 你需要去就是 appium 那个目录下删除之前安装的文件,目录具体我忘记了。否则你之后的安装会都不成功的

@monkey Appium 不是支持 java 语言吗,要自动化测试的是安装在 mac os 上的 App,那我的开发环境应该部署在 mac 上吗,要用 java 语言开发,我打算安装 netbeans(也不知道有么有 mac 版本的),那我 IDE 开发的时候,怎么用 appium 啊,难道是把官网上的 java-client.jar 导入 netbeans 就可以了吗,感觉现在思路很混乱啊。求解!

#6 楼 @congxiangwang 额。。太混乱了。不管怎么说,首先第一点,你肯定要再 mac 上做 ios 的测试。否则别的都是白搭

@@
#1 楼 @lihuazhang Appium 已经安装完成,测试 mac os 上安装的 App,获取 AppiumDriver 应该怎么写呢
File appDir = new File("/Applications");
File app = new File(appDir,"Safari.app");
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(CapabilityType.BROWSER_NAME,"");
cap.setCapability("device","ios");
cap.SetCapability(CapabilityType.PLATFORM,"Mac");
cap.SetCapabiltity("app",app.getAbsolutePath());

AppiumDriver driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub,cap"));

上面的代码应该怎么改,才能获取到本地 APP 的 driver??

在网上找到一个很好的解决方法 和大家分享一下:

Step 1: Install JAVA 6. You will need JAVA 6 with Appium. JAVA 6 for Mac OS has to be downloaded from Apple's support page: http://support.apple.com/kb/DL1572

Step 2: In your bash add the following path using following format:

export PATH=$HOME/local/bin:$PATH
Step 3: Setup Maven (Download and set Bash profile PATH for Maven):

http://maven.apache.org/download.cgi
------> This is what your Bash Profile should look like:

export PATH="/Users/your_username/Desktop/adt-bundle-mac-x86_64-20140702/sdk/platform-tools":$PATH
export PATH="/Users/your_username/Desktop/adt-bundle-mac-x86_64-20140702/sdk/tools":$PATH
export PATH=$HOME/local/bin:$PATH
export ANDROID_HOME=/Users/your_username/Desktop/adt-bundle-mac-x86_64-20140321/sdk
export PATH="/Users/your_username/Desktop/apache-maven-3.2.2/bin":$PATH
export JAVA_HOME=$(/usr/libexec/java_home -v 1.6)
Obviously to run tests on Android device, you will need to download Android SDK and add it to your Bash Profile as well. To run tests on iOS devices, you will only need to install XCode, no need to add that to your Bash profile. But Android SDK has to added.

Step 4: Copy and paste following sequence of commands into your Terminal window and press ENTER. Copy and pasting it all together will work. It will take some time to install NODE, so be patient.

echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install
Step 5: After installation from Step 4 is complete, run following command in your Terminal window:

curl https://www.npmjs.org/install.sh | sh
Step 6: Then in your Terminal window execute following command:

npm install -g grunt-cli
Step 7: Then in your Terminal window execute following command:

npm install -g appium
Step 8: Then in your Terminal windo

需要 登录 後方可回應,如果你還沒有帳號按這裡 注册