Class PlaywrightStorageStateManager
java.lang.Object
com.shaft.gui.browser.internal.PlaywrightStorageStateManager
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 TypeMethodDescriptionstatic voidload(com.microsoft.playwright.BrowserContext context, com.microsoft.playwright.Page page, String filePath) Loads cookies, localStorage, and sessionStorage from a JSON file.static voidsave(com.microsoft.playwright.BrowserContext context, com.microsoft.playwright.Page page, String filePath) Saves cookies, localStorage, and sessionStorage to a JSON file.
-
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 contextpage- active Playwright pagefilePath- 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 contextpage- active Playwright pagefilePath- source JSON file
-