angular / webdriver-manager

A binary manager for E2E testing
MIT License
226 stars 114 forks source link

downloading selenium incorrectly #370

Open smonasco opened 5 years ago

smonasco commented 5 years ago

Hi. I’m running into a problem where webdriver-manager is downloading a zip and renaming it .jar and then I get a corrupt jarfile.

curl -o/Users/smonasco/spartan/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-4.0.0-alpha-1.zip.jar https://selenium-release.storage.googleapis.com/4.0/selenium-server-standalone-4.0.0-alpha-1.zip

This is of course not a proper jar file and later I get

[webdriver] Error: Invalid or corrupt jarfile /home/circleci/project/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-4.0.0-alpha-1.zip.jar

running it from bash this is the output.

Admins-MacBook-Pro:bin smonasco$ ./webdriver-manager update --standalone
webdriver-manager: using global installed version 12.1.1
[13:34:08] I/update - chromedriver: file exists /Users/smonasco/spartan/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.46.zip
[13:34:08] I/update - chromedriver: unzipping chromedriver_2.46.zip
[13:34:08] I/update - chromedriver: setting permissions to 0755 for /Users/smonasco/spartan/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.46
[13:34:08] I/update - chromedriver: chromedriver_2.46 up to date
[13:34:08] I/downloader - curl -o/Users/smonasco/spartan/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-4.0.0-alpha-1.zip.jar https://selenium-release.storage.googleapis.com/4.0/selenium-server-standalone-4.0.0-alpha-1.zip
[13:34:09] I/update - geckodriver: file exists /Users/smonasco/spartan/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.24.0.tar.gz
[13:34:09] I/update - geckodriver: unzipping geckodriver-v0.24.0.tar.gz
[13:34:09] I/update - geckodriver: setting permissions to 0755 for /Users/smonasco/spartan/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.24.0
[13:34:09] I/update - geckodriver: geckodriver-v0.24.0 up to date
Admins-MacBook-Pro:bin smonasco$ pwd
/Users/smonasco/spartan/node_modules/protractor/node_modules/webdriver-manager/bin
Admins-MacBook-Pro:bin smonasco$ 
cnishina commented 5 years ago

Sad face. This is new.

cnishina commented 5 years ago

Will fix and make a new release for 12. The good news is that 13 doesn't have this problem.

cnishina commented 5 years ago

I have a proposed fix and if this is reviewed today I will try to get a release out since this is probably breaking things. Have you tried the alpha jar file yet?

mmtmohit commented 5 years ago

Do I have any workarounds ?

cnishina commented 5 years ago

I think the fix is to do another release for webdriver-manager. This will be released tomorrow. Stay tuned.

yiyi920 commented 5 years ago

i am having the same issue..

clymerrm commented 5 years ago

@yiyi920 See https://github.com/angular/protractor/issues/5224. Resolved a few different ways for temporary workarounds.

yiyi920 commented 5 years ago

thanks @clymerrm , i think the driver is up and running if i forced it to use the older version. but when i run [protractor conf.js] it error out: E/launcher - SessionNotCreatedError: Unable to create new service: GeckoDriverService E/launcher - Process exited with error code 199

i am not sure if that is related.. i am pretty new to protractor, i still trying to set it up and running for basic stuff.

telangn commented 5 years ago

I tried the following commands

$ webdriver-manager clean

$ webdriver-manager update --standalone --versions.standalone=3.8.0

$ webdriver-manager start --versions.standalone=3.8.0

but I get the following error

root@user-lt:/cc/node_modules/protractor/bin# ./webdriver-manager start --versions.standalone=3.8.0

[17:03:12] I/start - java -Djava.security.egd=file:///dev/./urandom -Dwebdriver.chrome.driver=/cc/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.46 -Dwebdriver.gecko.driver=/cc/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.24.0 -jar /cc/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.8.0.jar -port 4444

**[17:03:12] I/start - seleniumProcess.pid: undefined

[17:03:12] W/start - Selenium Standalone server encountered an error: Error: spawn java ENOENT**

Any Ideas?

clymerrm commented 5 years ago

@telangn Have you tried a newer version of Selenium Server? 3.8.0 is from 2017.

telangn commented 5 years ago

@clymerrm I just found that although I am manually seeing this issue I described, if I run my spec with the conf having directConnect, everything runs OK....sorta, I'm having issue with either the page loading or clicking on an element, not sure if that has anything to do with server...but perhaps I will try a more current version of the server as you suggested.

cnishina commented 5 years ago

This did not close? Weird.

cnishina commented 5 years ago

Leaving this open. If you are encountering this issue, please update to webdriver-manager 12.1.2. If you are using Protractor to download webdriver-manager, simply remove the node_modules directory and reinstall or do a npm install -f.

cnishina commented 5 years ago

@telangn the reason why directConnect works here is that it does not use the jar file to start the selenium server and just goes straight to the browser driver binary.

cbodavula commented 5 years ago

I am facing the same problem too

prashanthparsi commented 5 years ago

Is this issue fixed? we are still having the same issue web driver manager version - 13.0

13:45:13 (node:145) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: response status code is not 200 13:45:13 (node:145) [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. [Pipeline] sh 13:45:14 + npmVersion=0.1.0-prerelease.5 13:45:14 + node_modules/webdriver-manager/bin/webdriver-manager start --detach 13:45:14 java -Dwebdriver.chrome.driver=/home/jenkins/workspace/_performance-ui-automation_PR-26/node_modules/webdriver-manager/downloads/chromedriver_73.0.3683.68 -Dwebdriver.gecko.driver=null -jar /home/jenkins/workspace/_performance-ui-automation_PR-26/node_modules/webdriver-manager/downloads/selenium-server-standalone-4.0.0-alpha-1.jar -role node -servlet org.openqa.grid.web.servlet.LifecycleServlet -registerCycle 0 -port 4444 13:45:14 selenium process id: undefined 13:45:14 events.js:183 13:45:14 throw er; // Unhandled 'error' event 13:45:14 ^ 13:45:14
13:45:14 Error: spawn java ENOENT 13:45:14 at _errnoException (util.js:1022:11) 13:45:14 at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19) 13:45:14 at onErrorNT (internal/child_process.js:372:16) 13:45:14 at _combinedTickCallback (internal/process/next_tick.js:138:11) 13:45:14 at process._tickCallback (internal/process/next_tick.js:180:9) 13:45:14 at Function.Module.runMain (module.js:686:11) 13:45:14 at startup (bootstrap_node.js:187:16) 13:45:14 at bootstrap_node

mbijjaragi commented 5 years ago

Is this issue fixed? we are still having the same issue

cnishina commented 5 years ago

This has been resolved. I would verify you have the correct version of webdriver-manager@12.1.4.