Skip to main content
bash TV

Playwright Storage State Explained | Login Once & Reuse Authentication | Playwright + TypeScript

Script and Execute

23 views6 Dec 2026

YouTube

In this video, we will learn about **Storage State in Playwright with TypeScript** and how to reuse authentication across multiple test cases without performing login repeatedly. When we automate an application, we often need to log in before executing our test cases. But performing the same login steps in every test is unnecessary. Playwright provides a feature called Storage State that allows us to save authentication-related browser information and reuse it across multiple tests. In this practical demonstration, we will use the OrangeHRM application to understand how Storage State works. Topics covered in this video: - What is Playwright Storage State? - Why do we need Storage State? - Creating an authentication folder. - Logging in to OrangeHRM. - Saving browser storage state into a JSON file. - Understanding `page.context()` and `storageState()`. - How to reuse saved authentication using `test.use()`. - Understanding the `storageState` configuration option. - Reusing authentication in Dashboard and PIM test cases. - How to avoid performing login repeatedly across multiple tests. - Why authentication files should be added to `.gitignore`. Practical demonstration:** 1. Login to OrangeHRM and save the authentication state in `admin.json`. 2. Reuse the saved authentication state in the Dashboard test. 3. Reuse the same authentication state in the PIM test. 4. Access application pages without entering the username and password again. By the end of this tutorial, you will understand how to save and reuse authentication state in Playwright using TypeScript. This tutorial is useful for beginners, manual testers, and automation testers who want to learn practical Playwright concepts. Subscribe to **Script and Execute** for more Playwright, TypeScript, GitHub, CI/CD, automation testing, and practical interview preparation tutorials. Happy Learning! #Playwright #TypeScript #StorageState #AutomationTesting #PlaywrightTutorial

Join the discussion

Have something to add?

Sign in to reply, follow this thread, and earn XP when your answer helps someone.