How to test Extensions in JUnit with Selenium?

How to test Extensions in JUnit with Selenium?

Hi Ian!

To test your Extensions while performing JUnit testing, you need to add below code snippet in your test script.

// Chrome options to add extension file (Works with file size upto 10MB)
        ChromeOptions options = new ChromeOptions ();
        options.addExtensions (new File("./LambdatestScreenshotExtension.crx"));
        caps.setCapability(ChromeOptions.CAPABILITY, options);

You can also check out the below GitHub Repo