- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在每次测试中都不断遇到以下异常,但我不明白为什么。希望有人能提供一些见解。
----- 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)
-----结束异常-----
最佳答案
您已输入要返回的 Activity 的正确名称。我认为您的 Activity 的名称是 MainActivity 而不是 mainActivity。
关于java - 使用 Robotium 进行 junit 测试时出现 AssertionFailedError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13856547/
预期和实际输出的内容相同,但我得到 org.opentest4j.AssertionFailedError 我试图将所有 /n 替换为 System.lineSeparator() 但我得到的输出是:
我有以下代码: TableViewer tv = new TableViewer(attributeTable); tv.setContentProvider(new
我是 junit 测试的新手,我有以下测试 - public class ItemsTest extends TestCase { private Items itemsd; prot
这个问题已经有答案了: Comparing arrays in JUnit assertions, concise built-in way? (8 个回答) 已关闭 6 年前。 我是单元测试新手。我
我目前使用的是 JUnit 4.4 和 Java 1.6.x。在最近的代码修复之后,我们开始在我对该方法的 JUnit 测试中遇到这个 AssertionFailedError: UtilityTes
Crashlytics 报告了以下问题,该问题影响了我的应用程序的很大一部分用户: Fatal Exception: junit.framework.AssertionFailedError: Can
这是我的 testMethod 问题, public class DetailsTest extends TestCase { public void testGetQuotes() thro
执行此操作时,我收到 junit.framework.AssertionFailedError: assertEquals("123 \t July \t testuser \t USD \t one
我正在尝试 mock toURI()方法来自FileObject.java类(该类属于 org.openide.filesystems 包)。 方法声明如下: public final URI toU
currentCapacity = queue.getCapacityLeft(); if(currentCapacity == queue.getCapacityLeft()) System.out
我正在使用带有 Espresso 的 AndroidJUnitRunner。 我写了一个简单的测试,但总是收到这个异常。根据 Stackoverflow 的回答,问题是搞砸了 JUnit3 和 JUn
我使用的是最新的 android studio 版本。我想使用它的测试可能性。当我测试我的库项目时,出现错误。这是错误发生的地方: startActivity (intent, null, null)
我正在尝试测试模块中的 Activity 。我只是想在测试方法中开始这个 Activity ,但我总是有一个 AssertionFailedError。我在网上搜索了这个问题,但找不到任何解决方案。任
我正在使用JUnit Test进行测试,但遇到了AssertionFailedError问题。 我正在使用命令行参数将测试用例传递给主类。 下面是我的 Main.java 代码 public clas
我在使此测试用例正常工作时遇到问题。有人能指出我正确的方向吗?我知道我做错了什么,但我不知道是什么。 import org.junit.*; import com.thoughtworks.selen
我正在尝试运行一个快速的 Selenium 示例来开始,但遇到了麻烦。我之前编写过 JUnit 测试用例,它们工作得很好,但这是我的代码和错误。 package alltests; import te
我在每次测试中都不断遇到以下异常,但我不明白为什么。希望有人能提供一些见解。 ----- begin exception ----- junit.framework.AssertionFailedE
这可能看起来与 SO 上的某些内容重复,但我查看了 this , this , this和 this但尚未找到有效的解决方案。 我遇到的问题是我在 jenkins 上为不存在的测试套件收到此错误。以下
我这样做是为了退出使用 Android UIAutomator 的应用程序。 assertTrue("Back button can't be pressed", getUiDevice().pres
我在设置 Robotium 测试以在没有随机误报的情况下在 Travis 上运行时遇到问题。 我得到的每两个构建 pl.mg6.agrtt.TestActivityTests > testCanEnt
我是一名优秀的程序员,十分优秀!