keep “Disable developer mode” closed while adding

2019-07-25 15:49发布

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

enter image description here

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?

0条回答
登录 后发表回答