webdriver manager not working behind proxy - selenium

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

Related

WebdriverIO SevereServiceErrror not stopping the test run

I have setup a custom wdio service (as per the documentation) which is used to create a build for the Angles automation dashboard.
As part of this service I want to use the SevereServiceError when it is unable to create the build and stop the run. However in my example test it throws the error and simply continues the test run. See logs here:
2022-03-05T07:28:36.936Z INFO #wdio/cli:launcher: Run onPrepare hook
2022-03-05T07:28:36.936Z INFO chromedriver: Start Chromedriver (/git/angles/webdriverio-example/node_modules/chromedriver/lib/chromedriver/chromedriver) with args --port=9515 --url-base=/
2022-03-05T07:28:36.982Z ERROR #wdio/cli:utils: A service failed in the 'onPrepare' hook
SevereServiceError: Unable to create a build due to connect ECONNREFUSED 127.0.0.1:3000.
at /Users/sergios/Documents/git/angles/webdriverio-example/node_modules/angles-wdio-reporter/src/integrations/wdio/AnglesWDIOService.ts:57:15
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async /Users/sergios/Documents/git/angles/webdriverio-example/node_modules/#wdio/cli/build/utils.js:28:17
at async Promise.all (index 1)
at async Launcher.run (/Users/sergios/Documents/git/angles/webdriverio-example/node_modules/#wdio/cli/build/launcher.js:86:13)
Continue...
2022-03-05T07:28:36.985Z INFO chromedriver: Starting ChromeDriver 98.0.4758.102 (273bf7ac8c909cde36982d27f66f3c70846a3718-refs/branch-heads/4758#{#1151}) on port 9515
2022-03-05T07:28:36.987Z INFO chromedriver: Only local connections are allowed.
You can run the example yourself by cloning the example repo and running npm run test.
NOTE: This should fail because it's looking for a local instance of the Angles dashboard.
Any ideas why the SevereServiceError isn't stopping the test run?
By updating wdio dependencies and ts-node and typescript to current versions this issue has been resolved. The test run now stops when the SeverServiceError is thrown.

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.

Selenium: Error: WebDriverError: Invalid timeout type specified: ms

I have a problem using Selenium on IE.
When I run npm run e2e:desktop command, Selenium launch and close immediately an IE page. Then, I got this error:
E/runner - Unable to start a WebDriver session.
E/launcher - Error: WebDriverError: Invalid timeout type specified: ms
I launch this command to install selenium:
webdriver-manager update --standalone=false --chrome=false --gecko=false --versions.standalone=3.4.0 --versions.chrome=2.25
Stack:
IE : 11.0.960019463
Protractor : 5.1.1
Selenium Server Stadalone : 3.141.59
IE web driver : 3.14.0
Any idea?
It seems a bug of protractor 5.0.0+ dependencies. You could try to downgrade protractor from 5.1.1 to 5.0.0. Or you could try the following command to update and start the webdriver manager with a specific version:
webdriver-manager clean
webdriver-manager update --ie --versions.standalone=3.4.0 --versions.ie=3.4.0
webdriver-manager start --versions.standalone=3.4.0
For more information, you could refer to this thread.

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

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)

"webdriver-manager update" Command shows error message in Protractor

When I issue the command
webdriver-manager update while starting my protractor script execution I see below error message:
"Error: read ECONNRESET
at exports._errnoException (util.js:1020:11)
at TLSWrap.onread (net.js:568:26)"
Add proxy if your network behind proxy.
webdriver-manager update --proxy http://yourproxy:yourport.
Also add proxy for webdriver-manager start.
If you don't like to type the proxy every time, you can add HTTP_PROXY, HTTPS_PROXY and NO_PROXY Environment Variables.
It seems you are behind corporate firewall, Try below commands. It should work fine.
webdriver-manager update --ignore-ssl --proxy http://XXX.XXX.XXX:80
webdriver-manager start --ignore-ssl --proxy http://XXX.XXX.XXX:80
if both of them doesn't work. Try the below command as well.
webdriver-manager update --proxy http://XXX.XXX.XXX:8000 --ignore_ssl --gecko false