Webdriver-manager update unable to download geckodriver - protractor

I am trying to setup protractor for my angular app automation. I am on Node version 12 , I installed protractor version 5.4.3. when I use webdriver-manger update --proxy=blahblahproxy.com , I see the below error.
[13:37:06] I/config_source - curl -oC:\Users\******\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\gecko-response.json '**corpproxy**/repos/mozilla/geckodriver/releases' -H 'host:api.github.com'
(node:15904) UnhandledPromiseRejectionWarning: Error: response status code is not 200. It was 407
at Request.<anonymous> (C:\Users\*****\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\built\lib\binaries\config_source.js:181:28)
at Request.emit (events.js:311:20)
at Request.onRequestResponse (C:\Users\*****\AppData\Roaming\npm\node_modules\protractor\node_modules\request\request.js:1059:10)
at ClientRequest.emit (events.js:311:20)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:603:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:119:17)
at Socket.socketOnData (_http_client.js:476:22)
at Socket.emit (events.js:311:20)
at addChunk (_stream_readable.js:294:12)
at readableAddChunk (_stream_readable.js:275:11)
(node:15904) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:15904) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Chrome and selenium standlaone server are updated/downlaoded just fine
when i do webdriver-manager status
[13:39:39] I/status - selenium standalone version available: 3.141.59
[13:39:39] I/status - chromedriver version available: 80.0.3987.106
[13:39:39] I/status - geckodriver is not present
[13:39:39] I/status - IEDriverServer is not present
[13:39:39] I/status - android-sdk is not present
[13:39:39] I/status - appium is not present

Under corporate proxies we will face issues like this.
The 407 Proxy Authentication Required is an HTTP response status code indicating that the server is unable to complete the request because the client lacks proper authentication credentials for a proxy server that is intercepting the request between the client and server.
Option 1 : Try using selenium-standalone npm package. This is similar to webdriver-manager.
https://www.npmjs.com/package/selenium-standalone
Install this package globally
npm i -g selenium-standalone
Then to download/install the drivers
selenium-standalone install
Then to start the server
selenium-standalone start
(Or)
Option 2: https://stackoverflow.com/a/53358685/8903949

Related

How do I fix this error when creating a candy machine with metaplex?

