Unsuccessful Test Continues to Next Test With No Output



  • setUp: To save time starting/closing browser, logging in/out, I've started grouping regression tests in common classes. I know there are other ways to do this, this one made most sense for our current goals/challenges.

    problem: Should one of the tests not be able to find an element, or have some issue that does not cause a failure, the next test kicks off with no output to the user.

    whatIWant: If every line in a test cannot be completed, I want to know. The next test can kick off, that's great, I'd just like to know that one of my tests in the class did not complete.

    This is what the regression test class looks like



  • You can use soft asserts from TestNG.

    Do some soft asserts with meaningful messages and at the and check them.

    Soft assert will not fail your test until you are explicitly call the assertAll()

    Create a SoftAssert object that you will use and at the end just call assertAll()

    This is not a good practice, and you should consider other techniques if you want faster UI tests.


Log in to reply
 

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2