<?xml version="1.0" encoding="UTF-8"?>
<response><data><post><id>134</id><slug>testing-login-flows-end-to-end-part-7-134</slug><title>Testing login flows end to end, part 7</title><excerpt>In part 7 we take the ideas from earlier instalments and apply them to a larger, messier site. 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>7</seriesPart><sections><item><heading>Introduction</heading><paragraphs><item>In part 7 we take the ideas from earlier instalments and apply them to a larger, messier site. 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>What to watch for</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>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.</item><item>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.</item></paragraphs></item><item><heading>Putting it into practice</heading><paragraphs><item>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.</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>Validate the data you extract. Prices without currencies, dates without time zones and empty fields are common sources of silent errors downstream.</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>8</authorId><authorName>Hannah Novak</authorName><authorSlug>hannah-novak</authorSlug><category>Testing</category><tags><item>http</item><item>scrapy</item><item>json</item><item>ethics</item></tags><publishedAt>2026-08-25T00:00:00.000Z</publishedAt><wordCount>246</wordCount><readingTimeMinutes>2</readingTimeMinutes></post></data></response>
