When a test fails, you need to know why. Don’t just rerun it—figure out what broke.

Start by reading the error message. Look at the line that failed. Was the element missing? Was the value wrong? Then check your app manually. Try to reproduce the issue.

Use screenshots or logs from your test run. If your tool supports it, turn on video recording. Use breakpoints or print() to trace what’s happening.

Sometimes the test is wrong. Other times the app changed. Look at recent commits. Check if the DOM changed or a new delay was added.

If the test fails sometimes but not always, it might be flaky. Add waits or stabilize your selectors. Don’t ignore these—they cause confusion and waste time.

Fix the cause, not the symptom. And if you can’t find it in 15 minutes, pair with someone or ask for help.