Rayrun
← Back to Discord Forum

not able to use storagestate in POM design pattern

chandan0523posted in #help-playwright
Open in Discord

I am able to generate Authjson file in the setup but while navigating to the url using POM structure launching another instance of the browse thus not the using the storage state . Can somebody help me to understand how to use storage state in POM structure and custom fixture , thanks

This thread is trying to answer question "How can I use storage state in a POM structure with custom fixtures in Playwright?"

12 replies

Would you be able to share your code?

It would be easier for me or other to help

Thanks for the response , here r my config, test, PO setup file

Plz ignore line 10 in testfile , i was just trying here n der

In playwright.config.ts line 43 just use storageState: '.LoginAuth.json'

Ideally, try creating a file without dot as first character, it's a bit confusing

If i use like this its not able to find the location , i have remove dot as first character but still the same issue , its not hsing storageState

then the path is wrong, but dot is not necessary

**/*.LoginAuth.json

But still another issue , i can see the title is correct but page is login , seeing an instance launched but overtaken by another instance which is taking me to login screen 🤦🏻‍♂️

Have you ever seen an issue when there is more than 1 describe block in a test and the describe blocks after the first is not using the storagestate?

TwitterGitHubLinkedIn
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.