Disable chrome "Add extension" prompt

1k Views Asked by At

I am automating the testing process of installing a plugin in selenium right now. I am well aware you can include chrome plugins in the chromeOptions but what I want to test here is the process of manually installing the extension and how my web app reacts to it.

After clicking the "Add to Chrome" button in the web store, a prompt appears and you have to click "Add extension". I already know it is not possible to confirm this prompt using selenium, so my idea is to allow installing extensions without any prompts. According to this I can use the --prompt-for-external-extensions flag to disable those prompts.

All my attempts to add this flag to the ChromeOptions so far have failed and the prompt still appears. I am also unsure whether the precondition The constant CHROMIUM_BUILD must be defined. is fulfilled.

My attempts:

ChromeOptions options = new ChromeOptions();
options.addArguments("--prompt-for-external-extensions");
//or this
options.setExperimentalOption("excludeSwitches", Arrays.asList("prompt-for-external-extensions"));

How can I succesfully disable this prompt in chrome?

0

There are 0 best solutions below