October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

How to Capture a Shopify Product Screenshot with Playwright After a Price Update

Wait for the storefront's actual variant price with a Playwright assertion before capturing a Shopify product screenshot.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To capture the updated price, select the Shopify variant, wait for a Playwright assertion to confirm the storefront displays the expected price, and only then take the screenshot. Do not use a fixed sleep or networkidle as a substitute for checking the price itself: a page can finish loading before its client-side variant update is visible.

Use the price the shopper sees as your readiness condition

Shopify product pages commonly let shoppers choose variants such as size or color. The displayed price should reflect the selected variant, but Shopify does not prescribe one universal price selector for every merchant theme. Inspect the actual storefront and use a stable accessible locator or a test ID provided by the theme.

As an Amazon Associate I earn from qualifying purchases.

Playwright web-first assertions retry their locator checks until the expected condition is satisfied or the assertion times out. Because the locator is reevaluated as the page changes, this approach works for dynamically updated price markup. The sequence is: navigate, make any required consent or setup choices, select the variant, assert the visible price, then capture.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

One-off capture with Playwright Test

This TypeScript example uses Playwright Test. Replace the URL, selector, option label, and expected price with values from your store; none of the example values are universal Shopify markup.

#1 Best Overall
Sale
Motorola Moto g - 2026 | Unlocked | Made for US 4/128GB | 50MP Camera | Pantone Slipstream, Cellular_Phone
  • Universal unlocked. Compatible with all major U.S. carriers, including Verizon, AT&T, T-Mobile and other prepaid carriers.
  • Super-bright, super-smooth 6.7" display. See your screen clearly even outdoors in sunlight, and enjoy seamless views with a fast-refreshing 120Hz display.*
  • AI-powered camera system. Take stunning photos in any light with the 50MP camera**, look your best with a 32MP selfie cam*****, and capture extreme close-ups.
  • Superfast 5G performance. Unleash your entertainment at 5G speed*** with the MediaTek Dimensity 6300 chipset and up to 12GB of RAM with RAM Boost****.
  • Long-lasting battery + TurboPower charging. Power through day after day with a 5200mAh battery, then get hours of power in just minutes.****
import { test, expect } from '@playwright/test';

test('captures the selected Shopify variant price', async ({ page }) => {
  await page.goto('https://store.example/products/example');

  // Replace these locators and expected text with values from the target theme.
  await page.getByLabel('Size').selectOption({ label: 'Large' });
  await expect(page.getByTestId('product-price')).toHaveText('$29.00');

  await page.screenshot({ path: 'product-price.png', fullPage: true });
});

Choose an assertion that matches the storefront

Use toHaveText when the expected price is known exactly, including the store’s currency and formatting. If formatting legitimately varies, use an appropriate regular expression or another assertion that still confirms the intended visible price. Confirm the locator identifies the currently displayed price, not a hidden price for another variant.

If availability matters to the capture, assert that state too—for example, whether the selected variant is sold out. Shopify theme guidance covers updating price and sold-out messages when a variant changes, and Shopify accessibility guidance says dynamic price and availability changes should be communicated to screen readers. An assertion against the user-visible state tests what the shopper is meant to see.

Rank #2
Sale
Samsung Galaxy A17 5G Smart Phone 128GB US 1 Yr Manufacturer Warranty Black | Large AMOLED, High-Res Camera, Durable Design, Super Fast Charging, Expandable Storage, Circle to Search, 2025
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.

Visual regression instead of a one-off image

For a visual regression test, use Playwright Test’s screenshot assertion after the price assertion:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await expect(page.getByTestId('product-price')).toHaveText('$29.00');
await expect(page).toHaveScreenshot('product.png');

toHaveScreenshot waits until two consecutive page screenshots match, then compares the last capture with the expected snapshot. Use this when you need a baseline comparison; use page.screenshot() when you simply need an image file, such as for a bug report or review.

Rank #3
Sale
Samsung Galaxy A16 5G 128GB Cell Phone, Unlocked Android Smartphone, Large AMOLED Display, Durable Design, Super Fast Charging, Expandable Storage, US Version, 2025, Blue Black (Renewed)
  • Charger NOT Included, 6.7" Super AMOLED FHD+, 90Hz Refresh Rate, 385 ppi, 800 nits (HBM), 1080x2340px, 5000mAh Battery
  • 128GB, 4GB RAM, microSDXC, Exynos 1330 (5nm), Octa-Core, Mali-G68 MP2 or Mali-G57 MC2 GPU
  • Rear Camera: 50MP, f/1.8 (wide) + 5MP, f/2.2 (ultrawide) + 2MP, f/2.4 (macro), LED flash, panorama, HDR; Front Camera: 13MP, f/2.0, Android 14, up to 6 major Android upgrades, One UI 6.1
  • 3G: HSDPA 850/900/1700(AWS)/1900/2100; 4G LTE: 1/2/3/4/5/7/12/13/14/20/25/26/28/29/30/38/39/40/41/48/66/71, 5G: 2/5/25/41/66/71/77/78 SA/NSA/Sub6/mmWave - Nano-SIM + eSIM
  • US Model – Global Connectivity – Compatible with Most GSM Carriers like T-Mobile, AT&T, MetroPCS, etc. Will Also work with CDMA Carriers Such as Verizon, Straight Talk.

