Class PlaywrightStorageStateManager

java.lang.Object
com.shaft.gui.browser.internal.PlaywrightStorageStateManager

public final class PlaywrightStorageStateManager extends Object
Saves and restores browser cookies, localStorage, and sessionStorage for one Playwright context.

Reads and writes the exact JSON schema produced by BrowserStorageStateManager, so storage-state files are interchangeable between the WebDriver and Playwright backends.

  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    load(com.microsoft.playwright.BrowserContext context, com.microsoft.playwright.Page page, String filePath)
    Loads cookies, localStorage, and sessionStorage from a JSON file.
    static void
    save(com.microsoft.playwright.BrowserContext context, com.microsoft.playwright.Page page, String filePath)
    Saves cookies, localStorage, and sessionStorage to a JSON file.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • save

      public static void save(com.microsoft.playwright.BrowserContext context, com.microsoft.playwright.Page page, String filePath)
      Saves cookies, localStorage, and sessionStorage to a JSON file.
      Parameters:
      context - active Playwright browser context
      page - active Playwright page
      filePath - target JSON file
    • load

      public static void load(com.microsoft.playwright.BrowserContext context, com.microsoft.playwright.Page page, String filePath)
      Loads cookies, localStorage, and sessionStorage from a JSON file.
      Parameters:
      context - active Playwright browser context
      page - active Playwright page
      filePath - source JSON file