{"data":{"id":154,"slug":"testing-login-flows-end-to-end-part-8-154","title":"Testing login flows end to end, part 8","excerpt":"Part 8 looks at what changes when the same technique has to run every day in production. A login form is a small piece of UI with a surprising number of paths through it: success, wrong password,…","seriesName":"Testing login flows end to end","seriesPart":8,"sections":[{"heading":"Introduction","paragraphs":["Part 8 looks at what changes when the same technique has to run every day in production. A login form is a small piece of UI with a surprising number of paths through it: success, wrong password, locked account, slow responses and expired forms."]},{"heading":"Putting it into practice","paragraphs":["Treat HTTP 429 responses as a signal, not an obstacle. Read the Retry-After header, back off, and resume at a slower pace.","Pagination comes in several shapes: numbered pages, next links, offsets and opaque cursors. Each has trade-offs, and a robust scraper should detect the end of the result set rather than assuming a fixed number of pages.","Be careful with relative URLs. Resolve every link against the page it came from, not against the site root, or you will request pages that do not exist."]},{"heading":"A practical approach","paragraphs":["Read the site's terms of service before you start. Many sites welcome automated access within limits and say so explicitly; others ask you to use an API instead.","Selectors are the most fragile part of any scraper. Prefer stable attributes such as data-testid or semantic structure over generated class names, which can change on every deploy."]},{"heading":"Key takeaway","paragraphs":["Cover each account state with its own test, assert on visible messages and on the resulting URL, and give slow paths an explicit, generous timeout."]}],"authorId":8,"authorName":"Hannah Novak","authorSlug":"hannah-novak","category":"Testing","tags":["playwright","json","http","scrapy"],"publishedAt":"2026-04-14T00:00:00.000Z","wordCount":211,"readingTimeMinutes":2}}