Keep the environment used to create and compare visual baselines consistent. Browser version, operating system, settings, hardware, and headless mode can affect rendering, so environment changes can create visual differences unrelated to a storefront change.

Why not wait for a load event, a sleep, or network idle?

  • A load event is not the price condition. The page may have loaded while JavaScript is still updating the selected variant’s price.
  • A fixed sleep is a guess. It can waste time when the update is fast and still fail when it takes longer than expected. If the price assertion times out, investigate the actual state instead of capturing anyway.
  • networkidle is discouraged for test readiness. Playwright recommends relying on web assertions to assess readiness. A quiet network does not establish that the intended price is on screen.

Troubleshoot a price assertion that times out

Check that the variant selection succeeded

Verify the control is the one shoppers use and that the option label exists. A label-based locator such as getByLabel('Size') works only if the page exposes that accessible label and the control supports the selection method shown. If the store uses buttons or a custom selector, adapt the interaction to its actual markup.

Rank #4
Sale
Samsung Galaxy A17 5G Smart Phone 128GB, US 1 Yr Manufacturer Warranty Blue | Large AMOLED, High-Res Camera, Durable Design, Super Fast Charging, Expandable Storage, Circle to Search, 2025
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.

Confirm the variant and expected price

Make sure the chosen variant exists and that the asserted price is correct for the storefront, including currency symbol, decimal formatting, discounts, and locale. Do not assume a sample value such as $29.00 is correct for another product or region.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Inspect the price locator

Check that the locator resolves to the visible price for the selected variant. A theme may render multiple price elements—for example, hidden content, compare-at pricing, or prices in other page regions. Prefer a stable accessible locator or a theme-owned test ID, and narrow it to the correct product area if needed.

Best Value
Tracfone Motorola Moto G 2025, 64GB, Saphire Blue (Locked to | Prepaid Smartphone- 6.6" 120Hz Display, 5G , 50MP Quad Pixel Camera, Long-Lasting Battery
  • Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Tracfone plan required, activating is easy, just 3 steps.
  • DISPLAY: Immersive viewing on a 6.7-inch super-bright 120Hz display with powerful stereo speakers and Bass Boost for cinematic entertainment.
  • CAMERA SYSTEM: Advanced 50MP Quad Pixel camera captures sharp, detailed photos and videos in any lighting condition
  • PERFORMANCE: Lightning-fast 5G connectivity paired with a powerful processor and RAM Boost for smooth multitasking.
  • BATTERY LIFE: Long-lasting 5000mAh battery with TurboPower charging technology delivers hours of power in minutes.

Handle consent and storefront setup before the assertion

If a consent banner or other required setup blocks the product controls, address it before selecting the variant. The test should proceed through the same relevant storefront state that the screenshot is intended to represent.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If you need a screenshot artifact rather than a Playwright assertion or visual-regression test, ScreenshotNeo can capture a page with one GET request. It is a screenshot API and MCP server for developers; the API returns an image or PDF. ScreenshotNeo accepts cookie or consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status in headers. Its MCP server provides screenshot tools for Claude, Cursor, and other MCP clients.

See the ScreenshotNeo API documentation for request options. Example using cURL:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://store.example/products/example -o shot.webp

ScreenshotNeo’s free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. The API captures a page, but it does not replace a Playwright test that must select a variant and verify a specific updated price. Sign up for 1,000 free screenshots a month with no card.

Frequently Asked Questions

Does every Shopify product page use the same price selector?

No. Shopify does not define one universal price selector for every merchant theme. Inspect the target storefront and use a stable accessible locator or a theme-provided test ID.

Should I use page.waitForTimeout() before taking the screenshot?

Not as the readiness check. Assert the expected visible price with a web-first assertion so the capture follows the actual update rather than an arbitrary delay.

Can ScreenshotNeo verify that selecting a variant changed the price?

No. Its screenshot request captures a page; the Playwright workflow is the appropriate choice when you must interact with a variant control and assert the resulting price.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.