android - Robotium ClickOnButton(int ID) 方法导致 "junit.framework.AssertionFailedError: Button with index 2131034130 is not available!"

标签 android robotium

我正在使用 robotium 进行测试,无法弄清楚如何单击没有文本的按钮。 测试失败,跟踪:

junit.framework.AssertionFailedError: Button with index 2131034130 is not available!

最佳答案

索引系统是出于黑盒测试的原因所以如果你知道你想点击的 View 的资源 ID 你可以使用 solo.getView(R.id) 来获取一个 hold对象,然后使用 solo.clickOnView(View view) 单击它。

关于android - Robotium ClickOnButton(int ID) 方法导致 "junit.framework.AssertionFailedError: Button with index 2131034130 is not available!",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12759039/

相关文章:

android - 如何在搜索中获取播放列表ID:列表(播放列表类型)

java - 使用 gdata-android-2.2.1-alpha 检索 Google 日历列表

android - Robotium:如何重新签署 .apk 应用程序以便使用 Robotium 对其进行测试?

java - 检测代码中的故障

android - solo.search text() 不滚动可扩展列表

Android 和 JUnit : How to add individual tests to test suite?

android - android中的线性布局( View )大小

android - 底部对齐 float 操作按钮

关于 getCurrentActivity() 延迟的 android robotium

android - BDD Android UI 测试框架?