3

I got the below code to open Chrome browser using Selenium with extension enabled. To enable multiple chrome extensions, do I need to repeat the steps or is there any simpler way?

String pathToExtension = "C:\\Users\\home\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Extensions\\mbopgmdnpcbohhpnfglgohlbhfongabi\2円.3.1_0";
ChromeOptions options = new ChromeOptions();
options.addArguments("–-load-extension=" + pathToExtension);
driver = new ChromeDriver(options);
Niels van Reijmersdal
32.7k4 gold badges59 silver badges125 bronze badges
asked Jun 10, 2020 at 16:52

1 Answer 1

1

Separate the path with a comma for the next one:

--load-extension=path/to/extension,path/to/another/extension

Solution from: https://stackoverflow.com/questions/20782557/load-unpacked-chrome-extension-programmatically

answered Jun 10, 2020 at 17:22

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.