运行 webdriver-manager start --standalone 在 Azure Devops 上的问题
Problems with running webdriver-manager start --standalone on Azure Devops
我正在配置 运行 Protractor 测试,下面是在 Azure devops 中添加的步骤
当我 运行 这个管道时,它在 webdriver-manager start --standalone 被击中。不出来所以它 运行s 下一个命令开始测试。
错误日志
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\_tempab13f0-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\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\s\node_modules\selenium-webdriver\lib\webdriver.js:769:24)
2021-03-12T09:02:43.5648679Z at Function.createSession (D:\a\s\node_modules\selenium-webdriver\chrome.js:761:15)
2021-03-12T09:02:43.5649636Z at createDriver (D:\a\s\node_modules\selenium-webdriver\index.js:170:33)
2021-03-12T09:02:43.5650518Z at Builder.build (D:\a\s\node_modules\selenium-webdriver\index.js:626:16)
2021-03-12T09:02:43.5651614Z at Hosted.getNewDriver (D:\a\s\node_modules\protractor\built\driverProviders\driverProvider.js:53:33)
2021-03-12T09:02:43.5652586Z at Runner.createBrowser (D:\a\s\node_modules\protractor\built\runner.js:195:43)
2021-03-12T09:02:43.5653422Z at D:\a\s\node_modules\protractor\built\runner.js:339:29
2021-03-12T09:02:43.5654331Z at _fulfilled (D:\a\s\node_modules\protractor\node_modules\q\q.js:834:54)
2021-03-12T09:02:43.5655184Z at D:\a\s\node_modules\protractor\node_modules\q\q.js:863:30
2021-03-12T09:02:43.5656122Z at Promise.promise.promiseDispatch (D:\a\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
Not coming out of it so that it runs the next command to start test.
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
Not coming out of it so that it runs the next command to start test.
最初的问题已经解决
由于您没有启动或webdriver没有正确启动,我们可以看到错误问题:ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444
。如果前面的任务成功运行s Webdriver,我们将不会看到错误信息。
我们需要确保 Webdriver 启动,然后 运行 Protractor 测试。
我想通了。我们不需要明确的步骤来启动 Webdriver,而且我必须在 config.js
中注释一行
我正在配置 运行 Protractor 测试,下面是在 Azure devops 中添加的步骤
当我 运行 这个管道时,它在 webdriver-manager start --standalone 被击中。不出来所以它 运行s 下一个命令开始测试。
错误日志
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\_tempab13f0-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\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\s\node_modules\selenium-webdriver\lib\webdriver.js:769:24)
2021-03-12T09:02:43.5648679Z at Function.createSession (D:\a\s\node_modules\selenium-webdriver\chrome.js:761:15)
2021-03-12T09:02:43.5649636Z at createDriver (D:\a\s\node_modules\selenium-webdriver\index.js:170:33)
2021-03-12T09:02:43.5650518Z at Builder.build (D:\a\s\node_modules\selenium-webdriver\index.js:626:16)
2021-03-12T09:02:43.5651614Z at Hosted.getNewDriver (D:\a\s\node_modules\protractor\built\driverProviders\driverProvider.js:53:33)
2021-03-12T09:02:43.5652586Z at Runner.createBrowser (D:\a\s\node_modules\protractor\built\runner.js:195:43)
2021-03-12T09:02:43.5653422Z at D:\a\s\node_modules\protractor\built\runner.js:339:29
2021-03-12T09:02:43.5654331Z at _fulfilled (D:\a\s\node_modules\protractor\node_modules\q\q.js:834:54)
2021-03-12T09:02:43.5655184Z at D:\a\s\node_modules\protractor\node_modules\q\q.js:863:30
2021-03-12T09:02:43.5656122Z at Promise.promise.promiseDispatch (D:\a\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
Not coming out of it so that it runs the next command to start test.
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
Not coming out of it so that it runs the next command to start test.
最初的问题已经解决
由于您没有启动或webdriver没有正确启动,我们可以看到错误问题:ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444
。如果前面的任务成功运行s Webdriver,我们将不会看到错误信息。
我们需要确保 Webdriver 启动,然后 运行 Protractor 测试。
我想通了。我们不需要明确的步骤来启动 Webdriver,而且我必须在 config.js
中注释一行