Authenticate an authorized test account, save its browser authentication state, load that state before opening the protected page, verify that you are still signed in, and then call page.screenshot(). Use fullPage: true when you need the entire scrollable page; by default Playwright captures only the current viewport. Treat the saved state and resulting screenshots as sensitive if they contain credentials or private data.
Before you automate the login
- Use an account you are authorized to automate, preferably a non-production test account. The app is not named, so its login flow, terms, access controls, and data sensitivity cannot be determined here. Confirm that automated access and capture are permitted.
- Keep credentials in environment variables or a secret store, not in test source.
- Decide whether captured pages may expose personal, customer, or employee data. Review and protect the output accordingly, and check the named provider’s current terms and your organization’s applicable data-handling rules before capturing real data. This workflow does not establish a specific legal conclusion for India.
Install Playwright and define the capture flow
The following TypeScript example uses Playwright Test. It separates authentication from the screenshot test: a setup test completes the real sign-in flow and stores browser state, and a dependent project reuses that state. Replace the example URLs, locators, and authenticated-page check with the Indian SaaS app’s actual login flow and UI.
As an Amazon Associate I earn from qualifying purchases.
-
Install the test runner
In a Node.js project, install Playwright Test and its browser binaries:
Free tools Windows power users keep installed
One-click scans. No signup required.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.npm init playwright@latestChoose TypeScript if prompted. The setup below uses the
@playwright/testpackage.#1 Best Overall
HP OmniBook 3 17.3 inch Laptop PC, FHD Display, AMD Ryzen 3 30, 8 GB RAM, 512 GB SSD, AMD Radeon 610M Graphics, Windows 11 Home, Mica Silver, 17-dp0199nr- FULL HD IPS DISPLAY - Enjoy vibrant, crystal-clear images with 178-degree wide-viewing angles
- AMD RYZEN 3 30 PROCESSOR - Everyday performance you can count on; Multitask, stream, game casually, and edit photos smoothly with responsive power and vibrant HDR visuals
- ENJOY UP TO 14 HOURS AND 15 MINUTES OF BATTERY LIFE - HP Fast Charge restores battery from 0 to 50% in approximately 45 minutes
- AMD RADEON 610M GRAPHICS - Experience smooth entertainment; Built for streaming and multitasking, enjoy realistic visuals and efficient performance for work and play
- STORAGE AND MEMORY - 512 GB PCIe NVMe M.2 SSD offers fast speed and efficient storage; and 8 GB LPDDR5 RAM memory boosts performance with higher bandwidth
-
Keep the state file out of version control
Add the authentication directory to
.gitignore:playwright/.auth/Playwright warns that a browser state file may contain sensitive cookies and headers that could be used to impersonate the account. Do not commit it or publish it as a build artifact accessible to untrusted users.
-
Create the authentication setup test
Save this as
tests/auth.setup.ts. SetAPP_LOGIN_URL,APP_TEST_EMAIL, andAPP_TEST_PASSWORDin your local environment or CI secret store. The label and button locators are examples; use locators that match the app.import { test as setup, expect } from '@playwright/test'; setup('authenticate', async ({ page }) => { await page.goto(process.env.APP_LOGIN_URL!); await page.getByLabel('Email').fill(process.env.APP_TEST_EMAIL!); await page.getByLabel('Password').fill(process.env.APP_TEST_PASSWORD!); await page.getByRole('button', { name: /sign in/i }).click(); // Replace with a reliable authenticated UI signal for your app. await expect(page.getByRole('button', { name: /account|profile/i })).toBeVisible(); await page.context().storageState({ path: 'playwright/.auth/user.json' }); });Wait for a trustworthy signal—such as the final URL or an authenticated UI element—before writing the state file. If the app supports an appropriate authentication API, the Playwright authentication guide also describes using it instead of automating the UI sign-in.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsSpecial offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.Rank #2
HP 14" HD Chromebook Laptop for Students, Intel Quad-Core N4120(> N4020), 4GB RAM, 64GB eMMC, WiFi, Webcam, HDMI, USB-A&C, 14 Hours Battery Life, Zoom, Chrome OS, CUE Accessories- Intel Celeron N4120: 4 Cores & Threads, 1.1GHz Base Clock, Up to 2.6GHz Boost Clock, 4MB Cache, Intel UHD Graphics 600. The perfect combination of performance, power consumption, and value helps your device handle multitasking smoothly and reliably with four processing cores to divide up the work.
-
Configure a setup project and a dependent capture project
Save this illustrative configuration as
playwright.config.ts. The setup project runs first; the capture project loads the state file before its tests.import { defineConfig } from '@playwright/test'; export default defineConfig({ projects: [ { name: 'setup', testMatch: /.*.setup.ts/ }, { name: 'capture', use: { storageState: 'playwright/.auth/user.json' }, dependencies: ['setup'], }, ], }); -
Open the protected route, verify the session, and capture
Save as
tests/capture.spec.ts. Replace the example route and signed-in check with those for your app.import { test, expect } from '@playwright/test'; test('capture authenticated dashboard', async ({ page }) => { await page.goto('https://app.example.in/dashboard'); await expect(page.getByRole('button', { name: /account|profile/i })).toBeVisible(); await page.screenshot({ path: 'artifacts/dashboard.png', fullPage: true }); });Run the test with
npx playwright test. The assertion is important: without it, an expired session or failed state load could leave you capturing a login page while believing it is the dashboard.Rank #3
SaleAKCHART 15.6'' AI Laptop with Office 365 12GB RAM 256GB SSD Win 11 Laptops | 7000mAh Battery, IPS FHD, 180°Viewing, Quad-Core Processor, Type-C, WiFi5, Portable Thin Business Student Laptops, Light Gray- Stunning 15.6" FHD IPS Display: Experience crisp 1920x1080 resolution on this 15.6 inch laptop with an IPS panel that delivers wide viewing angles and vivid colors. The narrow-bezel design maximizes screen real estate for comfortable viewing on this Win 11 laptop, whether you're studying or working.
- Celeron J4105 Processor & 256GB SSD: Powered by a reliable Celeron J4105 processor paired with 12GB DDR4 memory and a fast 256GB M.2 SSD. This laptop computer supports SSD expansion up to 2TB and TF card expansion up to 1TB, so your storage grows with your needs. Delivers smooth multitasking for daily productivity.
- AI-Powered Win 11 Laptop: Built-in AI features enhance your productivity with smart assistance for writing, summarizing, and task management. Pre-installed with Win 11 and includes Office 365 subscription. This student laptop is backed by 1-year warranty and 24/7 customer support.
- All-Day 7000mAh Battery & 180° Hinge: The high-capacity 7000mAh battery keeps this laptop powered through long classes or meetings. The 180-degree lay-flat hinge lets you share your screen effortlessly during presentations. This durable laptop computer adapts to your dynamic workflow.
- Versatile Connectivity Hub: Equipped with USB 3.2, Type-C, Mini HDMI, and 3.5mm audio jack to connect all your peripherals. Stay online anywhere with high-speed 5G WiFi and Bluetooth 4.2. This college laptop keeps you connected at home, in the library, or on the go.
Choose the screenshot extent and treatment
Playwright’s page.screenshot() supports the visible viewport, the full scrollable document, a rectangular clip, and locator masks. Use the option that matches the artifact you need:
Recommended Free Tools
await page.screenshot({ path: 'artifacts/view.png' })captures the current viewport becausefullPagedefaults tofalse.await page.screenshot({ path: 'artifacts/full.png', fullPage: true })captures the full scrollable page.clipcan capture a specified rectangle when you need a particular region.maskwith locators can cover selected elements in the image. Review the saved artifact to make sure the intended private content is actually obscured; masking is not a substitute for controlling access to the original page or output.
For the complete option signatures and version-specific behavior, check the Playwright screenshot API.
Match storage state to the app’s authentication mechanism
The standard reusable state workflow covers cookies and local storage. Some applications rely on additional browser storage, so confirm how the app stores its authentication before assuming the basic JSON file is sufficient. The exact available options can vary by installed Playwright version; check the storageState API for the version in your project.
Rank #4
- Efficient Performance for Everyday Computing: Powered by Intel N150 processor with up to 3.6 GHz Intel Turbo Boost Technology, 6 MB L3 cache, 4 cores, and 4 threads, this HP laptop delivers responsive performance for web browsing, streaming, document editing, and multitasking. Paired with 4GB LPDDR5 RAM and 128GB UFS storage, it handles daily tasks smoothly. Includes 1-year Microsoft 365 Personal subscription for Word, Excel, PowerPoint, and cloud storage to maximize your productivity.
- 14-Inch HD Micro-Edge Display:Enjoy clear visuals on the 14-inch HD (1366 x 768) anti-glare screen with 250-nit brightness and 62.5% sRGB coverage. The micro-edge bezel delivers a 79% screen-to-body ratio in a compact design. An HP True Vision 720p HD camera with noise reduction and dual-array microphones supports clear video calls, remote work, and online learning.
- Modern Connectivity and Wireless Technology: Stay connected with Wi-Fi 6 (2x2) for faster wireless speeds and Bluetooth 5.4 for seamless pairing with accessories. Versatile port selection includes 1 USB Type-C 10Gbps with DisplayPort 1.2 for external displays, 2 USB Type-A 5Gbps ports for peripherals, 1 HDMI 1.4b port, 1 headphone/microphone combo jack, and 1 multi-format SD media card reader. Connect monitors, transfer files quickly, and expand your workspace with ease.
- All-Day Battery Life and Portable Design: Enjoy up to 11 hours of video playback, 7.5 hours of mixed usage, or 7.5 hours of wireless streaming on a single charge, perfect for students and professionals on the go. Weighing just 3.24 lb and measuring 12.76" x 8.86" x 0.71", this lightweight laptop fits easily in backpacks and bags. The stylish willow green top cover with matte finish and natural silver keyboard deck with vertical brushing pattern offer a modern, professional look.
- AI-Enhanced Productivity: Access Microsoft Copilot instantly with the dedicated Copilot key for faster assistance. AI Noise Reduction filters background sounds and improves voice clarity during calls. Dual speakers provide clear audio, while the full-size natural silver keyboard and HP Imagepad support comfortable typing and navigation.
- IndexedDB: If tokens or session data are stored there, use the documented
indexedDBoption when saving state, where supported. - sessionStorage: The ordinary reusable-state workflow does not persist it across page loads. Playwright’s authentication guide demonstrates saving it manually and restoring it with an initialization script.
- Other state: The current API documentation includes OPFS and virtual WebAuthn credential options. OPFS is not supported in ephemeral WebKit contexts. Verify both support and the exact option syntax against your installed version.
- Browser-specific login: A state file created in one browser may not work in another if authentication is browser-specific. Keep state separate when the app requires it.
Run reliably across tests and capture purposes
Choose account isolation for parallel runs
A shared account can work when tests run together without affecting one another’s server-side state. If tests change shared data, Playwright recommends a unique account per parallel worker to avoid conflicts.
Refresh expired authentication
A saved state file is not a permanent login. When the app invalidates the session, run the authentication setup again and replace the state. In Playwright UI mode, the setup project does not run by default; the authentication guide recommends running the setup when stored state expires.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Keep visual-regression baselines consistent
For repeatable visual comparisons, expect(page).toHaveScreenshot() generates a baseline on first run and compares later runs. Rendering can vary with the host operating system, browser version, settings, hardware, power source, and headless mode. Use a consistent execution environment for creating and checking baselines where possible. Playwright’s screenshot assertion waits for two consecutive screenshots to match before saving a new baseline; its visual comparisons guide also covers masking or styling out dynamic content and updating reference snapshots.
Best Value
- 【Expansive Display】The 14 Non-touch display offers clear, and anti-glare coating, perfect for both work and entertainment.
- Designed for mobility with a slim 0.71-inch profile and lightweight, making it easy to carry between home, office
- 【Versatile Connectivity】 connected with multiple ports including USB 3.0 Type-C, and a headphone/mic combo jack, with Wi-Fi and Bluetooth for seamless wireless networking.
- One Year Microsoft 365
Troubleshoot common failures
- The screenshot shows the login page: The saved state may be expired, may not contain the app’s required storage, or may have been loaded after navigation. Save state only after a confirmed sign-in, load it in the context before visiting the protected route, and assert an authenticated UI element before capture.
- Cookies load but the app still treats the browser as signed out: The app may keep tokens in IndexedDB or sessionStorage rather than only cookies or local storage. Check the app’s authentication mechanism and apply the corresponding state handling described above.
- The setup test cannot find the email, password, or sign-in controls: The sample locators do not match every app. Inspect the actual labels and accessible roles, then replace the locators and signed-in check with app-specific ones.
- The state file is missing when the capture project starts: Ensure the setup project matches the configured test filename, the capture project depends on setup, and the setup completed successfully before capture.
- The screenshot is cut off at the viewport: Set
fullPage: true; the default captures only the viewport. - A visual baseline changes unexpectedly: Run baseline creation and comparisons in a consistent browser and host environment. Identify dynamic content and mask or style it out only when appropriate.
- Parallel tests interfere with one another: Use separate accounts per worker when tests mutate shared server-side state; a shared account is suitable only when concurrent tests do not conflict.
- Sensitive material appears in a screenshot or state file: Restrict access to both files, remove exposed artifacts from public or shared locations, and refresh credentials or state if exposure could allow account impersonation.
Or skip the browser setup
For a one-call capture, ScreenshotNeo accepts a URL and returns an image or PDF. Its clean-shot workflow accepts cookie and 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 cost nothing, and response headers report the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. It is not a replacement for authenticating into an account you are authorized to use: do not send private page URLs or credentials unless the service and your data-handling rules permit it.
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 authentication and request options. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000. Sign up for 1,000 free screenshots a month with no card.
Further reading
- Playwright authentication guide
- Playwright storageState API
- Playwright screenshot API
- Playwright visual comparisons guide
Frequently Asked Questions
Does this workflow depend on the SaaS app being hosted in India?
No. The Playwright steps are not specific to a country; the app’s own access rules and your organization’s data-handling requirements still apply.
Can one saved state file be reused across different browsers?
Not reliably when the app uses browser-specific authentication. Check the app’s behavior and create separate state for browser projects if needed.
Quick Recap
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.

