使用 appium 进行 Android UI 自动化测试

标签 android android-testing appium

几周后我将致力于 Android UI 自动化测试。我曾经尝试过使用 robotium,现在我想更改为 appium 框架。我的问题是:

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

编辑 当我尝试不使用 sudo 安装 appium 时出现此错误

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

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

npm ERR! errno: 3,

npm ERR! code: 'EACCES',

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

npm ERR!

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

npm ERR! System Darwin 13.1.0

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

npm ERR! cwd /Users/yaphatak/appium

npm ERR! node -v v0.10.26

npm ERR! npm -v 1.4.3

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

npm ERR! code EACCES

npm ERR! errno 3

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

npm ERR!

npm ERR! Additional logging details can be found in:

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

npm ERR! not ok code 0

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

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 introduction page说:

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 一起使用。参见 here举个例子。

3- 您的测试需要引用 Selenium libraries以便与 Appium 通信。

关于使用 appium 进行 Android UI 自动化测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24199864/

相关文章:

android - ScrollView 内的 ViewPager 内的 ListView

android - 如何<include>带有 fragment 标签的布局文件?

Android Studio 0.8 Beta 屏幕捕获/视频捕获损坏

android - 如何在 Android Studio 中运行所有风格的 Android 测试

android - Android 测试中 TouchUtils.clickView() 和 Button.performClick() 的区别?

node.js - 无法在 MacOSX 上安装 Appium/Node Js

Common 类中的 Android getAssets 给出 "The method getAsssets() is undefined for the type Context"错误

android - 使用 Android Espresso 框架模拟用户在系统 Activity 中的点击

java - 我们如何在使用 Cucumber 实现的同一场景中使用 Selenium WebDriver 和 Appium?

android - 如何用Appium为android录制测试用例?