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 desk6 min

How to Capture Playwright Screenshots of a Responsive Indian Banking Website

A practical Playwright workflow for repeatable desktop and mobile screenshots of authorized Indian banking test pages, with guidance on synthetic data, masking, capture scope, and artifact handling.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Playwright with explicit desktop and mobile browser configurations, navigate only to a bank-owned or otherwise authorized test URL, and capture the viewport, full page, or a specific element depending on what you need to review. For banking pages, use synthetic data and protect the resulting screenshots: they can expose account details and other confidential information.

Before you capture a banking page

Confirm authorization and scope

Use a staging or demo environment approved by the bank or site owner, and confirm which routes and states may be captured. A publicly accessible login page does not by itself authorize automated testing, account access, or production capture. The target bank and URL are unspecified here, so no particular site or page can be presumed safe to test.

As an Amazon Associate I earn from qualifying purchases.

Use synthetic data and control the artifacts

Prefer test accounts populated with synthetic details. Do not capture real credentials, balances, transaction history, customer identifiers, or one-time passwords. If a page needs to be shown, conceal sensitive fields in the test page or mask them in the screenshot. Keep images in access-controlled test storage and avoid attaching unredacted screenshots to tickets or logs; follow the bank’s retention and access policies.

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.

The RBI’s digital payment security direction addresses confidentiality controls for regulated entities and digital payment products and services; it is not a screenshot-specific procedure. The RBI also says banks should treat information collected to open an account as confidential: RBI notification on confidentiality of customer account-opening information. The Digital Personal Data Protection Act, 2023 describes lawful-purpose grounds for processing and gives a bank website or app account-opening example. Its provisions commence on dates appointed by government notification, so check current commencement and applicability rather than assuming all provisions apply solely because the Act was enacted: Digital Personal Data Protection Act and framework.

Set up repeatable responsive captures

Define a desktop viewport explicitly, then use a Playwright device descriptor for representative mobile behavior. Descriptors can set viewport, screen size, user agent, and touch capability; you can override the viewport when needed. A device profile is an emulation configuration, not proof that every physical handset or browser behaves identically. Check that the named descriptor exists in your installed Playwright version. See Playwright device emulation documentation.

Install Playwright Test and its browser binaries in your project, then set TEST_BASE_URL to the authorized test host. Create the output directory before running the tests. The example uses illustrative routes and a generic main readiness selector: replace both with paths and a stable, non-sensitive readiness condition from your application.

Runnable TypeScript example

import { test, devices } from '@playwright/test';

const baseURL = process.env.TEST_BASE_URL;
if (!baseURL) throw new Error('Set TEST_BASE_URL to an authorized test environment');

const routes = [
  { name: 'home', path: '/' },
  { name: 'login', path: '/login' },
];

test.describe('authorized responsive captures', () => {
  for (const route of routes) {
    test(`${route.name} desktop`, async ({ page }) => {
      await page.setViewportSize({ width: 1440, height: 900 });
      await page.goto(new URL(route.path, baseURL).toString());
      // Replace with the app's stable, non-sensitive readiness check.
      await page.locator('main').waitFor();
      await page.screenshot({
        path: `artifacts/${route.name}-desktop-1440x900.png`,
        animations: 'disabled',
        scale: 'css',
      });
    });
  }
});

test('authorized mobile view', async ({ browser }) => {
  const context = await browser.newContext({ ...devices['iPhone 13'] });
  const page = await context.newPage();
  await page.goto(new URL('/login', baseURL).toString());
  // Replace with the app's stable, non-sensitive readiness check.
  await page.locator('main').waitFor();
  await page.screenshot({
    path: 'artifacts/login-mobile-full.png',
    fullPage: true,
    animations: 'disabled',
    scale: 'css',
    mask: [page.locator('input[type="password"]')],
  });
  await context.close();
});

Run with your project’s Playwright Test command after creating artifacts and setting the environment variable, for example TEST_BASE_URL=https://authorized-staging.example npx playwright test. Replace the example host, route names, selector, and device descriptor with values approved for your environment. Avoid putting secrets in the command line or source control.

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

