0

I'm trying to build my automation framework using playwright with java, however I'm running into below issue when running the tests. Please advice!

Failed to install browsers
Error: Failed to download chromium v1000, caused by
Error: unable to get local issuer certificate
    at TLSSocket.onConnectSecure (node:_tls_wrap:1530:34)
    at TLSSocket.emit (node:events:390:28)
    at TLSSocket._finishInit (node:_tls_wrap:944:8)
    at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:725:12)
Exception in thread "main" java.lang.RuntimeException: Failed to create driver
    at com.microsoft.playwright.impl.Driver.ensureDriverInstalled(Driver.java:61)
    at com.microsoft.playwright.impl.PlaywrightImpl.create(PlaywrightImpl.java:40)
    at com.microsoft.playwright.Playwright.create(Playwright.java:96)
    at com.microsoft.playwright.Playwright.create(Playwright.java:100)
    at Example.main(Example.java:5)
Caused by: java.lang.RuntimeException: Failed to install browsers, exit code: 1
    at com.microsoft.playwright.impl.DriverJar.installBrowsers(DriverJar.java:76)
    at com.microsoft.playwright.impl.DriverJar.initialize(DriverJar.java:48)
    at com.microsoft.playwright.impl.Driver.ensureDriverInstalled(Driver.java:57)
    ... 4 more
Christian Baumann
  • 3,188
  • 3
  • 20
  • 37
Dinesh
  • 31
  • 4

2 Answers2

0

I could solve it by disabling the download (as it was already installed with npx playwright install) by setting the env

PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1

IntelliJ IDE Run Configuration

enter image description here

jfk
  • 4,335
  • 34
  • 27
-1

It's not a Playwright or Maven problem. You can fix it yourself. If you want just to avoid the problem, not fixing it, you can follow this recommendation: https://community.claris.com/en/s/question/0D53w00005GuQXxCAN/nodejs-fmsapiclient-unable-to-verify-the-first-certificate-local-server namely by setting the system variable to zero

  • Despite the negative score, the answer itself is right. I had the same issue with gradle (it doesn't matter as not maven or gradle, but Playwright binary throws this error) and fixed it in a minute – Alexander Petrovskiy May 26 '22 at 05:05