Rayrun
← Back to Discord Forum

Seeing different behaviour with chrome incognito and Playwright Chromium automation

golden_peacock_91854posted in #help-playwright
Open in Discord
golden_peacock_91854
golden_peacock_91854

Hello all, <#1054804523652231198> I'm pretty beginner to Playwright and used codegen to record the UI flow.

Here is the problem statement: my web application is SSO enabled and when we try to login via chrome normal mode it'll take the system credentials and login directly but if we use Chrome incognito, we need to enter the username and password and then user logs in. But with playwright, I can see that when we try to access the link, it is directing to the logged session directly and it's not even asking for the credentials. I've used clear cookies and user agent but it's still the same. <#1054804523652231198> Can anyone guide me please.

This thread is trying to answer question "Why is Playwright Chromium automation logging in directly without asking for credentials despite using incognito mode and clearing cookies?"

9 replies

Do you set incognito directly in playwright?

golden_peacock_91854
golden_peacock_91854

Yes

golden_peacock_91854
golden_peacock_91854

But usually playwright opens chromium in incognito only right?

No i think it opens it in normal mode

christoph_hb
christoph_hb

Hey, I am facing the same problem like @golden_peacock_91854. Has anyone an solution to this problem - maybe even with some code snippets? Many, many thanks in advance!

Do you use persistent context? If not, then it sounds more like an issue or different behavior within your web application to be honest.

Without persistent context Playwright launches incognito-like sessions

christoph_hb
christoph_hb

Dear @skorp32, thank you for your question. No, I am not using the persistent context in my tests. I I use the opened playwright incognito Chrome Browser exact the same way like the incognito one on my machine - but the behavior at the login to my SUT differs in the way @golden_peacock_91854 described in his original post.

mohammed.zahid
mohammed.zahid

adding the below in playwright config solves the problem [...] ** use: { [...] launchOptions: { args: ["--auth-server-allowlist="_""], }, }, [...] **

Related Discord Threads

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 [email protected].