Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable cookies in Chromedriver with Webdriver?

I am trying to use Selenium's Chromedriver to log in to a website which has cookies enabled. I got a message from the server that the browser has cookies disabled. How can I enable cookies in Chromedriver?

enter image description here

like image 682
tintin Avatar asked Oct 06 '13 16:10

tintin


1 Answers

ChromeDriver has cookie be enabled by default.

Please try the following steps:

  1. Use FirefoxDriver/IEDriver, see what the site says.

  2. Manually open a Chrome browser, see what the site says.

  3. Try open whatismybrowser.com with ChromeDriver opened browser, see what it tells you.

If your site says cookie not enabled for FirefoxDriver/IEDriver/Manually opened Chrome, and whatismybrowser.com says your ChromeDriver opened browser has cookie enabled, then clearly something is wrong with your site, please try debug your site.

like image 110
Yi Zeng Avatar answered Oct 27 '22 13:10

Yi Zeng