0
votes

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?

1
Are your machine running under any proxy ? - Ankur Singh

1 Answers

2
votes

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)