Skip to content
CodeKruPro

Unique test data for every run

QuizEasy-MediumPython onlyAsked in: Capgemini

Sign-up tests fail on the second run because the e-mail address already exists. What is the usual fix?

  • Generate a unique value per test, for example f"user_{uuid.uuid4().hex[:8]}@test.example"
  • Delete the whole database before every test
  • Run the sign-up test only once per release
  • Add a retry

This question is part of Pro+

Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.

See Pro+

Already have Pro+? Sign in