[英]Run UiAutomator API from Android Studio (v0.8)
When I work with tests - I add class in special module and run test configuration. 当我使用测试时 - 我在特殊模块中添加类并运行测试配置。 Class extend (for example) TestCase and work well.
类扩展(例如)TestCase并且运行良好。
But when I extend UiAutomatorTestCase - I get error 但是当我扩展UiAutomatorTestCase时 - 我得到了错误
java.lang.RuntimeException: Stub!
at com.android.uiautomator.testrunner.UiAutomatorTestCase.<init> (UiAutomatorTestCase.java:5) ...
My simple class: 我的简单课程:
import com.android.uiautomator.core.UiObjectNotFoundException;
import com.android.uiautomator.testrunner.UiAutomatorTestCase;
public class AutoTest extends UiAutomatorTestCase {
public void testSome() throws UiObjectNotFoundException {
getUiDevice().pressHome();
}
}
How to run it in Android Studio IDE? 如何在Android Studio IDE中运行它?
Well, if you'd be interested in giving it another try....I was able to get a UIAutomator project started in Android Studio with the following [Github project] ( https://github.com/wiliamsouza/bluetooth ) 好吧,如果你有兴趣再试一次....我能够通过以下[Github项目]( https://github.com/wiliamsouza/bluetooth )获得在Android Studio中启动的UIAutomator项目
The accompanying [blog post] ( http://wiliamsouza.github.io/#/2013/10/30/android-uiautomator-gradle-build-system ) has more details. 随附的[博客文章]( http://wiliamsouza.github.io/#/2013/10/30/android-uiautomator-gradle-build-system )有更多细节。
I modified with my own test cases and is working well. 我用自己的测试用例进行了修改,运行良好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.