【问题标题】:No selenium server jar found error while running protractor tests in Azure DevOps在 Azure DevOps 中运行量角器测试时没有发现硒服务器 jar 错误
【发布时间】:2021-05-14 12:23:23
【问题描述】:

我正在尝试在 Azure DevOps 管道上运行量角器测试并收到以下错误。请注意,即使从 Azure DevOps 服务器运行测试,jar 文件路径也指向我的本地驱动器。知道我需要做什么吗?

从本地计算机运行时相同的测试有效,但在 Azure 上失败。我的项目的 node_modules 文件夹中有 selenium-server-standalone-3.141.59.jar。我不明白的是,当我从 Azure 运行测试时,为什么它会查看我的本地计算机 (C:\Automation)。

[13:33:31] I/launcher - Running 1 instances of WebDriver
[13:33:31] E/local - Error code: 135
[13:33:31] E/local - Error message: No selenium server jar found at
C:\Automation\my_app\node_modules\protractor\node_modules\webdriver
manager\selenium\selenium-server-standalone-3.141.59.jar. Run 'webdriver-manager
update' to download binaries.

【问题讨论】:

  • 您是否在本地节点模块文件夹上运行了 webdriver-manager 更新
  • 请出示你的量角器 conf.js
  • @salis01 您使用的是 Azure DevOps 服务 (dev.azure.com/xxxx) 还是本地 Azure DevOps 服务器?你能分享你的管道定义吗?尝试以下文档中的示例,看看您是否可以重现此问题:protractortest.org/#

标签: selenium-webdriver azure-devops protractor


【解决方案1】:

此问题可能由以下原因引起:

  1. selenium-server-standalone-3.141.59.jar 不存在于您项目的 node_modules\protractor\node_modules\webdriver-manager\selenium 位置。

  2. selenium-server-standalone 存在不同版本。

尝试将命令行任务添加到更新 webdriver。

有用的资源:

  1. Error: No selenium server jar found at "Location"

  2. https://medium.com/@ganeshsirsi/protractor-end-to-end-tests-configure-on-ci-cd-tfs-vsts-azure-devops-publish-html-results-9143846f579f

  3. https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/javascript?view=azure-devops&tabs=code#end-to-end-browser-testing

【讨论】:

  • 您可以添加回复和Accept it as an Answer,这对阅读此主题的其他社区成员会有所帮助。
  • 问题是当我将代码从本地机器推送到 git 存储库时,“update-config.json”文件仍然指向我的本地机器。在构建代理中手动更新路径或运行“webdriver-manager update”解决了该问题。最初,当我尝试运行“webdriver-manager update”时,我遇到了一些公司安全问题。我必须添加代理数据才能成功更新。
猜你喜欢
  • 2017-08-26
  • 2017-02-04
  • 2020-12-13
  • 1970-01-01
  • 2015-08-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多