android - 与语言无关的 Robotium 测试

标签 android testing robotium

是否可以编写与语言无关的 Robotium 测试?例如,如果您使用 PreferenceActivity,根据定义,无法获取对它的 R.id 引用。

是否有支持此功能的机制?或者 Robotium 可以从字符串文件中读取的一种方法?

谢谢。

最佳答案

您只需访问当前 Activity ,即可从 Robotium 测试中读取被测应用程序的 strings.xml 文件:

String myString = getActivity().getString(R.string.my_string);

关于android - 与语言无关的 Robotium 测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10049597/

相关文章:

android - 缺少 Facebook Android SDK Audience Network NativeAdScrollView.CustomAdView

testing - 在移动设备上进行 A/B 测试有什么好的策略吗?

适用于多个设备的 android monkey 脚本

android - 机器人 : getCurrentViews() Null pointer exception

Android KK 无障碍服务应用示例

android studio - 无法访问包管理器

android - 通过 Eclipse 的 Ada 编码的 Android 应用程序?

testing - JMeter。线程间同步共享数据

javascript - 手机网站测试 : Emulators vs Real Devices

android - Robotium 相当于 Espresso 中的 drag()?