0 votes
1 view
in Devops and Agile by (19.8k points)

I can not seem to find any documentation on how to make Selenium open the browser in incognito mode.

Do I have to set up a custom profile in the browser or?

1 Answer

0 votes
by (63.4k points)

There is a really simple way to make a window open in incognito mode:

from selenium.webdriver.chrome.options import Options

chrome_options = Options()

# incognito window

chrome_options.add_argument("--incognito")

You can also use this library for maximizing the window and more, see the documentation: https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/Chrome/Options.html

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...