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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -