0

我在每次测试中都遇到以下异常,我不知道为什么。希望有人有一些见解。

 ----- begin exception -----
junit.framework.AssertionFailedError: 
Activity named mainActivity can not be returned to
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.Assert.assertTrue(Assert.java:20)
at com.jayway.android.robotium.solo.ActivityUtils.goBackToActivity(ActivityUtils.java:185)
at com.jayway.android.robotium.solo.Solo.goBackToActivity(Solo.java:1864)
at com.package.test.AppointmentSettingTestBase.tearDown(AppointmentSettingTestBase.java:64)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:525)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1547)

----- 结束异常 -----

4

1 回答 1

1

您已经编写了要返回的活动的正确名称。我认为您的活动名称是 MainActivity 而不是 mainActivity。

于 2012-12-13T17:13:41.230 回答