keep “Disable developer mode” closed while adding extension

孤人 提交于 2019-12-11 07:33:07

问题


I am using Java and Selenium to write a test. In order to prevent the download bar in Chrome I use:

options.addExtensions(new File("Upload\\Disable-Download-Bar_v1.5.crx"));
capabilities.setCapability(ChromeOptions.CAPABILITY, options);

which works fine. The only issue is that at the start of the test it opens a popup window

I used

options.addArguments("chrome.switches","--disable-extensions");

to keep it closed but of course it prevented the extension and I had the download bar back. So how can I add the extension but keep this popup window closed?

来源:https://stackoverflow.com/questions/41638934/keep-disable-developer-mode-closed-while-adding-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!