I am following this tutorial "https://www.youtube.com/watch?v=4LLx7SMAOag&t=446s" and at 9:28 he tells us to input this
ts-node js/packages/cli/src/candy-machine-cli.ts upload ./assets --env devnet --keypair ~/config/solana/devnet-test.json
His result is an initialized candy machine as shown in the video. Mine is the following:
Beginning the upload for 150 (png+json) pairs
started at: 1634300753134
wallet public key: GLCNNSs9QA1YqxkY6Ptq3pb6UZrkRbwGw7ZUGeJK1CCg
(node:6434) UnhandledPromiseRejectionWarning: Error: failed to get info about
account 63N3bBDCVVzdCaofQAnY5s4kcZodw1evomptDgNQ4feK: FetchError: request to https://api.devnet.solana.com/ failed, reason: connect ENETUNREACH 128.0.113.156:443
at Connection.getAccountInfo (/Users/hectorbardales/Desktop/metaplex/js/node_modules/#solana/web3.js/src/connection.ts:2404:13)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Function.fetchIdl
(/Users/hectorbardales/Desktop/metaplex/js/node_modules/#project-serum/anchor/src/program/index.ts:309:25)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:6434) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:6434) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
What do I do to fix this? (I'm running this in visual studio code on a Mac)
Here's what I did for example
ts-node ./js/packages/cli/src/candy-machine-v2-cli.ts upload \
-e devnet \
-k ./js/cm.devnet.json \
-cp ./js/config.json \
-c temp \
./js/assets-pictures
I made sure the path was clear and direct to each file, make sure for -k its path is to the file created when you did your keygen.
If you haven't, perhaps try airdropping 10 SOLs into that wallet address listed above? But do 5 first, then 5 again.
I can't remember what error I got, but I did have issues with that line.
Command for airdropping Sol is simple. Solana Airdrop x (x is your SOL amount).
Idk, worth a shot.
ENETUNREACH is a connection-related error. Even if you are able to browse the web or do other things, the best option is to test again with a new internet connection.

Can not connect to MongoDB Atlas version 4.0

I can't connect to the last version of Atlas (4.0), but if using an older version it connects!
I got this message when trying to connect to version 4.0
(node:9920) UnhandledPromiseRejectionWarning: Error: queryTxt ETIMEOUT cluster0.zgdl9.mongodb.net
at QueryReqWrap.onresolve [as oncomplete] (dns.js:203:19)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:9920) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:9920) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Go the the Network Access on your Atlas Cluster and check if you whitelisted your IP. You can also whitelist all IPs with 0.0.0.0/0. I think by default no IP is whitelisted and that is why you can't connect.

webdriver-manager update with --alternate_cdn argument

I want to do the below in my protractor-cucumber framework. I can not use public repo like googleapi.com as per org policy:
webdriver-manager update --standalone=0 --chrome --alternate_cdn https://www.artifactrepository.xyz.net/artifactory/api/npm-teamdev/
Also this:
webdriver-manager update --chrome=0 --standalone --alternate_cdn https://www.artifactrepository.xyz.net/artifactory/api/npm-teamdev/
But i always get this as response:
C:\Users\ABCD\Desktop\JSProjects\protractor-cucumber>webdriver-manager
update --standalone=0 --chrome --alternate_cdn
https://www.artifactrepository.xyz.net/artifactory/api/npm/npm-teamdev/
curl -o
C:\Users\ABCD\AppData\Roaming\npm\node_modules\webdriver-manager\downloads\chromedriver.xml
https://chromedriver.storage.googleapis.com/ curl
https://api.github.com/rate_limit -H "User-Agent:
angular/webdriver-manager" [ERROR]: { Error: getaddrinfo ENOTFOUND
api.github.com api.github.com:443
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:57:26) errno: 'ENOTFOUND', code: 'ENOTFOUND', syscall: 'getaddrinfo',
hostname: 'api.github.com', host: 'api.github.com', port: 443 }
(node:8016) UnhandledPromiseRejectionWarning: TypeError: Cannot
convert undefined or null to object
at Function.keys ()
at getVersionObjs (C:\Users\ABCD\AppData\Roaming\npm\node_modules\webdriver-manager\dist\lib\provider\utils\version_list.js:28:41)
at Object.getVersion (C:\Users\ABCD\AppData\Roaming\npm\node_modules\webdriver-manager\dist\lib\provider\utils\version_list.js:12:25)
at GeckoDriver.updateBinary (C:\Users\ABCD\AppData\Roaming\npm\node_modules\webdriver-manager\dist\lib\provider\geckodriver.js:62:43)
at process._tickCallback (internal/process/next_tick.js:68:7) (node:8016) UnhandledPromiseRejectionWarning: Unhandled promise
rejection. This error originated either by throwing inside of an async
function without a catch block, or by rejecting a promise which was
not handled with .catch(). (rejection id: 1) (node:8016) [DEP0018]
DeprecationWarning: Unhandled promise rejections are deprecated. In
the future, promise rejections that are not handled will terminate the
Node.js process with a non-zero exit code.
I have also tried to modify the cdn url in ./node_modules/protractor/node_modules/webdriver-manager/config.json
{
"cdnUrls": {
"selenium": "https://www.artifactrepository.xyz.net/artifactory/api/npm/npm-teamdev/",
"chromedriver": "https://www.artifactrepository.xyz.net/artifactory/api/npm/npm-teamdev/",
"geckodriver": "https://www.artifactrepository.xyz.net/artifactory/api/npm/npm-teamdev/",
"iedriver": "https://www.artifactrepository.xyz.net/artifactory/api/npm/npm-teamdev/"
}
}
This one also did not work for me. I got the same error.
I want to know what's the issue here and how can how to resolve it?
Does webdriver-manager expect xml when the request hits custom CDN url?
If yes, is there a way to update if it returns html instead of xml. Because I can see all these drivers in the repo.

update protractor chrome driver to 74

