To show a mobile sticky header accurately, capture the mobile viewport at the scroll position where the header is visible. For a useful before-and-after comparison, take one screenshot at the top of the page and another after scrolling until the header sticks. Use a full-page screenshot only when you need the whole document in a tall image; it does not replace a screenshot of the header in a specific scrolling state.
Choose the capture that shows the state you need
A sticky header changes position in response to scrolling, so the screenshot method matters. Playwright documents viewport, element, and full-page screenshots; its full-page mode captures the full scrollable page in a tall view. Playwright’s screenshot documentation describes these modes.
| Capture mode | What it shows | Best use for a sticky header |
|---|---|---|
| Viewport | The visible browser viewport at the current scroll position. | Show the header at the top or after it becomes sticky. Capture separate positions to document the change. |
| Element | A specific page element. | Show only the header. This is useful for a close-up, but by itself it may not show where the header sits in the page. |
| Full page | The full scrollable page as a tall image. | Show whole-document context. It may not communicate the header’s appearance at a particular scroll position. |
For sticky behavior, a pair of viewport captures is usually clearer than one full-page image: the top-of-page state and the scrolled state. This is a practical choice based on the documented capture modes, not a guarantee that full-page screenshots render sticky elements identically across browsers.
Set up mobile emulation in Playwright
Playwright lets you use a device preset or configure mobile-relevant properties such as viewport size and touch support. Its device emulation is a simulation, not proof that every physical phone will render the page the same way. For claims about behavior on a particular handset, validate on that physical device. See Playwright’s device emulation documentation.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchInstall Playwright
In a new project, install Playwright’s test package and the browser binaries:
npm init -y
npm install --save-dev @playwright/test
npx playwright install chromium
Capture the top and scrolled states
Save this as sticky-header.spec.js. It uses an iPhone device preset, takes a viewport screenshot before scrolling, scrolls the page, and takes another viewport screenshot. Replace the URL with the page you want to capture.
const { test, devices } = require('@playwright/test');
test.use({ ...devices['iPhone 13'] });
test('capture mobile sticky header states', async ({ page }) => {
await page.goto('https://example.com', { waitUntil: 'networkidle' });
await page.screenshot({ path: 'mobile-top.png' });
await page.evaluate(() => window.scrollTo(0, 700));
await page.waitForTimeout(300);
await page.screenshot({ path: 'mobile-sticky.png' });
});
Run it with:
npx playwright test sticky-header.spec.js
The first file captures the page at its initial position; the second captures the viewport after the requested scroll. The example scrolls a fixed 700 CSS pixels, so adjust the distance for the page. If the header sticks only after a specific element or condition, wait for that state instead of assuming one distance works everywhere.
Capture only the header
If you need a header-only image, locate it by a selector that matches the page and take an element screenshot. Replace header with the site’s actual selector if needed:
#1 Best Overall
- 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.****
const header = page.locator('header').first();
await header.screenshot({ path: 'mobile-header.png' });
An element screenshot is useful as a detail image. To show that the header is sticky rather than simply a static component, pair it with a viewport screenshot that preserves the surrounding page context.
Handle timing and page-specific behavior
Real pages may load fonts, images, or client-rendered content after navigation. A fixed pause can help with a short transition, but it cannot establish that a page is ready in every case. Prefer waiting for a meaningful page or header condition when you know one. For example:
await page.goto('https://example.com');
await page.locator('header').waitFor({ state: 'visible' });
await page.evaluate(() => window.scrollTo(0, 700));
await page.waitForTimeout(300);
await page.screenshot({ path: 'mobile-sticky.png' });
For lazy-loaded content, scroll far enough to trigger the relevant content before capturing. If the page uses a banner or animation that changes the header’s position, wait for that interface to settle or dismiss it in the same way a visitor would. These are page-specific decisions; mobile emulation alone does not ensure identical behavior to a physical phone.
Use Chrome DevTools Protocol for lower-level capture
If your automation already uses the Chrome DevTools Protocol (CDP), its Page domain documents screenshot capture for a region and a beyond-viewport option. That can help when you need control below the browser’s usual screenshot interface. For sticky-header behavior, first establish the desired scroll position, then capture the viewport or relevant region; a beyond-viewport image answers a different question from what a visitor sees while scrolling. See the CDP Page domain documentation.
Common problems and fixes
- The second image looks identical to the first: The scroll may not have occurred, the page may be too short, or the header may not become sticky at that distance. Confirm the document is scrollable and adjust the scroll position to where the behavior begins.
- The header is missing from the element screenshot: The selector may match the wrong element, or the header may not be visible yet. Use the site’s actual selector and wait for the element to become visible before capturing.
- The sticky state is not visible in the full-page image: Full-page capture produces a tall document image, not a record of the viewport at a chosen scroll position. Capture the scrolled viewport separately.
- The screenshot does not match a particular phone: Emulation sets device-like properties, but it is not physical-device testing. Check the page on the target handset when exact behavior matters.
- The screenshot catches a transition or incomplete content: Wait for the relevant selector, content, or animation to settle rather than relying on an arbitrary short delay.
Or skip the browser setup
ScreenshotNeo can capture a URL with one GET request and return an image or PDF. Its clean-shot workflow accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and billing status. Its MCP server provides screenshot and PDF tools for AI agents. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots. See ScreenshotNeo’s API documentation for options, including viewport and full-page capture.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
For a scrolled sticky-header state, configure the capture to scroll before taking the screenshot, or use the Playwright workflow above when you need explicit control over the browser’s scroll position. Sign up for 1,000 free screenshots a month with no card.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Frequently Asked Questions
Does a full-page screenshot show a sticky header’s behavior while scrolling?
Not necessarily. A full-page screenshot is a tall view of the scrollable document; use a viewport capture at the relevant scroll position to show the sticky state.
Does mobile emulation guarantee the screenshot will match a real phone?
No. Emulation simulates device properties such as viewport and touch support. Validate on the physical device if the exact handset’s behavior is important.
Quick Recap
Best Value
- 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.
Rank #4
- 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.
Rank #3
- 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.
Rank #2
- 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.
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.

