October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan 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 desk8 min

How to Automatically Log In to Websites with 1Password and Playwright

A practical guide to 1Password’s user-directed browser Autofill and Playwright’s reusable authentication state, including setup, security, and common fixes.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For everyday browsing, use 1Password’s browser extension: choose the matching Login item on the sign-in page, or use Open & Fill. For repeatable browser tests, authenticate once in Playwright, save the browser’s storage state, and load it into later test contexts. These are separate workflows: the extension is user-directed, while Playwright reuses an authenticated session. The documented workflows here do not establish a supported direct connection that lets Playwright retrieve 1Password Login-item credentials.

Choose the right sign-in workflow

Approach Best for How authentication works Main tradeoff
1Password browser extension A person signing in while browsing You select a matching Login item; the extension fills it, and may submit the form depending on your settings. Site behavior may require another step. Check the domain and confirm the result.
Playwright saved storage state Repeated tests on a site you are authorized to test A setup test signs in once and saves browser state; later contexts load that state. The state file is sensitive, and the session can expire.

Neither approach guarantees an unattended sign-in on every site. Multifactor authentication, passkeys, CAPTCHA, site policies, and other controls can affect whether a login can be automated.

As an Amazon Associate I earn from qualifying purchases.

Use 1Password to sign in while browsing

Prepare the Login item and extension

  1. Install the 1Password extension for your supported browser and sign in to the extension.
  2. Open the Login item you intend to use and check that its website address matches the site’s sign-in domain. 1Password uses the saved URL to match a login to a website.
  3. Navigate to the site’s sign-in page and check the domain in the address bar before filling credentials.

On the sign-in page, select the 1Password prompt and choose the appropriate Login item. Alternatively, open the extension and use Open & Fill to open the saved site and fill the matching login. According to 1Password’s support instructions, the extension signs in after the chosen Login is filled; if the site uses an unusual or multi-step form, you may need to complete another step or confirm the outcome. See 1Password’s browser extension instructions.

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

Control automatic form submission

1Password says it submits filled forms by default, but you can disable that behavior in the extension’s Autofill & save settings. Turn it off if you want to inspect the filled form or submit it yourself. Form structures vary, so even with automatic submission enabled, check that the site reached the intended account page rather than assuming the login succeeded.

#1 Best Overall
Yubico - Security Key C NFC - Basic Compatibility - Multi-Factor authentication (MFA) Security Key and passkey, Connect via USB-C or NFC, FIDO Certified
  • POWERFUL SECURITY KEY: The Security Key C NFC is the essential physical passkey for protecting your digital life from phishing attacks. It ensures only you can access your accounts.
  • WORKS WITH 1000+ ACCOUNTS: Compatible with Google, Microsoft, and Apple. A single Security Key C NFC secures 100 of your favorite accounts, including email, password managers, and more.
  • FAST & CONVENIENT LOGIN: Plug in your Security Key C NFC via USB-C and tap it, or tap it against your phone (NFC) to authenticate. No batteries, no internet connection, and no extra fees required.
  • TRUSTED PASSKEY TECHNOLOGY: Uses the latest passkey standards (FIDO2/WebAuthn & FIDO U2F) but does not support One-Time Passwords. For complex needs, check out the YubiKey 5 Series.
  • BUILT TO LAST: Made from tough, waterproof, and crush-resistant materials. Manufactured in Sweden and programmed in the USA with the highest security standards.

Autofill is not supposed to happen without a user action: 1Password’s security documentation states, “1Password will never Autofill without your input, even when there’s only one suggested item available.” URL matching helps, but does not replace checking the domain. 1Password warns that deceptive pages can try to induce interaction with Autofill, including through overlays or clickjacking. Keep your browser and extension current, and use deliberate confirmation when the destination or prompt is unexpected. See 1Password’s browser Autofill security guidance.

Reuse an authenticated session in Playwright

Playwright’s documented pattern is to sign in in a setup test, save the browser context’s storage state, and configure subsequent tests to load that state. This prevents each test from repeating the same login routine. The following example uses a site-specific login form as an illustration; replace the URL and selectors with those for a site you are authorized to test. It assumes the test credentials are supplied outside the source file as environment variables.

1. Add the state directory to .gitignore

Before running the setup, prevent generated authentication state from being committed:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
ATLKey USB-C Security Key for Passkey & 2FA, FIDO2/U2F Certified with 3-Side Touch & Multi-Color LED, Stores 100 Passkeys, Phishing-Resistant Login for Google, Microsoft, Apple & More, IP68 Waterproof
  • PHISHING-RESISTANT 2FA: Cryptographically binds to real domains, making phishing attacks impossible unlike SMS codes or authenticator apps.
  • 3-SIDE CAPACITIVE TOUCH: Tap the end, left, or right side to authenticate, so it works in any orientation or crowded USB port.
  • MULTI-COLOR LED INDICATOR: Blue means ready, blinking blue means tap now, green means success, and red means error for instant status feedback.
  • IP68 WATERPROOF & BATTERY-FREE: Crush-resistant one-piece construction survives daily carry on a keychain or in a bag for years without any batteries.
  • UNIVERSAL COMPATIBILITY: Works with Google, Microsoft, Apple, GitHub, AWS, and any FIDO2 / U2F / WebAuthn service, storing up to 100 passkeys.
