Pattern selector

Most relevant patterns first. Most helpful ones displayed. Click here to show all.

  1. PrintingPageWebTester.assertTextPresent() has thrown an AssertionFailedError
    Unsorted
    0
    0
    0
  2. JUnit fail method
    JUnit
    94
    258
    97

Your stack trace compared to the selected pattern

Jump to solutionsExpand frames
junit.framework.AssertionFailedError: Expected text not found in current page: [A reset password link has been generated and will be sent to you via email.] Page content was: [jWebTest JIRA installation - Reset password link sent successfully A reset password link has been sent to you via email. You can follow that link and select a new password. If it does not arrive, contact one of the administrators. Powered by JIRA Studio 2.3 | Terms of Use | Bug/feature request | Request Support | Help/Documentation | JIRA Studio Blog | Twitter @JIRAStudio]
    at junit.framework.Assert.fail(Assert.java:47)
    at net.sourceforge.jwebunit.junit.WebTester.assertTextPresent(WebTester.java:442)
    at com.atlassian.studio.livetest.PrintingPageWebTester.assertTextPresent(PrintingPageWebTester.java:118)
    at com.atlassian.studio.functest.simple.TestForgotPassword.testNormalForgotPasswordEnabled(TestForgotPassword.java:47)

Solution

JaviRpo2 months ago

AssertionFailedError is thrown when using JUnit's internal assertions methods compare two different values and those are not equal. Also, the developer can invoke the method when the test logic fails.

The simplest code to reproduce the error is the following:

import static org.junit.Assert.fail;

public class FailTest { 

   @Test 
   public void shouldAssertStrings() { 
      ...
      if( ... ) {
         fail("Any message");
      }
   } 
}

Mind the static import. The fail is part of the JUnit API.

External results for this pattern (10)

  1. 742619648via GitHub12 hours ago
    =================script error start================ Traceback (most recent call last): File "copy_app\main.py", line 81, in test File "/data/data/com.netease.open.airbase/files/app/auto_sendmessage.air/auto_sendmessage.py", line 16 SyntaxError: Non-ASCII character '\xe6' in file /data/data/com.netease.open.airbase/files/app/auto_sendmessage.air/auto_sendmessage.py on line 16, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details =================script error end================
    Show stack trace
  2. Mesbah-Alamvia GitHub2 days ago
    cos(double)[0] :: expected:<-0.9999876894265599> but was:<-0.99998768942656>
    Show stack trace
  3. rdeltourvia GitHub6 days ago
    Outputted json isn't as expected. Values do not match(/messages[6]/message) Expected: "Error while parsing file 'The version is required in the XML declaration.'." Actual: "Error while parsing file 'XML宣言にはバージョンが必要です。'." Values do not match(/messages[7]/message) Expected: "Fatal Error while parsing file 'The version is required in the XML declaration.'." Actual: "Fatal Error while parsing file 'XML宣言にはバージョンが必要です。'." expected:<0> but was:<2>
    Show stack trace
  4. wingman-pentahovia GitHub6 days ago
    No message found for this stack trace.
    Show stack trace
  5. lewismcvia GitHub6 days ago
    Validation of file succeeded when it should have failed expected:<false> but was:<true>
    Show stack trace
  6. apupiervia GitHub6 days ago
    expected:<0> but was:<1>
    Show stack trace
  7. johnjohndoevia GitHub1 week ago
    No message found for this stack trace.
    Show stack trace
  8. Dawid Loubservia Google Groups2 weeks ago
    expected:<1> but was:<0>
    Show stack trace
  9. Dawid Loubservia Google Groups2 weeks ago
    null
    Show stack trace
  10. El Deffovia Google Groups2 weeks ago
    null
    Show stack trace