← Back to Discord Forum

Saved storageState does not contain bearer token


I am currently saving storage state using await page.context().storageState({ path: authFile }); and that save file contains enough information to reuse for UI tests.

In the browser when logged in, If I open the devtools > application > local storage, I can see a bearer token which I would like to use to perform some API Calls before my tests run. However, that bearer token is not in my save storage state file.

Should it be or what I am not doing right?

This thread is trying to answer question "Why is the bearer token not appearing in the saved storage state file?"

4 replies

I can actually see the bearer token in the localStorage.origins but don't know why it isn't being saved in my authfile....

I lied, it is there. I was going blind 🙂

Hey @.gleedo can you share the format of your authFile?

I have local state which I'm tring to build and don't have the format

Related Discord Threads

AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.