我有一个在Chrome上完美运行的自动化测试套件。现在我想在其他浏览器EDGE,FF上扩展我的测试运行。
问题: 当我尝试启动EDGE浏览器时,我会收到“同步你的个人资料”的对话。我尝试了不同的边缘选项,但无法处理/关闭此选项。文章源自玩技e族-https://www.playezu.com/189760.html
图片:文章源自玩技e族-https://www.playezu.com/189760.html
显示带有文本的对话:文章源自玩技e族-https://www.playezu.com/189760.html
*同步您的个人资料XXXXXXX@ABC-software.com已在此设备上登录,因此我们也已将您登录到Microsoft Edge。文章源自玩技e族-https://www.playezu.com/189760.html
此帐户无法使用同步。文章源自玩技e族-https://www.playezu.com/189760.html
要注销,请转到“设置”>;配置文件。文章源自玩技e族-https://www.playezu.com/189760.html
Microsoft隐私声明*文章源自玩技e族-https://www.playezu.com/189760.html
边缘版本:文章源自玩技e族-https://www.playezu.com/189760.html
边缘浏览器版本:103.0.1264.62
MS边缘驱动器:103.0.1264.49文章源自玩技e族-https://www.playezu.com/189760.html
我在浏览器启动期间尝试了以下选项。文章源自玩技e族-https://www.playezu.com/189760.html
EdgeOptions edgeOptions = new EdgeOptions();
Map<String, Object> edgePrefs = new HashMap<String, Object>();
edgePrefs.put("credentials_enable_service", false);
edgePrefs.put("profile.password_manager_enabled", false);
edgeOptions.setExperimentalOption("prefs", edgePrefs);
edgeOptions.setExperimentalOption("excludeSwitches", Collections.singletonList("enable-automation"));
edgeOptions.setExperimentalOption("useAutomationExtension", false);
edgeOptions.addArguments("disable-gpu");
edgeOptions.addArguments("start-maximized");
edgePrefs.put("profile.default_content_settings.popups", 0);
edgePrefs.put("profile.default_content_setting_values.notifications", 2);
edgePrefs.put("profile.default_content_setting_values.automatic_downloads" , 1);
edgePrefs.put("profile.content_settings.pattern_pairs.*,*.multiple-automatic-downloads",1);
edgeOptions.setUnhandledPromptBehaviour(UnexpectedAlertBehaviour.IGNORE);
// Here you set the path of the profile ending with User Data not the profile folder
edgeOptions.addArguments("user-data-dir="+System.getProperty("user.home")+"\AppData\Local\Microsoft\Edge\User Data");
// Here you specify the actual profile folder
edgeOptions.addArguments("profile-directory=Profile 1");
driver = new EdgeDriver(edgeOptions);
driver.get("edge://settings/clearBrowserData");
driver.findElement(By.id("clear-now")).sendKeys(Keys.ENTER);
显示器测试软件
评论