Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Chromium always launching in Incognito mode #2071

Closed
MaxTester1 opened this issue May 1, 2020 · 13 comments
Closed

[Question] Chromium always launching in Incognito mode #2071

MaxTester1 opened this issue May 1, 2020 · 13 comments

Comments

@MaxTester1
Copy link

MaxTester1 commented May 1, 2020

Hi

Chromium always launching in Incognito mode which causing my app authentication fail, how do i change this behavior to launch chrome in normal mode

Below sample script

const playwright = require('playwright');

(async () => {
  for (const browserType of ['Chromium']) {
    const browser = await playwright[browserType].launch({headless: false});
    // const context = await browser.newContext();
    const page = await browser.newPage();
    await page.goto('http://www.google.com'); -**-I get error for my application**
    await page.screenshot({ path: `example-${browserType}.png` });
    await browser.close();
  }
})();

Error:

**Error Code: 500
Http failure response for https://xxx-oauth-qas.xxx.com/as/tokenKerb: 500 ERROR**

same application works fine with puppeteer as it launches in normal mode

@arjunattam
Copy link
Contributor

Thanks, @MaxTester1. Can you elaborate more on what exactly is breaking with incognito mode? Could this be related to #2072?

@pavelfeldman
Copy link
Member

The script you provide uses webkit and does not quote example. I fixed it and ran it against Chromium and WebKit and it worked.

Did you expect that you will be logged into your Google account? If you are not doing testing, you can use browserType.launchPersistent and point to your user profile directory.

@MaxTester1
Copy link
Author

MaxTester1 commented May 3, 2020

Thanks, @MaxTester1. Can you elaborate more on what exactly is breaking with incognito mode? Could this be related to #2072?

Hi @arjun27 ,Thank you for the response, i tried #2072 but dint help. i have updated details in original post, please check

@MaxTester1
Copy link
Author

MaxTester1 commented May 3, 2020

The script you provide uses webkit and does not quote example. I fixed it and ran it against Chromium and WebKit and it worked.

Did you expect that you will be logged into your Google account? If you are not doing testing, you can use browserType.launchPersistent and point to your user profile directory.

Hi @pavelfeldman Thanks fro response, i tried const browser = await playwright[browserType].launchPersistentContext(userDataDir,{headless:false}) and it worked. Browser launched in normal mode.

Is there any way like puppeteer launch chromium normal mode without persistent context?

@aslushnikov
Copy link
Collaborator

Is there any way like puppeteer launch chromium normal mode without persistent context?

@MaxTester1 Playwright's persistent context is equal to Puppeteer's chromium launch. This is not the default mode in Playwright though since Playwright focuses on better automation isolation and browser instance re-use (thus the whole concept of contexts).

@MaxTester1
Copy link
Author

Is there any way like puppeteer launch chromium normal mode without persistent context?

@MaxTester1 Playwright's persistent context is equal to Puppeteer's chromium launch. This is not the default mode in Playwright though since Playwright focuses on better automation isolation and browser instance re-use (thus the whole concept of contexts).

Thank you @aslushnikov for the update.

@OlgaKuksa
Copy link

OlgaKuksa commented Jul 10, 2020

Is there any way like puppeteer launch chromium normal mode without persistent context?

@MaxTester1 Playwright's persistent context is equal to Puppeteer's chromium launch. This is not the default mode in Playwright though since Playwright focuses on better automation isolation and browser instance re-use (thus the whole concept of contexts).

@aslushnikov Agreed with isolation etc. But it's a bit inconvenient if one needs to take screenshots for screenshot testing. AFAIU incognito in mobiles doesn't allow screenshots. Or is there a way to do it with Playwright-Chromium-incognito in mobiles I don't know about?

@sublimator
Copy link

When testing extensions incognito mode can get in the way also

@muhqu
Copy link
Contributor

muhqu commented Mar 31, 2021

This is also an issue when testing sites that make use of Origin-Trial features which are not available in incognito mode… There should be an option in LaunchOptions that allows to easily switch to normal mode.

@sublimator
Copy link

sublimator commented Apr 1, 2021

There should be an option in LaunchOptions that allows to easily switch to normal mode.

Would be good right

The team have made some pretty opinionated choices and dropped support for extensions. It's a bit disappointing.

@smartahsan
Copy link

There should be an option in LaunchOptions that allows to easily switch to normal mode.

Would be good right

The team have made some pretty opinionated choices and dropped support for extensions. It's a bit disappointing.

It really is surprising I thought there would be a way to launch in a normal browser.

@valentijnpeters
Copy link

valentijnpeters commented Dec 3, 2021

The below sample script mentioned is a .js file

@ssasane-tibco
Copy link

Any simplest way to launch it in non-incognito mode? by just making some changes in the config file or test runner file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants