Plain assert vs SoftAssert, which one is better?

2 days ago 4
ARTICLE AD BOX

I'm writing Appium UI tests in Python for Android. I want to add checks after each section of my test to verify each step passed:

Login (3 screens: Username/Password → OTP → PIN, all 3 must pass to consider login successful) Upload Documents (5 mandatory documents to upload) Fill in around 15 mandatory fields grouped into 3 sections (Hospital Details, Claim Details, Claim Benefits) Submit the claim

I found 2 ways to do this:

Plain assert - Simple and easy to understand. But the test stops immediately at the first failure so I won't see the other failures until I fix and re-run.

SoftAssert class - I find it more complicated to set up but collects all failures and reports them together at the end, so I can see everything that failed in one single run.

My questions:

Which one do you recommend for beginners? Which is easier to maintain long term? Is there a better/standard way I'm missing? When should I move from plain assert to SoftAssert?

Context: Python 3.11, Appium 2.x, no pytest yet (plain .py script), solo learner.

Read Entire Article