Protractor installed in offline mode - error for webdriver-manager start - what am I doing wrong - selenium

I need to install and use Protractor / Selenium on the machine without Internet access.
To do that, I've tried to download all needed files and copy them to the destination machine.
On my machine (with Internet access)
I installed Protractor and Selenium webdriver with the following command:
npm install -g protractor
webdriver-manager update
On destination machine (without Internet access)
I copied all files from the location returned by npm config get prefix to the computer without Internet access.
Then I executed following command on the machine without Internet access:
npm --cache-min 9999999 install -g protractor
which seems to succeed.
However, when I try to execute webdriver-manager start command, I receive following error message:
events.js:183
throw er; // Unhandled 'error' event
^
Error: getaddrinfo ENOTFOUND chromedriver.storage.googleapis.com
chromedriver.storage.googleapis.com:443
at errnoException (dns.js:50:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
I receive the same error when executing webdriver-manager update (as in this case: webdriver-manager start: Error: connect ETIMEDOUT)
Question
What am I doing wrong? How should I properly setup Protractor and webdriver on the machine without Internet access?

Because webdriver-manager start will look up the latest version number of selenium-server.jar and webdriver binaries through internet no matter they are already exists on local.
But webdriver-manager not supply cmd option to disable the looking up.
The quick way is to run the java cmd behind webdriver-manager start directly to skip the looking up.
java
-Dwebdriver.chrome.driver=C:\Tools\npm-global\node_modules\webdriver-manager\selenium\chromedriver_2.38.exe
-Dwebdriver.gecko.driver=C:\Tools\npm-global\node_modules\webdriver-manager\selenium\geckodriver-v0.20.1.exe
-jar C:\Tools\npm-global\node_modules\webdriver-manager\selenium\selenium-server-standalone-3.11.0.jar
-port 4444
The complex way is to change webdriver-manager code or setup a mirror on local and use cmd option: --alternate_cdn and point it to your local mirror url. ( I didn't verify this can work, get it after read some source code)

Related

Running against Edge on selenium-standable server

I am trying to run Edge in selenim-standalone server on my Mac.
I’ve followed the CLI command to install but when I try to with wdio project I get the following error:
ERROR webdriver: org.openqa.selenium.SessionNotCreatedException: Unable to create new service: EdgeDriverService
Started my server using this command:
selenium-standalone start --drivers.chrome.version=98.0.4758.80 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com
I have not had much luck finding another person having the same issue.
Server is running with node 14
Wdio project is running with node 16
any thoughts on what it might be?
Issue resolved.
I ended up running the install command in node v16 and that worked. I did have to delete selenium-server jar file the first time because it was corrupt. Though I re-ran the install command again it worked.

while installing cypress through command :npm install cypress --save-dev getting error as The Cypress App could not be downloaded

while installing cypress through command :npm install cypress --save-dev getting error as The Cypress App could not be downloaded.
Error :
Finishing Installation
The Cypress App could not be downloaded.
Does your workplace require a proxy to be used to access the Internet? If so, you must configure the HTTP_PROXY environment variable before downloading Cypress. Read more: https://on.cypress.io/proxy-configuration
Otherwise, please check network connectivity and try again:
But please not I m not using any proxy and on my personal wifi.
plz suggest ,what can be done in this case.Thanks
It seems to be too many possible reasons for this issue in general but I managed to find a workaround to install Cypress from within a corporation with npm and without using sudo npm or turning off strict ssl.
The following worked for me per November 18th 2020 with Ubuntu 18.04 and npm 6.14.8:
I downloaded the zip file shown in https://docs.cypress.io/guides/getting-started/installing-cypress.html#Direct-download
I installed cypress as shown in https://docs.cypress.io/guides/getting-started/installing-cypress.html#Install-binary : CYPRESS_INSTALL_BINARY=~/Downloads/cypress.zip npm install cypress --save-dev
I could now run npx cypress open to start the gui (which will also generate the cypress.json file)
Possible Reasons for this issue:
U might be running the project with a proxy setting.
One of the reason could be you are behind the firewall.that may prohibit your network? Please follow the guidelines in Proxy Configuration if so(https://docs.cypress.io/guides/references/proxy-configuration.html#Set-a-proxy-on-Linux-or-macOS).
make sure you have right access to install the cypress.
if none of the above mentioned reasons try removing the biraries or node_modules and install again.

webdriver manager not working behind proxy

I need to use webdriver-manager to execute:
webdriver-manager update --proxy=https://proxy.company.com:8080
But get
webdriver-manager: using local installed version 12.0.6
events.js:160
throw er; // Unhandled 'error' event
^
Error: read ECONNRESET
at exports._errnoException (util.js:1020:11)
at TLSWrap.onread (net.js:568:26)
i.e. the proxy command still does not seem to work for 12.0.6 for me.
What worked for me was adding --ignore_ssl in addition to --proxy
webdriver-manager update --proxy=http://someproxy:8080 --ignore_ssl
As question title sounds if-you want to use webDriver manager being behind proxy then use it like below in your browser instantiation class-
WebDriverManager.chromedriver().proxy("YourProxyServerUrl:YourPort").setup();
driver = new ChromeDriver(chromeOptions-if you have);
And if you looking for:updating the selenium webdriver using the "webdriver-manager
Refer below thread -
selenium webdriver manager update - npm

Error during "selenium-standalone install" command

Currently I am using the below commands for start the server (using Mocha framework) during second command am getting an error message. Please find the below and share your input
1. npm install selenium-standalone#latest -g
2. selenium-standalone install
3. selenium-standalone start
Error Log: During "selenium-standalone install"
firefox install:
from:
https://github.com/mozilla/geckodriver/releases/download/v0.13.0/geckodriv
er-v0.13.0-win64.zip to:
C:\Users\xxuser\AppData\Roaming\npm\node_modules\selenium-standalone.selen
ium\geckodriver\0.13.0-x64-geckodriver
C:\Users\xxuser\AppData\Roaming\npm\node_modules\selenium-standalone\bin\seleni
um-standalone:105
throw err;
^ Error: Could not download https://selenium-release.storage.googleapis.com/3.0/IE
DriverServer_x64_3.0.1.zip
at Request. (C:\Users\xxuser\AppData\Roaming\npm\node_modules\se
lenium-standalone\lib\install.js:273:21)
It is either an issue with google not having the file in the right place or selenium-standalone having the wrong url. If you go to https://github.com/mozilla/geckodriver/releases/download/v0.13.0/geckodriver-v0.13.0-win64.zip
it will download a zip file.
if you go to https://selenium-release.storage.googleapis.com/3.0/IE%20DriverServer_x64_3.0.1.zip
you get:
NoSuchKeyThe specified key does not exist.
The issue isn't firefox (gecko) driver it is internet explorer's driver.

manually install npm packages?

I'm experimenting with protractor and following tuturial on github. NPM was already present on my system, I succesfully downloaded protractor and now I'm proceeding with
webdriver-manager update
Which fails with
downloading http://selenium-release.storage.googleapis.com/2.42/selenium-server-standalone-2.42.2.jar...
Error: Got error Error: getaddrinfo ENOTFOUND from http://selenium-release.storage.googleapis.com/2.42/selenium-server-standalone-2.42.2.jar
Updating chromedriver
Error: Got error Error: getaddrinfo ENOTFOUND from https://chromedriver.storage.googleapis.com/2.10/chromedriver_win32.zip
downloading https://chromedriver.storage.googleapis.com/2.10/chromedriver_win32.zip...
Per earlier answered equal questions I double checked my npm proxy settings, all fine for http and https. Also I can see the username:password#proxy definition in .npmrc in my userprofile directory (c:/Users/my-name), the files are also present on the internet. Also the npm install action of protractor worked well. Now is it possible to manually (via browser download the relevant files and have them exploded and installed in the designated places?
I'm on windows 7 SP 1, 32 bit.
Yes you can manually install the webdriver-manager file in "node_modules\protractor\bin".
By the way , the error message really looks like you have a trouble to access internet.
Did you try to set these variables before launching your npm command:
set HTTP_PROXY=http://'your http proxy ip':'your proxy port'
set HTTPS_PROXY=http://'your https proxy ip':'your proxy port'
To answer my own question:
As Yannick mentioned: I only set the proxy configuration with npm config ... For this you also need to set the environment variables
set PROXY=http://<username>:<password>#proxyserver
set HTTP_PROXY=%PROXY%
set HTTPS_PROXY=%PROXY%