首页 > 解决方案 > 在 Azure Devops 上运行 webdriver-manager start --standalone 的问题

问题描述

我正在配置运行量角器测试,以下是 Azure devops 中添加的步骤

在此处输入图像描述

当我运行这个管道时,它会在 webdriver-manager start --standalone 处受到打击。没有出来,所以它运行下一个命令来开始测试。

在此处输入图像描述

错误日志

2021-03-12T09:02:39.2180071Z ##[section]Starting: Run Test Cases
2021-03-12T09:02:39.3078252Z ==============================================================================
2021-03-12T09:02:39.3082840Z Task         : Command line
2021-03-12T09:02:39.3085464Z Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
2021-03-12T09:02:39.3086081Z Version      : 2.182.0
2021-03-12T09:02:39.3086701Z Author       : Microsoft Corporation
2021-03-12T09:02:39.3087524Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
2021-03-12T09:02:39.3088140Z ==============================================================================
2021-03-12T09:02:40.7279581Z Generating script.
2021-03-12T09:02:40.7467500Z Script contents:
2021-03-12T09:02:40.7486434Z node node_modules/protractor/bin/protractor protractor.conf.js
2021-03-12T09:02:40.7928490Z ========================== Starting Command Output ===========================
2021-03-12T09:02:40.8274945Z ##[command]"C:\windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "D:\a\_temp\91ab13f0-924e-4e63-a124-869764af15df.cmd""
2021-03-12T09:02:42.4610822Z [09:02:42] I/launcher - Running 1 instances of WebDriver
2021-03-12T09:02:42.4614093Z [09:02:42] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
2021-03-12T09:02:43.5634194Z [09:02:43] E/launcher - Error code: 135
2021-03-12T09:02:43.5635264Z [09:02:43] E/launcher - Error message: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444
2021-03-12T09:02:43.5636368Z [09:02:43] E/launcher - Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444
2021-03-12T09:02:43.5638525Z     at ClientRequest.<anonymous> (D:\a\1\s\node_modules\selenium-webdriver\http\index.js:238:15)
2021-03-12T09:02:43.5640056Z     at ClientRequest.emit (events.js:315:20)
2021-03-12T09:02:43.5642323Z     at Socket.socketErrorListener (_http_client.js:469:9)
2021-03-12T09:02:43.5643094Z     at Socket.emit (events.js:315:20)
2021-03-12T09:02:43.5643710Z     at emitErrorNT (internal/streams/destroy.js:106:8)
2021-03-12T09:02:43.5644453Z     at emitErrorCloseNT (internal/streams/destroy.js:74:3)
2021-03-12T09:02:43.5645162Z     at processTicksAndRejections (internal/process/task_queues.js:80:21)
2021-03-12T09:02:43.5645806Z From: Task: WebDriver.createSession()
2021-03-12T09:02:43.5646642Z     at Function.createSession (D:\a\1\s\node_modules\selenium-webdriver\lib\webdriver.js:769:24)
2021-03-12T09:02:43.5648679Z     at Function.createSession (D:\a\1\s\node_modules\selenium-webdriver\chrome.js:761:15)
2021-03-12T09:02:43.5649636Z     at createDriver (D:\a\1\s\node_modules\selenium-webdriver\index.js:170:33)
2021-03-12T09:02:43.5650518Z     at Builder.build (D:\a\1\s\node_modules\selenium-webdriver\index.js:626:16)
2021-03-12T09:02:43.5651614Z     at Hosted.getNewDriver (D:\a\1\s\node_modules\protractor\built\driverProviders\driverProvider.js:53:33)
2021-03-12T09:02:43.5652586Z     at Runner.createBrowser (D:\a\1\s\node_modules\protractor\built\runner.js:195:43)
2021-03-12T09:02:43.5653422Z     at D:\a\1\s\node_modules\protractor\built\runner.js:339:29
2021-03-12T09:02:43.5654331Z     at _fulfilled (D:\a\1\s\node_modules\protractor\node_modules\q\q.js:834:54)
2021-03-12T09:02:43.5655184Z     at D:\a\1\s\node_modules\protractor\node_modules\q\q.js:863:30
2021-03-12T09:02:43.5656122Z     at Promise.promise.promiseDispatch (D:\a\1\s\node_modules\protractor\node_modules\q\q.js:796:13)
2021-03-12T09:02:43.5658296Z [09:02:43] E/launcher - Process exited with error code 135
2021-03-12T09:02:43.6876129Z ##[error]Cmd.exe exited with code '135'.
2021-03-12T09:02:43.7575403Z ##[section]Finishing: Run Test Cases

标签: azure-devopsprotractor

解决方案


没有出来,所以它运行下一个命令来开始测试。

net 命令是任务Run Test Cases,对吧?如果是,我们可以单击任务并展开选项卡Control Options并确保该字段Run this task设置为Even if a previous task has failed, unless the build was canceled

然后如果任务Webdriver Start失败,管道将继续运行下一个任务Run Test Cases

在此处输入图像描述

更新1

没有出来,所以它运行下一个命令来开始测试。

最初的问题已经解决。

由于您尚未启动或 webdriver 未正确启动,我们可以看到错误问题:ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444. 如果上一个任务成功运行 Webdriver,我们将不会看到错误消息。

我们需要确保 Webdriver 启动,然后运行 ​​Protractor 测试。


推荐阅读