I’m trying to run a very basic script in playwright-java, just a simple browser launch and visiting a site. Since it is the very first run of any playwright script on my computer, it is first trying to download the browsers and while doing so I’m getting an error that reads “UNABLE_TO_GET_ISSUER_CERT_LOCALLY”, have pasted below the entire error message.
I tried running the same script on another computer and it worked perfectly fine. The machine on which I’m trying to run has Zscaler installed, and after searching the internet for the solution I found out the Zscaler indeed is causing issue here.
However unable to find any solution till now, how do I install the playwright browsers? I would appreciate your help on this issue. Thanks!
Following is the error stack trace
Downloading Chromium 127.0.6533.17 (playwright build v1124) from https://playwright.azureedge.net/builds/chromium/1124/chromium-win64.zip
Error: unable to get local issuer certificate
at TLSSocket.onConnectSecure (node:_tls_wrap:1674:34)
at TLSSocket.emit (node:events:519:28)
at TLSSocket._finishInit (node:_tls_wrap:1085:8)
at ssl.onhandshakedone (node:_tls_wrap:871:12) {
code: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY'
}
Downloading Chromium 127.0.6533.17 (playwright build v1124) from https://playwright-akamai.azureedge.net/builds/chromium/1124/chromium-win64.zip
Error: unable to get local issuer certificate
at TLSSocket.onConnectSecure (node:_tls_wrap:1674:34)
at TLSSocket.emit (node:events:519:28)
at TLSSocket._finishInit (node:_tls_wrap:1085:8)
at ssl.onhandshakedone (node:_tls_wrap:871:12) {
code: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY'
}
Downloading Chromium 127.0.6533.17 (playwright build v1124) from https://playwright-verizon.azureedge.net/builds/chromium/1124/chromium-win64.zip
Error: unable to get local issuer certificate
at TLSSocket.onConnectSecure (node:_tls_wrap:1674:34)
at TLSSocket.emit (node:events:519:28)
at TLSSocket._finishInit (node:_tls_wrap:1085:8)
at ssl.onhandshakedone (node:_tls_wrap:871:12) {
code: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY'
}
Failed to install browsers
Error: Failed to download Chromium 127.0.6533.17 (playwright build v1124), caused by
Error: Download failure, code=1
at ChildProcess.<anonymous> (C:UserssoswalAppDataLocalTempplaywright-java-5996061535613534854packagelibserverregistrybrowserFetcher.js:91:16)
at ChildProcess.emit (node:events:519:28)
at ChildProcess._handle.onexit (node:internal/child_process:294:12)
Exception in thread "main" java.lang.RuntimeException: Failed to create driver
at com.microsoft.playwright.impl.driver.Driver.createAndInstall(Driver.java:105)
at com.microsoft.playwright.impl.driver.Driver.ensureDriverInstalled(Driver.java:57)
at com.microsoft.playwright.impl.PlaywrightImpl.createImpl(PlaywrightImpl.java:46)
at com.microsoft.playwright.impl.PlaywrightImpl.create(PlaywrightImpl.java:36)
at com.microsoft.playwright.Playwright.create(Playwright.java:110)
at com.microsoft.playwright.Playwright.create(Playwright.java:114)
at common.InitiatePlaywright.<init>(InitiatePlaywright.java:19)
at testing.Test.main(Test.java:8)
Caused by: java.lang.RuntimeException: Failed to install browsers, exit code: 1
at com.microsoft.playwright.impl.driver.jar.DriverJar.installBrowsers(DriverJar.java:99)
at com.microsoft.playwright.impl.driver.jar.DriverJar.initialize(DriverJar.java:68)
at com.microsoft.playwright.impl.driver.Driver.initialize(Driver.java:64)
at com.microsoft.playwright.impl.driver.Driver.createAndInstall(Driver.java:101)
... 7 more
Process finished with exit code 1
I tried searching internet for solutions, till now only found out that ZScaler is causing issue