Skip to content
Preptima
mediumConceptDesignMidSenior

How do you get a browser test into the state it needs to start, without clicking through the UI to get there?

6 min readUpdated 2026-08-15Target archetype: Big Tech, Enterprise Captive, Product Startup

Answer

Short answer

Create the data through the API, restore an authenticated session from saved cookies and storage rather than logging in each time, and stub only the third parties you do not own, so each test drives the UI solely for the behaviour it is actually asserting.

Was this answer helpful?

Likely follow-ups

  • Your saved session expires halfway through a suite run. How should the setup handle that?
  • Where does the login flow itself get tested once every other test skips it?
  • A stubbed response drifts from what the real endpoint returns. How would you find out before your users do?
  • Which parts of setup would you deliberately keep slow and realistic, and why?

Related questions

Related Topics