我在Android KitKat上发现了一个以前没有出现的问题.
我正在使用Robotium进行JUnit测试,测试中的所有内容都运行良好,除了Android KitKat(尝试使用Nexus 4更新和nexus 5).
当我想执行一个独奏动作时,我总是有同样的例外:
java.lang.ClassCastException: java.util.ArrayList cannot be cast to android.view.View[]
at com.jayway.android.robotium.solo.ViewFetcher.getWindowDecorViews(ViewFetcher.java:399)
at com.jayway.android.robotium.solo.ViewFetcher.getAllViews(ViewFetcher.java:81)
at com.jayway.android.robotium.solo.Searcher.searchFor(Searcher.java:165)
at com.jayway.android.robotium.solo.Waiter.waitForView(Waiter.java:254)
at com.jayway.android.robotium.solo.Waiter.waitForView(Waiter.java:233)
at com.jayway.android.robotium.solo.Solo.clickOnView(Solo.java:967)
at com.example.TestClass.testMethod(TestClass.java:61)
at java.lang.reflect.Method.invokeNative(Native Method)
at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214)
at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199)
at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:192)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:554)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1701)
Run Code Online (Sandbox Code Playgroud)
你知道是否有原因吗?
| 归档时间: |
|
| 查看次数: |
1239 次 |
| 最近记录: |