Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set https proxy for selenium's webdriver?

I am trying to use protractor for automated javascript testing. This means following these instructions: http://www.ng-newsletter.com/posts/practical-protractor.html

npm install -g protractor

completes fine. However:

webdriver-manager update

does not get round the proxy I have at work. Apparently, you can now set the proxy in a configuration, but I can not follow how to do this: https://github.com/angular/protractor/pull/966 Basically, I need to set 'env.HTTPS_PROXY', but I can't see where to do this? I can see that I could probably edit the webdriver-manager file to fix this, but that seems wrong.

Note: I have tried installing this files (from webdriver-manager update) manually and copying them into the expected locations, but the jar file becomes corrupt.

like image 388
trees_are_great Avatar asked Jan 20 '15 17:01

trees_are_great


1 Answers

In cmd

set PROXY=http://username:password@proxyserver:port
set HTTP_PROXY=%PROXY%
set HTTPS_PROXY=%PROXY% 
webdriver-manager update

Or go to file .npmrc usually is here C:\Users\username.npmrc ( if not, search it with command npm config ls -l | grep config) and set the proxy variables manually by typing in it

proxy=http://username:password@proxyserver:port
https-proxy=http://username:password@proxyserver:port

A third way is to make two system environment variables HTTP_PROXY and HTTPS_PROXY with value http://username:password@proxyserver:port

like image 175
Cassian Avatar answered Oct 22 '22 04:10

Cassian