org.openqa.selenium.InvalidCookieDomainException: Document is cookie-averse using Selenium and WebDriver

Thank you DebanjanB!
I’ve tried to push cookies just after driver start and before open URL tab.

Working solution:

driver.get('http://mydomain')
driver.manage.addCookie(....)
driver.get('http://mydomain')

Just open a tab, add cookie and reopen a tab again

Leave a Comment