标签: android-uiautomator

从 JSON 文件读取 JSONObject

将包含 JSON 的文件加载到 JSONObject 中的最简单方法是什么。

将文件解析为 JSONObject - 没有间歇性的 String 对象(可以说是浪费内存)

这就是我所拥有的,但它引发了异常:

public class AlphabetGestures {

  private Map<Character,Vector<Point>> mMap;

public AlphabetGestures(String jsonFileName) throws JSONException {
    mMap = new HashMap<Character,Vector<Point>>() ;
    // parsing a file into a JSONObject - w/o the intermittent String object (arguably memory wasting)
    File f = new File(jsonFileName); // making File object for .json file.
    JSONObject masterJSON = new JSONObject(f.toString()); 
// giving  .json file string to jsonvalue parser
     JSONArray characters = masterJSON.names();
    for ( int c = …
Run Code Online (Sandbox Code Playgroud)

java android json android-uiautomator

1
推荐指数
1
解决办法
1万
查看次数

如何在 Linux 中安装和运行 appium?

我想做 UI 自动化以在真正的 android 设备中打开一个 url。为此我想在我的linux系统上安装和运行appium,请指导我怎么做?还建议我使用eclipse在chrome浏览器中打开一个url吗?

android ui-automation appium android-uiautomator

1
推荐指数
1
解决办法
2万
查看次数

UiAutomator 检查视图可见性

我正在尝试在视图上执行单击(或多次单击)(如果它在屏幕上可见)。我想要这样的东西,但是没有obj.isVisible()方法。

UiObject obj = device.findObject(new UiSelector().resourceId("ru.litres.android:id/container"));
UiObject objTop = device.findObject(new UiSelector().resourceId("ru.litres.android:id/container_top"));
while (obj.isVisible())
     objTop.click();
Run Code Online (Sandbox Code Playgroud)

android ui-testing android-uiautomator

1
推荐指数
1
解决办法
4335
查看次数

在修订版22中无法解析导入android.support.test

我正在尝试使用支持库在Android中进行测试.但是,当我尝试导入时

import android.support.test.runner.AndroidJUnit4;
Run Code Online (Sandbox Code Playgroud)

正如它在这里所描述的那样

The import android.support.test can not be resolved
Run Code Online (Sandbox Code Playgroud)

我想使用版本22,因为我想使用为UiAutomator提供的新功能.

源中没有support\test文件夹

我正在挖掘sdk文件夹,我注意到即使路径来源\ android-21\android\support\test存在,sources\android-22\android\support也没有测试文件夹(有一个测试但是只有GrantActivity.java里面).

我忘记了进口任何罐子吗?(我尝试导入支持注释,并支持-v4,但结果相同).

难道我做错了什么?我希望如此,你们可以帮助我解决这个问题.

提前致谢!

注意:我已经下载了Android支持存储库和库,我拥有API 22中的所有软件包,并且我拥有最新的工具,平台工具和构建工具.

(我认为这不重要,但我在Windows 7中使用Eclipse Kepler)

testing android android-support-library android-uiautomator

0
推荐指数
1
解决办法
4506
查看次数

NameError:appium python在android自动化中未定义全局名称“ TouchAction”

在执行此代码以使用appium python客户端自动执行android应用程序时,

el = self.driver.find_element_by_accessibility_id('Hello')
action = TouchAction(self.driver)
action.tap(el).perform()
Run Code Online (Sandbox Code Playgroud)

其给出的错误信息为“ NameError:未定义全局名称'TouchAction'”。我想念什么?

automation android ui-automation appium android-uiautomator

0
推荐指数
1
解决办法
1871
查看次数

Espresso 软键盘类型

使用 Espresso 可以验证当我们选择特定输入字段时出现哪种类型的软键盘。例如让我们选择手机号码 - EditText 它必须显示数字键盘。我们可以用 Espresso 验证它吗?

android ui-automation android-espresso android-uiautomator

0
推荐指数
1
解决办法
1545
查看次数

如何在运行 am Instrument 命令时生成 html 报告 - Uiautomator

我是一个初学者,正在使用UIautomatorAndroid 仪器。我能够从Android studio ( androidTest Instrumentation ) 运行测试,并且能够从“运行”窗口中的“导出测试结果”选项生成报告(html 和 xml)。

但是我不知道如何在从命令行运行测试时获得 Html 报告。

我使用以下命令从命令行运行测试。

adb shell am instrument -w package.name/android.test.runner.AndroidJUnitRunner
Run Code Online (Sandbox Code Playgroud)

junit android android-studio android-uiautomator

0
推荐指数
1
解决办法
1505
查看次数