0

I have a script that currently has a user logged in to a website on a regular chrome window but I also want to open an incognito chrome window to have another user log in to the same website. The website has SSO so opening another regular chrome tab will just log in the first user again and both users need to be signed in at the same time. Is there a way to launch an incognito chrome window from the regular chrome window with selenium?

mikewaz
  • 1
  • 1
  • Create a new instance of selenium and open a tab in that. – sorifiend Aug 16 '22 at 04:43
  • Does this answer your question? [Run chrome browser in inconginto Mode in Selenium](https://stackoverflow.com/questions/19026295/run-chrome-browser-in-inconginto-mode-in-selenium) – pburgr Aug 16 '22 at 06:03

1 Answers1

0

start you driver like below

WebDriver chromedriver;
ChromeOptions options = new ChromeOptions();
options.addArguments("--incognito");
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
WebDriver chromedriver=new ChromeDriver(capabilities);
Abhay Chaudhary
  • 1,763
  • 1
  • 8
  • 13