playwright/.auth

Playwright warns that saved state may contain cookies and headers capable of impersonating the account and says, “We strongly discourage checking them into private or public repositories.” Restrict access to the file and its containing directory, and do not attach it to bug reports or share it as an ordinary test artifact. See Playwright’s Authentication documentation.

2. Authenticate once and write storage state

For example, save this as tests/auth.setup.ts and adapt the form selectors to the target site:

import { test as setup, expect } from '@playwright/test';
import fs from 'node:fs';
import path from 'node:path';

const authFile = path.join('playwright', '.auth', 'user.json');

setup('authenticate', async ({ page }) => {
  const username = process.env.TEST_USERNAME;
  const password = process.env.TEST_PASSWORD;

  if (!username || !password) {
    throw new Error('Set TEST_USERNAME and TEST_PASSWORD before running auth setup.');
  }

  await fs.promises.mkdir(path.dirname(authFile), { recursive: true });
  await page.goto('https://example.com/login');
  await page.getByLabel('Email').fill(username);
  await page.getByLabel('Password').fill(password);
  await page.getByRole('button', { name: 'Sign in' }).click();
  await expect(page).toHaveURL(/account/);
  await page.context().storageState({ path: authFile });
});

The URL, labels, button name, and success check are examples, not universal selectors. Use locators that reflect the actual site and an assertion that proves the expected authenticated destination or state. If the site requires a human-operated second factor, complete the authorized sign-in flow appropriately; this pattern does not bypass MFA or other access controls.

Rank #3
Kensington VeriMark NFC+ USB‑C Security Key, FIDO2/WebAuthn Hardware Authenticator for Passwordless Login, Works with Windows, macOS & Chrome OS, K64739WW
  • USB-C or tap via NFC for easy authentication on any compatible device. No drivers needed; optional Kensington software available for advanced management features.
  • Works across Windows, macOS, iOS, Android, ChromeOS, and supports Passkeys and Apple ID.
  • Slim, keychain-ready form for easy carry and on-the-go authentication
  • IP68-rated for dependable performance
  • FIDO CTAP 2.1 for enhanced security features (e.g. resident credentials, Passkey support) and backwards compatibility with CTAP 2. FIDO2 L2 certified security for phishing resistant protection against identity theft and unauthorized access.

Playwright’s parameterization documentation shows environment variables as one way to pass values from outside a test file. Use your organization’s approved secret-management method for credentials; environment variables alone do not remove every risk, such as exposure through logs, process inspection, or misconfigured CI. See Playwright’s guidance on parameterizing tests.

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

3. Load the saved state in later tests

Configure Playwright Test to run the setup first and use the saved state for the tests that need the authenticated account. In playwright.config.ts, for example:

import { defineConfig } from '@playwright/test';

export default defineConfig({
  testDir: './tests',
  use: {
    baseURL: 'https://example.com',
  },
  projects: [
    { name: 'setup', testMatch: /auth.setup.ts/ },
    {
      name: 'chromium',
      dependencies: ['setup'],
      use: {
        browserName: 'chromium',
        storageState: 'playwright/.auth/user.json',
      },
    },
  ],
});

Run the tests with your project’s usual Playwright command. The setup project must complete successfully before dependent tests can use the state. Keep the state out of version control even if it is generated automatically in CI; use an access-controlled temporary location and remove it when it is no longer needed.

Rank #4
Sale
Thetis Nano-A FIDO2 Security Key Hardware Passkey Device with USB Type A, TOTP/HOTP, FIDO2.0 Two Factor Authentication 2FA MFA, Works with Windows/mac/iOS/Android/Linux/Gmail/Facebook/GitHub/Coinbase
  • Ultra-Compact FIDO2 Security Key - Plug-and-stay or carry on a keychain. This USB-A hardware security key offers portable, always-on protection for desktop and mobile use. (Item Size: 0.75 X 0.74 IN x 0.25 IN)
  • USB-A Hardware Key for All Devices - Works with USB-A ports on PC, Mac, Android, and other laptop/notebook device. Enables secure, cross-platform login with FIDO2.0 passkey support.
  • FIDO Certified Security Key - Meets FIDO and FIDO2 standards. Works with Google, Microsoft, GitHub, Dropbox, and more. Please check service compatibility before purchase.
  • Passwordless Login with Passkey - Supports passkey login via WebAuthn and CTAP2. Enjoy password-free sign-ins where supported. Not all websites or services currently support passkeys.
  • Advanced Multi-Factor Authentication - Offers 200 FIDO2 passkey slots and 50 OATH-TOTP slots. Strong, flexible 2FA/MFA support across various apps and authentication platforms.

