<?xml version="1.0" encoding="UTF-8"?>
<response><data><post><id>174</id><slug>testing-login-flows-end-to-end-part-9-174</slug><title>Testing login flows end to end, part 9</title><excerpt>For part 9, we revisit the basics with a fresh example and a few lessons learned the hard way. A login form is a small piece of UI with a surprising number of paths through it: success, wrong…</excerpt><seriesName>Testing login flows end to end</seriesName><seriesPart>9</seriesPart><sections><item><heading>Introduction</heading><paragraphs><item>For part 9, we revisit the basics with a fresh example and a few lessons learned the hard way. 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.</item></paragraphs></item><item><heading>Step by step</heading><paragraphs><item>Always identify your client honestly with a descriptive User-Agent, and keep your request rate modest. A crawler that behaves like a considerate visitor is far less likely to cause problems for the site operator.</item><item>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.</item><item>Store raw responses alongside parsed output while you are developing. When a parser breaks, you can replay the saved HTML instead of hitting the site again.</item></paragraphs></item><item><heading>Putting it into practice</heading><paragraphs><item>Keep configuration such as base URLs, delays and selectors out of your code. Changing a delay should not require a redeploy.</item><item>Treat HTTP 429 responses as a signal, not an obstacle. Read the Retry-After header, back off, and resume at a slower pace.</item></paragraphs></item><item><heading>Key takeaway</heading><paragraphs><item>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.</item></paragraphs></item></sections><authorId>3</authorId><authorName>Priya Nakamura</authorName><authorSlug>priya-nakamura</authorSlug><category>Testing</category><tags><item>ethics</item><item>playwright</item><item>scrapy</item></tags><publishedAt>2025-12-19T00:00:00.000Z</publishedAt><wordCount>210</wordCount><readingTimeMinutes>2</readingTimeMinutes></post></data></response>
