There are 2 issues here 1.Unable to clear cache and 2. the restore pop up comes up always when edge browser is launched. Is there any edgeoption /capability available for this?
EdgeOptions Used:
EdgeOptions options = new EdgeOptions();
capabilities.setCapability("applicationCacheEnabled", false);
options.merge(capabilities);
options.addArguments("--no-default-browser-check");
options.addArguments("--disable-extensions");
options.addArguments("test-type");
options.addArguments("--remote-debugging-port=9222");
options.setExperimentalOption("prefs", preferences);
options.addArguments("--disable-session-crashed-bubble");
options.addArguments("--disable-application-cache");
options.addArguments("--disable-gpu");
options.addArguments("--disable-dev-shm-usage");
options.addArguments("--no-sandbox");
options.addArguments("--ignore-certificate-errors");
Currently using taskkill to close any existing browsers before opening the new edge browser for automation
rt.exec("taskkill /im msedge.exe /f /t");
And for clearing the cache -> launching the clearBrowserData using the below
edge://settings/clearBrowserData
and clearing the cache