How do I update to 74 version of chromedriver
normally I would do:
webdriver-manager update --versions.chrome 2.46
however the following is not working:
webdriver-manager update --versions.chrome 74.0.3729.6
I am on Protractor Version 5.4.2
Dont want to upgrade to 6 as API is not yet completed
Log:
[16:21:43] E/downloader - undefined
[16:21:43] I/update - chromedriver: file exists /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_74.0.3729.6.zip
[16:21:43] I/update - chromedriver: unzipping chromedriver_74.0.3729.6.zip
(node:35565) UnhandledPromiseRejectionWarning: Invalid filename
(node:35565) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:35565) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[16:21:44] I/update - selenium standalone: file exists /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-4.0.0-alpha-1.zip.jar
[16:21:44] I/update - selenium standalone: selenium-server-standalone-4.0.0-alpha-1.zip.jar up to date
[16:21:44] I/update - geckodriver: file exists /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.24.0.tar.gz
[16:21:44] I/update - geckodriver: unzipping geckodriver-v0.24.0.tar.gz
[16:21:44] I/update - geckodriver: setting permissions to 0755 for /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.24.0
[16:21:44] I/update - geckodriver: geckodriver-v0.24.0 up to date
[UPDATE - SOLUTION]
npm install -g webdriver-manager#12.1.4
webdriver-manager version
webdriver-manager update
I found a working solution for protractor 5.4.2. You need to install webdriver-manager v12.1.3 and run npm dedupe. Then run webdriver-manager update --versions.chrome=2.46. In my case it didn't work because of webdriver-manager 12.1.1 installed selenium-server-standalone-4.0.0-alpha-1.zip.jar (this version only works with protractor 6.0.0) instead of selenium-server-standalone-3.141.59.jar.
Old answer
Only way I found to start it now (30.04.2019) is to start webdriver-manager separately and connect to its instance. It works with protractor v6.0.0 and webdriver-manager v12.1.3.
add this to protractor.conf.js:
exports.config = {
// ...
seleniumAddress: 'http://localhost:4444/wd/hub',
// ...
}
then run webdriver-manager start and in another tab protractor protractor.conf.js

Failed to install 'cordova-plugin-file' - Ionic-cordova

I was trying to install the plugin
ionic cordova plugin add cordova-plugin-file
I'm getting error in cmd as
Failed to install 'cordova-plugin-file': Error: ENOENT: no such file
or director y, open
'D:\product\project-1\frontend\platforms\android\AndroidManifest.xml'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.readFileSync (fs.js:551:33)
at Object.parseElementtreeSync (D:\product\project-1\frontend\platforms\andr
oid\cordova\node_modules\cordova-common\src\util\xml-helpers.js:180:27)
at new AndroidManifest (D:\product\project-1\frontend\platforms\android\cord
ova\lib\AndroidManifest.js:29:20)
at AndroidProject.getPackageName (D:\product\project-1\frontend\platforms\an
droid\cordova\lib\AndroidProject.js:99:12)
at Api.addPlugin (D:\product\project-1\frontend\platforms\android\cordova\Ap
i.js:223:57)
at handleInstall (C:\Users\hi\AppData\Roaming\npm\node_modules\cordova\node_
modules\cordova-lib\src\plugman\install.js:594:10)
at C:\Users\hi\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova
-lib\src\plugman\install.js:357:28
at _fulfilled (C:\Users\hi\AppData\Roaming\npm\node_modules\cordova\node_mod
ules\cordova-lib\node_modules\q\q.js:787:54)
at self.promiseDispatch.done (C:\Users\hi\AppData\Roaming\npm\node_modules\c
ordova\node_modules\cordova-lib\node_modules\q\q.js:816:30)
(node:5240) UnhandledPromiseRejectionWarning: Error: ENOENT: no such
file or dir ectory, open
'D:\product\project-1\frontend\platforms\android\AndroidManifest.xm l'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.readFileSync (fs.js:551:33)
at Object.parseElementtreeSync (D:\product\project-1\frontend\platforms\andr
oid\cordova\node_modules\cordova-common\src\util\xml-helpers.js:180:27)
at new AndroidManifest (D:\product\project-1\frontend\platforms\android\cord
ova\lib\AndroidManifest.js:29:20)
at AndroidProject.getPackageName (D:\product\project-1\frontend\platforms\an
droid\cordova\lib\AndroidProject.js:99:12)
at Api.addPlugin (D:\product\project-1\frontend\platforms\android\cordova\Ap
i.js:223:57)
at handleInstall (C:\Users\hi\AppData\Roaming\npm\node_modules\cordova\node_
modules\cordova-lib\src\plugman\install.js:594:10)
at C:\Users\hi\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova
-lib\src\plugman\install.js:357:28
at _fulfilled (C:\Users\hi\AppData\Roaming\npm\node_modules\cordova\node_mod
ules\cordova-lib\node_modules\q\q.js:787:54)
at self.promiseDispatch.done (C:\Users\hi\AppData\Roaming\npm\node_modules\c
ordova\node_modules\cordova-lib\node_modules\q\q.js:816:30)
(node:5240) UnhandledPromiseRejectionWarning: Unhandled promise
rejection. This error originated either by throwing inside of an async
function without a catch block, or by rejecting a promise which was
not handled with .catch(). (rejection id: 1) (node:5240) [DEP0018]
DeprecationWarning: Unhandled promise rejections are depre cated. In
the future, promise rejections that are not handled will terminate the
Node.js process with a non-zero exit code.
ionic cordova rm platform android
Then install the plugin. Then add the platform back.