ScreenshotNeo

BlogHow-to

How to Take a Screenshot of a Mobile Website in LambdaTest Without Cropping

Set `fullPage: false` in LambdaTest SmartUI to capture only the visible mobile viewport. Choose the device, orientation, and dimensions for the screen you need.

By the ScreenshotNeo team4 October 20264 min read

To capture only the visible mobile screen in LambdaTest SmartUI, set fullPage: false. The documented mobile default is true, which captures the full page. Also select the intended mobile device or viewport dimensions and orientation so the screenshot has the shape you expect. LambdaTest SmartUI configuration documentation describes this setting.

1. Set SmartUI to capture the viewport

In the SmartUI configuration used for your mobile capture, explicitly disable full-page capture:

fullPage: false

This selects the viewport screenshot mode: the output is intended to show the currently visible viewport area. With fullPage: true, the capture extends across the page. Because the documented mobile default is true, setting false explicitly avoids relying on the default.

Use the configuration syntax and surrounding options required by the SmartUI SDK or workflow you already use; the setting above is the relevant mode switch, not a complete standalone test script.

2. Choose the mobile size and orientation

Set the device or viewport to match the screen you need to inspect. The SmartUI SDK configuration supports viewport width and height pairs, including examples such as 360 × 640, and supports custom browser and viewport combinations. The Responsive DOM workflow also provides mobile device and portrait or landscape orientation settings. Use the options supported by your particular capture path.

  • Viewport dimensions: Set width and height to the target browser viewport where your workflow allows it.
  • Device: Select the mobile device when using a device-based configuration.
  • Orientation: Choose portrait or landscape, then ensure the test browser viewport reflects the intended orientation.
  • Wait for page-specific content: If important content loads asynchronously or lazily, use a wait supported by your workflow and inspect the result. Responsive DOM documentation demonstrates an optional waitForTimeout.

For Responsive DOM specifically, the documentation notes a Firefox minimum DOM width of 450 px and a Selenium Chrome resizing limitation below 500 px in the described setup. These are limitations documented for that workflow, not universal browser limits.

3. Capture and check the result

  1. Open the target page in the selected mobile browser or responsive setup.
  2. Apply the intended dimensions and orientation.
  3. Set fullPage: false in the SmartUI capture configuration.
  4. Capture the screenshot and inspect it at the intended mobile size.
  5. If the output still differs from the desired visible screen, confirm that the workflow is using the configuration you edited and that no separate full-page hook or capture option is active.

Capture settings do not guarantee identical rendering for every site, page structure, or browser. Validate pages with sticky elements, delayed content, or layout changes at the chosen size.

4. Viewport screenshot versus full-page screenshot

Goal Setting or path What to expect
Show the visible mobile screen only fullPage: false Viewport screenshot mode
Capture the page beyond the visible screen fullPage: true Full-page capture
Use the SmartUI Hook full-page path Explicit full-page screenshot hook or configuration with fullPage: true Full-page output; choose this only when that is the desired result

SmartUI documents a separate full-page screenshot hook. Check the capture path as well as the configuration value when switching modes; a full-page path is not the viewport-only result you want.

5. Troubleshooting

Symptom Likely cause What to check
The screenshot includes the whole page fullPage is still true, omitted and defaulted to true, or a full-page capture path is in use. Set fullPage: false explicitly and inspect whether a full-page hook is selected.
The screenshot has the wrong proportions The configured viewport, device, or orientation does not match the target. Review the width and height pair or device and orientation settings; resize the test browser where the workflow calls for it.
The mobile viewport cannot be resized to the requested width A documented Responsive DOM setup constraint may apply. For that workflow, account for the documented Firefox minimum DOM width of 450 px and Selenium Chrome limitation below 500 px. Do not assume these figures apply to other workflows.
Content is missing from the screenshot The page may render it asynchronously or lazily, or the capture may happen before it appears. Use a page-appropriate wait such as the supported waitForTimeout, then capture and verify again.
The result still looks different from a real device Viewport settings do not ensure every site renders identically across devices or browser behavior. Verify the selected browser, dimensions, orientation, and page state; inspect the output at the target size.

6. Or skip the browser setup

ScreenshotNeo takes a website screenshot through one API request, returning an image or PDF. Use it when you need a screenshot without configuring a browser session. Its options include viewport sizes and device presets; see the ScreenshotNeo API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Cookie banners are accepted and removed before the shot, along with known newsletter popups and chat widgets; each cleanup step can be disabled. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and response headers report the page verdict and billing status. An MCP server lets AI agents use screenshot tools. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots.

Sign up for 1,000 free screenshots a month, with no card required.

FAQ

What setting stops a mobile SmartUI screenshot from capturing the full page?

Set fullPage: false in the mobile capture configuration.

Why do I need to set it explicitly?

The reviewed SmartUI SDK documentation says the mobile default is fullPage: true.

Does viewport-only capture guarantee every page element will appear exactly as it does on a phone?

No. The settings select the capture mode and viewport context; page structure, browser behavior, and loading can affect the result. Inspect the capture at the target size.