ChromeDriver only supports Chrome version 89 - azure-devops

Using Azure DevOps, somehow the pipeline just stop working and I can't get the test done when I run ng lint && ng e2e && ng test --watch=false. This it's working when running local.
[16:43:25] I/launcher - Running 1 instances of WebDriver
[16:43:25] I/direct - Using ChromeDriver directly...
[16:43:27] E/launcher - session not created: This version of ChromeDriver only supports Chrome version 89
Current browser version is 88.0.4298.0 with binary path D:\a\1\s\node_modules\puppeteer\.local-chromium\win64-818858\chrome-win\chrome.exe
(Driver info: chromedriver=89.0.4389.23 (61b08ee2c50024bab004e48d2b1b083cdbdac579-refs/branch-heads/4389#{#294}),platform=Windows NT 10.0.17763 x86_64)
[16:43:27] E/launcher - SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 89
Current browser version is 88.0.4298.0 with binary path D:\a\1\s\node_modules\puppeteer\.local-chromium\win64-818858\chrome-win\chrome.exe
(Driver info: chromedriver=89.0.4389.23 (61b08ee2c50024bab004e48d2b1b083cdbdac579-refs/branch-heads/4389#{#294}),platform=Windows NT 10.0.17763 x86_64)
at Object.checkLegacyResponse (D:\a\1\s\node_modules\selenium-webdriver\lib\error.js:546:15)
at parseHttpResponse (D:\a\1\s\node_modules\selenium-webdriver\lib\http.js:509:13)
at D:\a\1\s\node_modules\selenium-webdriver\lib\http.js:441:30
at processTicksAndRejections (internal/process/task_queues.js:93:5)
From: Task: WebDriver.createSession()
at Function.createSession (D:\a\1\s\node_modules\selenium-webdriver\lib\webdriver.js:769:24)
at Function.createSession (D:\a\1\s\node_modules\selenium-webdriver\chrome.js:761:15)
at Direct.getNewDriver (D:\a\1\s\node_modules\protractor\built\driverProviders\direct.js:77:33)
at Runner.createBrowser (D:\a\1\s\node_modules\protractor\built\runner.js:195:43)
at D:\a\1\s\node_modules\protractor\built\runner.js:339:29
at _fulfilled (D:\a\1\s\node_modules\protractor\node_modules\q\q.js:834:54)
at D:\a\1\s\node_modules\protractor\node_modules\q\q.js:863:30
at Promise.promise.promiseDispatch (D:\a\1\s\node_modules\protractor\node_modules\q\q.js:796:13)
at D:\a\1\s\node_modules\protractor\node_modules\q\q.js:556:49
at runSingle (D:\a\1\s\node_modules\protractor\node_modules\q\q.js:137:13)
[16:43:27] E/launcher - Process exited with error code 199
##[error]Cmd.exe exited with code '1'.
This is how I set the pipeline task
puppeteer
cd node_modules/puppeteer
npm install
npm install webdriver-manager#latest
> puppeteer#5.5.0 install D:\a\1\s\node_modules\puppeteer
> node install.js
Chromium is already in D:\a\1\s\node_modules\puppeteer\.local-chromium\win64-818858; skipping download.
> puppeteer#5.5.0 prepare D:\a\1\s\node_modules\puppeteer
> node typescript-if-required.js
added 848 packages from 915 contributors and audited 860 packages in 43.745s
96 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Finishing: npm install puppeteer
ng test
ng lint && ng e2e && ng test --watch=false

According the doc: Microsoft Windows Server 2019 Datacenter and Ubuntu 20.04.2 LTS. We find there is only ChromeDriver 88.0.4324.96 on our hosted agent.
So we have two suggestions:
We noticed that the test is working well on your local machine, so we can try to install a self-agent in your local machine and use the new agent to try again.
We can add a bash task and use the below the script to install latest version of the ChromeDriver first.
npm install chromedriver --chromedriver_cdnurl=https://chromedriver.storage.googleapis.com/89.0.4389.23/chromedriver_win32.zip

since you are using javascript
yarn add chromedriver --chromedriver-force-download
or
npm install --save-dev chromedriver --chromedriver-force-download
https://github.com/giggio/node-chromedriver/issues/311

Related

yarn on wsl ubuntu 18.0 vscode not using lock file

Hi Trying to run a yarn install on project on WSL Ubuntu 18.04 using vscode. But yarn seems to not be using the yarn lockfile and I get errors about the wrong node engine when running yarn install....
cd-ing to the project directory and running sudo yarn install
yarn install v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
error juice#7.0.0: The engine "node" is incompatible with this module. Expected version ">=10.0.0". Got "8.10.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
it looks like its just using yarn from the usr install and not the local project directory what am I doing wrong?

Azure Devops: chromedriver is not a valid Win32 application

I am trying to run Automation Tests on Azure Devops using ChromeDriver. For that I am following below steps:
npm install -g chromedriver This works fine
chromedriver -v This works fine and gives ChromeDriver 85.0.4183.87 (cd6713ebf92fa1cacc0f1a598df280093af0c5d7-refs/branch-heads/4183#{#1689})
But when I run maven command, for ex: mvn clean verify -Dcucumber.options="--tags #smoke" -e then it gives below error.
2020-10-06T12:34:50.0688871Z Oct 06, 2020 12:34:50 PM org.openqa.selenium.os.OsProcess checkForError
2020-10-06T12:34:50.0689959Z SEVERE: org.apache.commons.exec.ExecuteException:
Execution failed (Exit value: -559038737. Caused by java.io.IOException:
Cannot run program "G:\a\..\..\_tool\node\..\..\x64\chromedriver" (in directory "."):
CreateProcess error=193, %1 is not a valid Win32 application)
Node version is v10.22.1
NPM version is 6.14.6
OS name: "windows server 2016", version: "10.0", arch: "amd64", family: "windows". It is VM and ADO Agent
There a few possible causes for the "%1 is not a valid Win32 application" message including: the pathname for the application is incorrect or the file is a 32 bit executable, but for some reason it is trying to load a 64 bit DLL.
npm install -g chromedriver It will use a global location instead of install chromedriver under the local folder, you can use the cmd npm install chromedriver and check the log then we can get the path.
If we are using npm install -g to install the program. On Windows the path could be C:\Users\YOU\AppData\Roaming\npm\node_modules, and according to the log, we can see that it run the program under G:\a\..\..\_tool\node\..\..\x64\chromedriver

Run Cypress.io on Azure Pipelines Hosted Linux Agent

I'm trying to run Cypress tests on the Hosted Linux Pool for Azure Pipelines. Unfortunately, the Hosted Agent doesn't have all the dependencies for Cypress installed.
Running the documented apt-get doesn't work:
2018-05-18T21:03:14.7423331Z ##[section]Starting: Install cypress dependencies
2018-05-18T21:03:14.7474742Z ==============================================================================
2018-05-18T21:03:14.7488281Z Task : Bash
2018-05-18T21:03:14.7501148Z Description : This is an early preview. Run a Bash script on macOS, Linux, or Windows
2018-05-18T21:03:14.7513088Z Version : 3.127.0
2018-05-18T21:03:14.7524823Z Author : Microsoft Corporation
2018-05-18T21:03:14.7537179Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613738)
2018-05-18T21:03:14.7549730Z ==============================================================================
2018-05-18T21:03:15.0174503Z Generating script.
2018-05-18T21:03:15.0535056Z Script contents:
2018-05-18T21:03:15.0547355Z apt-get install xvfb libgtk2.0-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2
2018-05-18T21:03:15.0656822Z [command]/bin/bash --noprofile --norc /opt/vsts/work/_temp/cac4d3f9-42e7-49f3-94f6-7d0444827d83.sh
2018-05-18T21:03:15.6040707Z Reading package lists...
2018-05-18T21:03:15.6085335Z Building dependency tree...
2018-05-18T21:03:15.6153815Z Reading state information...
2018-05-18T21:03:15.6186788Z Package libgconf-2-4 is not available, but is referred to by another package.
2018-05-18T21:03:15.6198707Z This may mean that the package is missing, has been obsoleted, or
2018-05-18T21:03:15.6211380Z is only available from another source
2018-05-18T21:03:15.6216969Z
2018-05-18T21:03:15.6229592Z E: Unable to locate package xvfb
2018-05-18T21:03:15.6242128Z E: Unable to locate package libnotify-dev
2018-05-18T21:03:15.6254440Z E: Package 'libgconf-2-4' has no installation candidate
2018-05-18T21:03:15.6268141Z E: Unable to locate package libxss1
2018-05-18T21:03:15.6370826Z ##[error]Bash exited with code '100'.
2018-05-18T21:03:15.7283047Z ##[section]Finishing: Install cypress dependencies
Running apt-get update takes forever (25 minutes and still not done).
Any clues on how to get Cypress working quickly on the Hosted Agent is welcome.
Note: I tried running on Windows, that works, fortunately, so I'm not completely blocked. But to use the Windows Agent I now have 2 agent phases which adds overhead due to artefact downloads and npm install overhead.
Solved the issue using a pre-pended Shell (Bash) task in VSTS agent phase prior to running Cypress:
apt-get -qq -y update
apt-get -qq -y install xvfb libgtk2.0-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2

Eclipse Angular IDE project creation fails and has wrong node version

I'm on a mac. I just installed Angular IDE (eclipse) and when I try to create a new Angular project it fails. I can run the same commands from the terminal and it works. I'm using node 8.9.1 and npm 5.5.1 outside the IDE, but can't find where to tell the plugin to use that version.
Node.js version: v9.1.0
NPM version: 5.5.1
npm install #angular/cli#1.4.9
npm WARN npm npm does not support Node.js v9.1.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8.
npm WARN npm You can find the latest version at https://nodejs.org/
WARNING: You are likely using a version of node-tar or npm that is incompatible with this version of Node.js.
Please use either the version of npm that is bundled with Node.js, or a version of npm (> 5.5.1 or < 5.4.0) or node-tar (> 4.0.1) that is compatible with Node.js 9 and above.
/Users/bobsmith/.webclipse/nodejs/9.1.0/bin/node[4666]: ../src/node_zlib.cc:437:static void node::(anonymous namespace)::ZCtx::Init(const FunctionCallbackInfo<v8::Value> &): Assertion `args.Length() == 7 && "init(windowBits, level, memLevel, strategy, writeResult, writeCallback," " dictionary)"' failed.
1: node::Abort() [/Users/bobsmith/.webclipse/nodejs/9.1.0/bin/node]
2: node::(anonymous namespace)::DomainEnter(node::Environment*, v8::Local<v8::Object>) [/Users/bobsmith/.webclipse/nodejs/9.1.0/bin/node]
3: node::(anonymous namespace)::ZCtx::Init(v8::FunctionCallbackInfo<v8::Value> const&) [/Users/bobsmith/.webclipse/nodejs/9.1.0/bin/node]
4: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) [/Users/bobsmith/.webclipse/nodejs/9.1.0/bin/node]
5: v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) [/Users/bobsmith/.webclipse/nodejs/9.1.0/bin/node]
6: v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/Users/bobsmith/.webclipse/nodejs/9.1.0/bin/node]
7: 0x337a5df842fd
/Users/bobsmith/.webclipse/npm/5.5.1/bin/npm: line 14: 4666 Abort trap: 6 node "$basedir/../bin/npm-cli.js" "$#"
First, try to execute outside the IDE the line "npm install #angular/cli#1.4.9", later in the IDE, you need to create the project with the same versions for node, npm, en angular cli that you have installed in your machine.

hexo deploy Error: spawn ENOMEM

When i execute hexo deploy , it always an error!I have tried to delete .deploy_git,but doesn‘t solve this problem.
Error info
[root#ecs hexo]# hexo deploy
INFO Deploying: git
INFO Clearing .deploy_git folder...
INFO Copying files from public folder...
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: spawn ENOMEM
at exports._errnoException (util.js:1022:11)
at ChildProcess.spawn (internal/child_process.js:313:11)
at Object.exports.spawn (child_process.js:385:9)
at spawn (/data/www/hexo/node_modules/.4.0.0#cross-spawn/index.js:17:18)
_config.yml
deploy:
type: git
repo: git#github.com:vincent927/vincent927.github.io.git
branch: master
version info
[root#ecs hexo]# hexo -v
hexo: 3.2.2
hexo-cli: 1.0.2
os: Linux 3.10.0-327.36.3.el7.x86_64 linux x64
http_parser: 2.7.0
node: 7.1.0
v8: 5.4.500.36
uv: 1.10.0
zlib: 1.2.8
ares: 1.10.1-DEV
modules: 51
openssl: 1.0.2j
icu: 58.1
unicode: 9.0
cldr: 30.0.2
tz: 2016g
How can i fix this problem?