无法将剧作家安装为Maven依赖

发布于 2025-01-22 17:08:45 字数 1173 浏览 3 评论 0 原文

我正在尝试使用Java的剧作家构建我的自动化框架,但是在运行测试时,我会遇到以下问题。请建议!

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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

晨与橙与城 2025-01-29 17:08:45

我可以通过设置env

PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1

Intellij Ide Run Configuration

“在此处输入映像”

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

蓬勃野心 2025-01-29 17:08:45

这不是剧作家或卑鄙的问题。您可以自己修复。 If you want just to avoid the problem, not fixing it, you can follow this recommendation:

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文