Parallel tests and shared accounts

If parallel tests change shared server-side data, a single authenticated account can make tests interfere with one another. Playwright documents a per-worker authentication pattern for cases where tests need separate accounts or state. Use separate accounts or isolated test data when appropriate, rather than assuming that distinct browser contexts isolate changes made on the server.

Know the limits and protect credentials

  • Extension Autofill is interactive. The documented browser workflow requires a user action; it is not equivalent to an unattended automation API.
  • Do not script control of an unlocked extension based on these instructions. The cited documentation establishes extension-driven filling and Playwright’s own saved-state workflow, but not a supported way for Playwright to retrieve a 1Password Login-item secret.
  • Treat storage state as a credential. Cookies and headers in the file may grant account access. Exclude it from source control, limit access, and clean up temporary copies.
  • Plan for expiry and site changes. A saved session may stop working after expiration, logout, a site-side session change, or a change to authentication requirements. Refresh it through the authorized setup flow and re-check the test’s success assertion.
  • Be cautious with AI-assisted browsing. In a January 30, 2026 advisory, 1Password describes risks when an assistant has browser-level user permissions and can trigger extension behavior. Treat untrusted page content as untrusted input; do not give an agent access to account credentials without deliberate authorization. 1Password also describes disabling automatic sign-in for its web app. See its AI-assisted browsing security advisory.

1Password announced a universal sign-in prompt intended to choose among authentication methods and fill credentials across multiple steps. That announcement does not establish availability on every account, platform, or website, so verify whether it is available to you before relying on it: Introducing universal sign-in.

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

Troubleshoot common failures

  • The expected 1Password prompt is missing: Confirm the extension is installed, unlocked, and signed in; check that the Login item has the correct site URL; then open the extension and choose the matching item manually.
  • The wrong Login item appears: Check the saved website address and compare it with the domain in the browser. Do not choose a credential merely because a page or overlay asks you to.
  • The extension fills but does not complete sign-in: The form may require another step or have behavior the extension cannot submit as expected. Review the page and settings, then complete the sign-in deliberately; disable automatic form submission if you prefer manual control.
  • Playwright cannot find the form controls: The example labels and button name are site-specific. Inspect the actual accessible names and update the locators; avoid treating example selectors as universal.
  • Playwright reports missing credentials: Set TEST_USERNAME and TEST_PASSWORD in the environment used to launch the setup test, or use the team’s approved secret manager.
  • Later tests appear signed out: Confirm the setup ran and wrote the state file, that dependent projects point to the same path, and that the saved session remains valid. Re-run the authorized setup if the session expired.
  • Tests fail intermittently when run together: Check for shared-account or shared-data conflicts. Use per-worker accounts/state or isolate test data if parallel tests mutate the same server-side records.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Capture a page after testing

If the goal is to inspect a page visually after an authorized test, a screenshot capture is separate from the sign-in workflow: neither Playwright’s saved authentication state nor the 1Password extension is a screenshot API. ScreenshotNeo is a website screenshot API and MCP server; its clean-shot workflow accepts cookie banners and removes known consent platforms, newsletter popups, and chat widgets before capture, with each step configurable. Only clean shots are billed: bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status.

Or skip the browser setup

For a public page that does not require your authenticated browser session, one GET request can return a screenshot. Do not put account passwords or private session cookies into this example.

Best Value
FIDO2 U2F Security Key Passkey Two-Factor Authentication (2FA) USB Key PIN+Touch (Non-Biometric) USB-A Type TrustKey T110
  • Security Key : Protect your online accounts against unauthorized access by using FIDO2 and U2F authentication with T110. It's the world's most protective security key that works with windows, Mac OS, Linux as well as Chrome, Firefox, Edge and many other major browsers.
  • Certified with the new FIDO2 standard, T110 provides the benefit of fast login and strong protection against phishing, account takeover as well as many other online attactks.
  • Works with : Bank of America, Github, Google, Microsoft, DUO, Twitter, Facebook, Dropbox, Apple, ebay, BINANCE, mor and more.
  • Fits USB-A port : Insert the T110 security key into the USB-A port of each service and log in conveniently with one touch
  • For the driver download and user guide, please visit TrustKey Solutions Home support page.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

See the ScreenshotNeo API documentation for request options. Cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed. Its MCP server provides screenshot tools for AI agents, and the free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots. Sign up for 1,000 free screenshots a month with no card.

Frequently Asked Questions

Can Playwright use 1Password directly to retrieve a saved password?

The documented workflows establish extension-driven filling and Playwright’s own authentication-state reuse, not a supported direct credential-retrieval integration between them.

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

Does Playwright storage state preserve every part of a login?

It saves browser storage state such as cookies and local storage; whether that is enough depends on how the site implements authentication.

Can I use saved Playwright state on a site that requires a passkey or CAPTCHA?

Not necessarily. Those controls and site policies may require additional authorized steps; saved state is not a way to bypass them.

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
PC Slower Than It Used to Be?Free scan - under a minute
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.