Free tools Windows power users keep installed
One-click scans. No signup required.
Playwright usually captures an old price because the test reads it before the product page has finished updating, or because it reads the wrong price element or product variant. Wait for the relevant page state or price-changing response, then assert the intended visible price with a retryable locator. Without the page URL, selector, and test code, the exact cause cannot be confirmed.
Why the price can be stale
The page is visible before its JavaScript behavior is ready
Navigation completion and application readiness are different. A storefront can render initial HTML, including a provisional price, before client-side JavaScript hydrates the page and updates its interactive state. Playwright’s navigation documentation describes this distinction. A page being loaded or an element being visible does not by itself establish that the final price has appeared.
As an Amazon Associate I earn from qualifying purchases.
A variant selection triggers an asynchronous price change
Size, color, or another option may cause the storefront to request a new price. If the test reads the price immediately after selecting the option, it may get the previous variant’s value. Playwright documents waiting for a matching response with page.waitForResponse; the wait should be registered before the action that triggers the request.
Recommended Free Tools
The test reads a different price than the one the shopper sees
Product pages can show more than one amount, such as a crossed-out list price and a current sale price, or prices for multiple variants. A selector that matches more than one node, or a selector aimed at the wrong node, can return a valid but unintended value. Decide first whether the expected amount is for the default variant, the selected variant, or a particular displayed price.
#1 Best Overall
Diagnose the cause in order
- Define the expected price. Record the intended variant and whether the test should read the sale price, list price, or another amount.
- Check the locator. Inspect how many elements it matches and whether it targets the visible current price rather than a crossed-out or hidden amount.
- Observe the page at both stages. Compare the relevant element after navigation with its state after hydration and after selecting the option. This shows whether the DOM changes after the initial render.
- Inspect the request and response. If selecting the option triggers a request, wait for the site-specific response and compare its payload with the rendered text. A response containing the expected amount while the page still shows the old one points to a rendering or timing issue; a response containing the old amount shifts attention to the selected variant or store behavior.
- Use a retryable assertion for the final state. Playwright locator assertions retry until the condition passes or times out. They help with transient updates, but they cannot decide which price is semantically correct; the assertion must name the intended value and target the correct locator.
- Investigate cache only with request evidence. Playwright documents that enabling routing disables HTTP cache. That can help examine request behavior, but it does not establish cache as the cause of a stale price. Changing routing may also alter test behavior.
Wait for a price-changing response, then verify the page
Use this pattern when selecting a variant causes a request. Replace the response predicate, option, locator, and expected price with values observed for the actual store. The example is a pattern, not a reproduction of a particular retailer.
const responsePromise = page.waitForResponse(response =>
response.url().includes('/product-price') && response.status() === 200
);
await page.getByLabel('Size').selectOption('large');
const response = await responsePromise;
// Inspect response data as appropriate, then verify the intended visible price.
await expect(page.getByTestId('product-price')).toHaveText('$42.00');
The predicate is deliberately site-specific: use the actual endpoint or other reliable characteristics of the request. Starting the wait before the selection prevents the test from missing a fast response. The final locator assertion checks the rendered value, not merely that a request finished. See Playwright’s response-wait API and locator assertion guidance.
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
Why a fixed sleep is not a dependable fix
A fixed delay can make a test appear to work when the update usually finishes within that interval, but it does not prove the page reached the correct state. A slower response can still outlast the delay; a fast response simply makes the test wait unnecessarily. Prefer waiting for the specific response when one drives the change, followed by an assertion on the intended visible price.
Troubleshoot common outcomes
- The response wait times out: confirm that selecting this option actually makes a request, and adjust the predicate to match the real URL and status. Register the wait before the selection.
- The response arrives but the assertion times out: inspect whether the response data matches the expected amount and whether the page updates a different node or requires another state change.
- The assertion passes with the wrong amount: check for multiple matching elements and clarify which variant and price type the test is meant to verify.
- Routing changes the result: routing disables HTTP cache in Playwright. Compare the requests and responses in the original and routed test setups before attributing the behavior to cache.
- The price changes without a matching request: inspect the DOM over time and the storefront’s client-side update behavior; the available evidence does not identify a universal wait condition for every site.
Or skip the browser setup
If you need a screenshot rather than a Playwright test of the page’s price logic, ScreenshotNeo is a website screenshot API and MCP server. A one-call capture can save a WebP image:
Rank #3
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. It accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; those steps can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. Its MCP server includes take_screenshot, get_page_info, and capture_pdf for AI agents. The free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots.
Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month, no card required.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Frequently Asked Questions
Does Playwright automatically wait for the product price to finish changing?
Locator assertions retry for the expected condition, but Playwright cannot infer which variant or price is correct. Assert the intended value on the correct locator.
Rank #4
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
Does a stale price prove the browser used a cached response?
No. Cache is one possibility to investigate using actual request and response evidence; a stale value alone does not establish it.
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




