How to turn on chrome extension in the test case

Hi,
I’ve successfully added a chrome extension and I can see it when running the tests, however, I need to turn it on for the extension actually to work, and I couldn’t find any solution.

I want to add Google Analytics Debugger and turn it on:

Code to add extension

System.setProperty("webdriver.chrome.driver", "D:/Katalon/BB8 Automated tests/BB8 Automated tests/Test Files/chromedriver.exe")

ChromeOptions options = new ChromeOptions()

options.addExtensions(new File("D:/Katalon/BB8 Automated tests/BB8 Automated tests/Test Files/extension_2_8_0_0.crx"))

DesiredCapabilities capabilities = new DesiredCapabilities()

capabilities.setCapability(ChromeOptions.CAPABILITY, options)

WebDriver driver = new ChromeDriver(capabilities)

DriverFactory.changeWebDriver(driver)

WebUI.navigateToUrl("google.com")

The default view when the fresh browser is opened, extension in only installed but not turned on:
image

Extension turned on after I manually click on it:
image

Hi,

Can you try to follow this: KatalonStudio | How to open browser with extensions loaded - YouTube ?

Tried this, extensions is there but still it is not enabled, I need to know how I can control it,switch it on and of once it is loaded into the browser

The ability to automatically turn on an extension has been disabled since chrome 25. If the extension does not have the option in config to turn on on browser load or specific url/pattern then you are out of luck. Ask them to add option to the extennsion to do this.

Thanks for the info, any tips on how to approach testing stuff like this?