Following is my code :
case BrowserType.PhantomJS:
var service = PhantomJSDriverService.CreateDefaultService(Path.Combine(_rootPath, @"Packages\"));
var cookieFilePath=Path.Combine(_rootPath, @"Packages\cookie.txt");
if (!File.Exists(cookieFilePath))
File.Create(cookieFilePath);
var phantomjsoptions = new PhantomJSOptions();
driver = new PhantomJSDriver(service,phantomjsoptions);
var cookieJar = driver.Manage().Cookies;
driver.Navigate().GoToUrl(SeleniumConfiguration.Current.BaseURL);
cookieJar.AddCookie(new Cookie("x", "12345"));
return driver;
Basically, the issue is that I am not able to login into my test application because i get an error saying -
"Your browser is set to block cookies"
I've tried everything but I just can't seem to get the solution for this.
what should I do?
Please help me out here.
Let me know if there is some detail missing.