使用 appium 进行 Android UI 自动化测试 [英] Android UI automation test with appium

查看:45
本文介绍了使用 appium 进行 Android UI 自动化测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在几周内进行了 android UI 自动化测试.我曾经尝试过使用 Robotium,现在我想改用 appium 框架.我的问题是:

I just working on android UI automation test in few weeks. I tried with robotium in a time and now I want change to appium framework. And my question are:

  1. 我读到 appium 是一个测试 webview 应用程序的测试工具.那么其他不是 webview 应用的应用呢?
  2. 我可以在 genymotion 上从 appium 运行测试吗?
  3. 我需要使用 appium(selenium 或其他东西)安装任何其他工具吗?

编辑当我尝试在没有 sudo 的情况下安装 appium 时出现此错误

Edit When I try to install appium with out sudo I got this error

错误!错误:EACCES,取消链接'/Users//appium/node_modules/.bin/instruments-client.js'

ERR! Error: EACCES, unlink '/Users//appium/node_modules/.bin/instruments-client.js'

npm 错误!{ [错误:EACCES,取消链接'/Users//appium/node_modules/.bin/instruments-client.js']

npm ERR! { [Error: EACCES, unlink '/Users//appium/node_modules/.bin/instruments-client.js']

npm 错误!错误:3,

npm ERR! errno: 3,

npm 错误!代码:'EACCES',

npm ERR! code: 'EACCES',

npm 错误!小路:'/Users//appium/node_modules/.bin/instruments-client.js' }

npm ERR! path: '/Users//appium/node_modules/.bin/instruments-client.js' }

npm 错误!

npm 错误!请尝试以 root/管理员身份再次运行此命令.

npm ERR! Please try running this command again as root/Administrator.

npm 错误!系统达尔文 13.1.0

npm ERR! System Darwin 13.1.0

npm 错误!命令/usr/local/Cellar/node/0.10.26/bin/node""/usr/local/bin/npm" "link" "appium-uiauto"

npm ERR! command "/usr/local/Cellar/node/0.10.26/bin/node" "/usr/local/bin/npm" "link" "appium-uiauto"

npm 错误!cwd/Users/yaphatak/appium

npm ERR! cwd /Users/yaphatak/appium

npm 错误!节点 -v v0.10.26

npm ERR! node -v v0.10.26

npm 错误!npm -v 1.4.3

npm ERR! npm -v 1.4.3

npm 错误!小路/Users//appium/node_modules/.bin/instruments-client.js

npm ERR! path /Users//appium/node_modules/.bin/instruments-client.js

npm 错误!代码 EACCES

npm ERR! code EACCES

npm 错误!错误3

npm 错误!堆栈错误:EACCES,取消链接'/Users//appium/node_modules/.bin/instruments-client.js'

npm ERR! stack Error: EACCES, unlink '/Users//appium/node_modules/.bin/instruments-client.js'

npm 错误!

npm 错误!可以在以下位置找到其他日志记录详细信息:

npm ERR! Additional logging details can be found in:

npm 错误!/Users//appium/npm-debug.log

npm ERR! /Users//appium/npm-debug.log

npm 错误!不行代码 0

npm ERR! not ok code 0

然后我尝试使用 sudo 然后运行 ​​appium 我收到这个错误

Then I try with sudo then run appium I got this error

错误:如果与 sudo 一起使用或安装,Appium 将无法工作.请以非 root 用户身份重新运行/安装.如果您必须使用以下方法安装 Appiumsudo npm install -g appium,解决办法是使用一种不需要安装 sudo 的方法(例如 Homebrew)全局 npm 包."

error: Appium will not work if used or installed with sudo. Please rerun/install as a non-root user. If you had to install Appium using sudo npm install -g appium, the solution is to reinstall Node using a method (Homebrew, for example) that doesn't require sudo to install global npm packages."

有什么帮助吗?

推荐答案

1- 是的,Appium 可以测试非 webview 应用程序.Appium 介绍页面的第一行说:

1- Yes, Appium can test non-webview apps. The first line on the Appium introduction page says:

Appium 是一种开源工具,可用于在 iOS 和 Android 上自动化移动原生移动网络移动混合应用平台.

Appium is an open-source tool you can use to automate mobile native, mobile web, and mobile hybrid applications on iOS and Android platforms.

2- 是的,Appium 应该与 Genymotion 一起使用.请参阅此处举个例子.

2- Yes, Appium should work with Genymotion. See here for an example.

3- 您的测试将需要引用 Selenium 库,以便与 Appium 进行通信.

3- Your tests will need to reference the Selenium libraries in order to communicate with Appium.

这篇关于使用 appium 进行 Android UI 自动化测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