How to make selenium webdriver open in google chrome without Incognito
Question: I'm using selenium for the past 1 month. I want to create some small
applications using selenium. Selenium webdriver opens an incognito window when
I run it. Is there any way to make it launch in normal window(i.e which has my
accounts logged in)?

This is the code which I'm using : (python code in linux)

    
    
    chromedriver = Path to chrome driver
    os.environ["webdriver.chrome.driver"] = chromedriver
    driver = webdriver.Chrome(chromedriver)
    driver.get("http://www.gmail.com")
    


Answer: If you want to re-use your login/authentication cookies, you can save the
cookies and then load it again.

You can refer to [this post](http://stackoverflow.com/questions/15058462/how-
to-save-and-load-cookies-using-python-selenium-webdriver/15058521#15058521):

To save cookies:

    
    
    import pickle
    import selenium.webdriver 
    
    driver = selenium.webdriver.Firefox()
    driver.get("http://www.google.com")
    pickle.dump( driver.get_cookies() , open("cookies.pkl","wb"))
    

To add back the cookies:

    
    
    import pickle
    import selenium.webdriver 
    
    driver = selenium.webdriver.Firefox()
    driver.get("http://www.google.com")
    cookies = pickle.load(open("cookies.pkl", "rb"))
    for cookie in cookies:
        driver.add_cookie(cookie)
    

If you want to load an extension when Chrome starts, you can refer to [this
post](http://stackoverflow.com/questions/10425799/selenium-chromedriver-
causes-chrome-to-start-without-configured-plugins-bookmar/10434536#10434536)
and [this
post](https://sites.google.com/a/chromium.org/chromedriver/extensions).