Choose the screenshot scope and output settings

Goal Playwright approach What the image contains
Check a breakpoint or visible layout page.screenshot() with an explicit viewport The current visible viewport.
Document a long page page.screenshot({ fullPage: true }) The full scrollable page, rather than only the visible viewport.
Review one panel or form locator.screenshot() The matched element.
Produce device-pixel output scale: 'device' Higher-density output that may produce a larger image.
Produce compact CSS-pixel-aligned output scale: 'css' Output scaled to CSS pixels.
Reduce animation variation animations: 'disabled' A capture with finite animations fast-forwarded and infinite animations canceled as documented by Playwright.
Conceal selected sensitive fields mask: [locator] Mask overlays covering the selected elements’ bounding boxes.

For component capture, locate the intended element and call await page.locator('your-selector').screenshot({ path: 'artifacts/panel.png' }). Use a selector tied to a stable, unique element. For sensitive content, a mask is a safeguard for the image, not a substitute for synthetic data or controlled storage. Playwright documents screenshot scope, masking, scale, and animation handling at Playwright screenshots and Page screenshot API.

Make desktop and mobile comparisons meaningful

A responsive comparison is useful only when the capture setup is recorded. Keep these axes consistent or label them in filenames and test metadata:

  • Viewport width and height, plus the emulated device profile.
  • Browser engine or Playwright project.
  • Route and UI state, including whether a consent banner or dialog is present.
  • Capture scope: viewport, full page, or element.
  • Image scale and animation treatment.

Use descriptive filenames such as account-summary-mobile-390x844-chromium.png, adding route/state and capture date where helpful. This is a workflow convention, not a Playwright requirement. Prefer the application’s meaningful readiness condition over an arbitrary delay; there is no universal selector or wait condition for banking sites.

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

Or skip the browser setup

ScreenshotNeo can capture a URL with one GET request. It accepts cookie/consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be disabled. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses include X-Page-Verdict and X-Billed headers. Use it only for URLs you are authorized to capture, and do not send sensitive banking credentials or account data to an external capture service.

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

Example cURL request (use an authorized, non-sensitive test URL):

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 the request options and response details. ScreenshotNeo also provides an MCP server for AI agents, with take_screenshot, get_page_info, and capture_pdf tools. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000, and every feature is available on every plan. For details, visit ScreenshotNeo. Sign up for 1,000 free screenshots a month with no card.

Troubleshooting common capture problems

The capture is blank or incomplete

Check that navigation reached the intended authorized page and that the app-specific readiness condition resolves only when the content is ready. A generic element such as main may appear before asynchronous content does; wait for a meaningful selector or state, not a guessed fixed delay.

The mobile image does not match the expected layout

Verify the descriptor is present in the installed Playwright version and confirm the viewport was not unintentionally overridden. Record the device profile, viewport, and browser project; device emulation cannot reproduce every hardware-specific behavior.

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

The image differs between runs

Hold route, UI state, browser engine, viewport, scale, and animation settings constant. Use animations: 'disabled' to reduce animation-related variation, and ensure test data and page state are repeatable.

Sensitive values remain visible

Use synthetic data wherever possible. If a field must be hidden, confirm the mask locator matches the element in the rendered page and inspect the output before sharing it. A mask covers an element’s bounding box; it does not make the underlying page safe to access or the screenshot safe to distribute.

The test fails because an output path is missing

Create the artifacts directory before running the sample, or change the screenshot paths to an existing writable location. Keep generated files out of public logs and repositories unless the bank’s policy allows them.

Operational checklist

  • Obtain approval for the environment, routes, and states before automation.
  • Use synthetic data and mask only as an additional safeguard.
  • Set explicit desktop dimensions and a verified mobile device profile.
  • Choose viewport, full-page, or element capture according to the review question.
  • Wait on stable application readiness, then label and securely store the output.

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.

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

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
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.