0

I tried to automate one function and I used command in selenium: driver.manage .delete All Cookies but when I run script Cookies is appear on the page. Also I tried almost all commands of manage cookies and watched lots of videos to solve the prob.

@Before
public void setup(){

    driver.get(base);
    driver.manage().window().maximize();
    driver.manage().delete All Cookies();  
Ivvan
  • 720
  • 11
  • 25
Yatin
  • 1
  • Maybe this could be a race condition - the driver.get(base) seems the command to the browser, and returns immediately it has done so (leaving the browser to go on and actually get the page). This means those the command all execute in a fraction of a second, and sometime later the browser receives the page (and its cookies) from the site. Try putting a wait after the call to get(base) (see https://stackoverflow.com/questions/5868439/wait-for-page-load-in-selenium) – racraman Feb 23 '20 at 14:12
  • thanks and I tried but did not work. – Yatin Feb 24 '20 at 16:07

0 Answers0