0

I tried like this

ChromeOptions options = new ChromeOptions();
options.addExtensions(new File("/path/to/extension.crx"));
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
ChromeDriver driver = new ChromeDriver(capabilities);

but in new versions of Chrome CRX is not accepted and you need to set CRX3

Caused by: org.openqa.selenium.SessionNotCreatedException: session not created: cannot process extension #1
from unknown error: CRX verification failed to parse extension header. Chrome supports only CRX3 format. Does the extension need to be updated?

Does anyone know how to solve this problem?

Norayr Sargsyan
  • 1,737
  • 1
  • 12
  • 26

1 Answers1

0

With chrome version 75 and above, CRX3 extension packing is enforced. You need to repackage your .crx extension to .crx3. Refer this SO answer on repackaging

Magesh
  • 308
  • 1
  • 4
  • 18