【问题标题】:Remote Chrome WebDriver on gcpgcp 上的远程 Chrome WebDriver
【发布时间】:2022-01-08 23:41:20
【问题描述】:

我在 GCP Cloud Run 中运行远程 chrome webdriver。如果我使用 unathenicated 服务调用,它工作得很好,我可以从我的 java 代码连接到这个 Chrome Webdriver。但是,一旦我enable gcp authentication service-to-service,它就会停止工作。我无法找到向 Selenium Remote Webdriver 提供 google 令牌的方法。我知道我需要扩展现有的 Selenium java 类之一,例如 RemoteWebDriver 或 HttpCommandExecutor,但不清楚究竟是哪个类。请指教。

【问题讨论】:

    标签: selenium-webdriver google-cloud-platform webdriver remotewebdriver


    【解决方案1】:

    我能够通过自定义 VPC 连接器从另一个 Cloud Run 服务访问作为 Cloud Run 服务运行的 selenium/standalone-chrome docker 映像,我离开 auth 选项 “允许未经身份验证的调用” 但入口选项 - “仅允许内部流量” 所以我的 selenium 服务 URL 以 403 响应全世界但可从项目基础架构内访问。

    还有一件事 - 当您为 selenium Cloud Run 服务指定 VPC 连接器时 - 选择 “仅通过 VPC 连接器将请求路由到私有 IP” 因为 “通过VPC 连接器” 将使 selenium 无法访问万维网。

    【讨论】:

      猜你喜欢
      • 2011-10-18
      • 1970-01-01
      • 1970-01-01
      • 2012-05-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多