I'm trying to set some cookies that I already have, to handle a request to a site using ChromeWebDriver and Selenium in Java:
System.setProperty("webdriver.chrome.driver", "/Users/test/Desktop/Configs/chromedriver");
WebDriver driver = new ChromeDriver();
driver.manage().addCookie(new Cookie("mycookie","test"));
driver.get("https://www.google.com/");
But I got the following exception: Exception in thread "main" org.openqa.selenium.UnableToSetCookieException: unable to set cookie. Of course, I'm trying with real cookies and they work as well in the browser...