关于android InstrumentationTestRunner
做自动化测试,之前使用的TestRunner是pl.polidea.instrumentation.PolideaInstrumentationTestRunner.在manifest文件里的instrumentation标签下指定testrunner,格式为:
<instrumentation
android:name="pl.polidea.instrumentation.PolideaInstrumentationTestRunner"
android:targetPackage="" /><!--targetPackage为被测工程包名-->
编译过后,由于我想实现自己的testsuite,所以需要覆写TestRunner,然后把android:name后指定的TestRunner改为我自定义的,这时出现a targetPackage attribute for instrumentation ()in its AndroidManifest.xml could not be found!的错误,可以这样修改,Package explorer --> $(Your Test Prject$) --> Run As --> Run
configurations --> Android JUnit Test --> $(Your Test Project) ,修改Test标签下的Instrumentation runner为新修改的runner,重新run即可