selenium - how to disable cookies using webdriver for Chrome and FireFox JAVA -


i want launch browsers(ff, chrome) test disabled cookies, tried this:

           service =                     new chromedriverservice.builder()                             .usingdriverexecutable(new file("src/test/resources/chromedriver"))                             .usinganyfreeport().build();             try {                 service.start();             } catch (ioexception e1) {                 e1.printstacktrace();             }              desiredcapabilities capabilities = desiredcapabilities.chrome();             capabilities.setcapability("disable-restore-session-state", true);             driver = new chromedriver(service, capabilities); 

but it's not work...

i've solution firefox:

firefoxprofile profile = new profilesini().getprofile("default"); profile.setpreference("network.cookie.cookiebehavior", 2); driver = new firefoxdriver(profile); 

but don't know how manage chrome.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -