<?xml version="1.0" encoding="UTF-8"?>
<response><data><post><id>46</id><slug>waiting-strategies-in-selenium-part-3-46</slug><title>Waiting strategies in Selenium, part 3</title><excerpt>In part 3 we take the ideas from earlier instalments and apply them to a larger, messier site. Most flaky Selenium tests are timing problems in disguise. The element exists, just not yet, and a fixed…</excerpt><seriesName>Waiting strategies in Selenium</seriesName><seriesPart>3</seriesPart><sections><item><heading>Introduction</heading><paragraphs><item>In part 3 we take the ideas from earlier instalments and apply them to a larger, messier site. Most flaky Selenium tests are timing problems in disguise. The element exists, just not yet, and a fixed sleep is either too short on a slow day or wastes time on a fast one.</item></paragraphs></item><item><heading>A practical approach</heading><paragraphs><item>Validate the data you extract. Prices without currencies, dates without time zones and empty fields are common sources of silent errors downstream.</item><item>Keep configuration such as base URLs, delays and selectors out of your code. Changing a delay should not require a redeploy.</item></paragraphs></item><item><heading>Step by step</heading><paragraphs><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><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>Replace sleeps with explicit waits for a specific condition: element visible, text present, or network idle, with a sensible timeout.</item></paragraphs></item></sections><authorId>9</authorId><authorName>Mateo Hughes</authorName><authorSlug>mateo-hughes</authorSlug><category>Browser Automation</category><tags><item>testing</item><item>python</item><item>selenium</item><item>scrapy</item></tags><publishedAt>2025-01-23T00:00:00.000Z</publishedAt><wordCount>163</wordCount><readingTimeMinutes>2</readingTimeMinutes></post></data></response>
