angular / protractor

E2E test framework for Angular apps
http://www.protractortest.org
MIT License
8.75k stars 2.31k forks source link

Invalid or corrupt jarfile selenium-server-standalone-4.0.0-alpha-1.zip.jar #5224

Open davidzaque opened 5 years ago

davidzaque commented 5 years ago

When i start the webdriver-manager i take this error, i did not change anything in my project that justified such an error, and I have been using it for more than a year, every day.

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


require('babel-core/register');

const myReporter = require('./Report/MyReporter'); const Jasmine2HtmlReporter = require('protractor-jasmine2-html-reporter'); const failFast = require('jasmine-fail-fast');

module.exports.config = { seleniumAddress: 'http://localhost:4444/wd/hub', framework: 'jasmine2', allScriptsTimeout: 600000, capabilities: { browserName: 'chrome', chromeOptions: { args: ['--test-type', 'no-sandbox'], }, }, onPrepare: () => { browser.manage().window().setSize(1200, 1024); jasmine.getEnv().addReporter(failFast.init()); jasmine.getEnv().addReporter(myReporter); jasmine.getEnv().addReporter(new Jasmine2HtmlReporter({ takeScreenshots: true, takeScreenshotsOnlyOnFailures: true, fixedScreenshotName: false, fileNameDateSuffix: true, cleanDestination: false, savePath: './Report/testReports/' })); } };


- A relevant example test
sborland commented 5 years ago

I'm having this same issue! :(

davidzaque commented 5 years ago

@sborland I solved this in my own way by changing the standalone-response.xml and update-config.json files. But this link can help you in a better way: https://stackoverflow.com/a/55836347

sborland commented 5 years ago

@davidzaque thanks! This work around worked for me.

tejasbhosale commented 5 years ago

@davidzaque I have the same issue. But I don't want to install selenium globally. My angularjs application has protractor in its node module and protractor has it's own dependencies where web driver gets updated to latest. How to install it specifically to protractor and not globally?

cnishina commented 5 years ago

Yup this is a bug. This appears to affect every version of the selenium server.

Here is the bug listed in webdriver-manager https://github.com/angular/webdriver-manager/issues/370

And here is the fix / discussion for the fix: https://github.com/angular/webdriver-manager/pull/371

cnishina commented 5 years ago

I will get a new release out tomorrow.

tomreinartz90 commented 5 years ago

as a temporary solution to this issue you can explicitly set the standalone version when running webdriver. --versions.standalone=3.9.1

ZehraHN commented 5 years ago

While running test-cases over protractor , this solution couldn't helping me out. How to use this workaround with protractor ?

tomreinartz90 commented 5 years ago

i have only tested the solution with our current setup. But when looking at the official docs http://www.protractortest.org/#/

I would run

I hope this helps you in any way.

ZehraHN commented 5 years ago

@tomreinartz90 i had tried. Webdriver starts successfully over port 4444 but getting the error when running protractor conf.js


[15:28:48] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[15:28:50] E/launcher - Cannot define class using reflection
[15:28:50] E/launcher - WebDriverError: Cannot define class using reflection ```
clymerrm commented 5 years ago

@ZehraHN I found that when I used version 3.141.0, i'm no longer running into that issue. Anything in the 3.8 or 3.9 range was causing me to get the reflection error.

ZehraHN commented 5 years ago

Yes works now. Thankss @clymerrm

davidzaque commented 5 years ago

@davidzaque I have the same issue. But I don't want to install selenium globally. My angularjs application has protractor in its node module and protractor has it's own dependencies where web driver gets updated to latest. How to install it specifically to protractor and not globally?

@tejasbhosale i don't use protractor globally. I changed the file: node_modules/protractor/node_modules/webdriver-manager/selenium/standalone-response.xml excluding references related to version 4.0.0-alpha and in the file: /node_modules/protractor/node_modules/webdriver-manager/selenium/update-config.json i made this change:

"standalone": {
        "last": "/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.141.59.jar",
        "all": [
            "/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.141.59.jar"
        ]
    },

After that, I kept these files out of the path node_modules, so they would not be updated, and added the following scripts to package.json:

"scripts": {
        "preinstall": "node_modules/protractor/node_modules/webdriver-manager/bin/webdriver-manager clean",
        "postinstall": "cp standalone-response.xml ./node_modules/protractor/node_modules/webdriver-manager/selenium/ & cp update-config.json ./node_modules/protractor/node_modules/webdriver-manager/selenium/ & node_modules/protractor/node_modules/webdriver-manager/bin/webdriver-manager update --versions.standalone=3.141.59",
        "start": "webdriver-manager start"
    },

I know, it was too much maneuvering to solve the problem, but it was how I managed to solve it before any other solution they had posted.

sharigitpersonal commented 5 years ago

Faced the same issue as npm install is downloading a corrupt jar "selenium-server-standalone-4.0.0-alpha-1.zip.jar" .

Tried installing npm again.

It doesn't have selenium directory itself under webdriver-manager !

Files under webdriver-manager: total 64 -rw-r--r-- 1 root root 1205 Oct 26 1985 gulpfile.js -rw-r--r-- 1 root root 547 Oct 26 1985 config.json -rw-r--r-- 1 root root 2455 Oct 26 1985 README.md -rw-r--r-- 1 root root 1078 Oct 26 1985 LICENSE -rw-r--r-- 1 root root 2699 Oct 26 1985 CONTRIBUTING.md -rw-r--r-- 1 root root 21636 Oct 26 1985 CHANGELOG.md drwxr-xr-x 2 root root 4096 Apr 25 15:08 bin drwxr-xr-x 3 root root 4096 Apr 25 15:08 built drwxr-xr-x 2 root root 4096 Apr 25 15:08 docs drwxr-xr-x 5 root root 4096 Apr 25 15:08 node_modules -rw-r--r-- 1 root root 3650 Apr 25 15:08 package.json

cnishina commented 5 years ago

Done with https://github.com/cnishina/webdriver-manager/commit/7dc17ef36e93f71bc63475612e343ffb84efec0f

Also we are not downloading alpha versions since we were previously not downloading beta versions. 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. Leaving this open for visibility.

tejasbhosale commented 5 years ago

Done with cnishina/webdriver-manager@7dc17ef

Also we are not downloading alpha versions since we were previously not downloading beta versions. 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. Leaving this open for visibility.

@cnishina Thanks for your prompt response on this issue. But my build at Jenkins still failing with same error. Is there anything I can do?

cnishina commented 5 years ago

@tejasbhosale Are you caching your node modules directory or workspace? You could clean up your Jenkins workspace and try again. I did a clean install and verified that you should get webdriver-manager@12.1.2 with Protractor 5.4.2 because of https://github.com/angular/protractor/blob/5.4.2/package.json#L29. Could you have a lock file that is set to 12.1.1?

tejasbhosale commented 5 years ago

@cnishina Thanks for responding. I suspect similar but clearing workspace didn't work for me. I am going to research more in jenkins config. But good news is it worked on my local env so it must be jenkins. And I checked my project's pakcage.json it is using this version
"protractor": "^5.2.0" Is that fine? is it still gonna get webdriver 12.1.2?

DebashishSamanta commented 5 years ago

The below mentioned solution worked for me:

Navigate to : Step 1: C:\Users\\AppData\Roaming\npm\node_modules Delete the below mentioned folders

Step 2: Reinstall Protractor Globally npm install -g protractor

Step 3: Re run Webdriver-manager update

Step 4: Webdriver-manager start will not throw any errors

mstssk commented 5 years ago

I had same issue. It's resolved with updating Protractor from 5.4.1 to 5.4.2. πŸ‘ https://github.com/angular/protractor/issues/5224#issuecomment-486873791

davidzaque commented 5 years ago

Hello @cnishina , i made "remove the node_modules directory and reinstall or do a npm install -f" but not solved my problem: See bellow:

β”œβ”€β”¬ protractor@5.4.2 β”‚ β”œβ”€β”€ @types/q@0.0.32 β”‚ β”œβ”€β”€ @types/selenium-webdriver@3.0.16 β”‚ β”œβ”€β”¬ blocking-proxy@1.0.1 β”‚ β”‚ └── minimist@1.2.0 deduped β”‚ β”œβ”€β”¬ browserstack@1.5.2 β”‚ β”‚ └─┬ https-proxy-agent@2.2.1 β”‚ β”‚ β”œβ”€β”¬ agent-base@4.2.1 β”‚ β”‚ β”‚ └─┬ es6-promisify@5.0.0 β”‚ β”‚ β”‚ └── es6-promise@4.2.6 β”‚ β”‚ └─┬ debug@3.2.6 β”‚ β”‚ └── ms@2.1.1 β”‚ β”œβ”€β”€ chalk@1.1.3 deduped β”‚ β”œβ”€β”¬ glob@7.1.3 β”‚ β”‚ β”œβ”€β”€ fs.realpath@1.0.0 β”‚ β”‚ β”œβ”€β”¬ inflight@1.0.6 β”‚ β”‚ β”‚ β”œβ”€β”€ once@1.4.0 deduped β”‚ β”‚ β”‚ └── wrappy@1.0.2 β”‚ β”‚ β”œβ”€β”€ inherits@2.0.3 β”‚ β”‚ β”œβ”€β”¬ minimatch@3.0.4 β”‚ β”‚ β”‚ └── brace-expansion@1.1.11 deduped β”‚ β”‚ β”œβ”€β”¬ once@1.4.0 β”‚ β”‚ β”‚ └── wrappy@1.0.2 deduped β”‚ β”‚ └── path-is-absolute@1.0.1 deduped β”‚ β”œβ”€β”¬ jasmine@2.8.0 β”‚ β”‚ β”œβ”€β”€ exit@0.1.2 β”‚ β”‚ β”œβ”€β”¬ glob@7.1.3 β”‚ β”‚ β”‚ β”œβ”€β”€ fs.realpath@1.0.0 deduped β”‚ β”‚ β”‚ β”œβ”€β”€ inflight@1.0.6 deduped β”‚ β”‚ β”‚ β”œβ”€β”€ inherits@2.0.3 deduped β”‚ β”‚ β”‚ β”œβ”€β”¬ minimatch@3.0.4 β”‚ β”‚ β”‚ β”‚ └── brace-expansion@1.1.11 deduped β”‚ β”‚ β”‚ β”œβ”€β”€ once@1.4.0 deduped β”‚ β”‚ β”‚ └── path-is-absolute@1.0.1 deduped β”‚ β”‚ └── jasmine-core@2.8.0 β”‚ β”œβ”€β”€ jasminewd2@2.2.0 β”‚ β”œβ”€β”¬ optimist@0.6.1 β”‚ β”‚ β”œβ”€β”€ minimist@0.0.10 β”‚ β”‚ └── wordwrap@0.0.2 β”‚ β”œβ”€β”€ q@1.4.1 β”‚ β”œβ”€β”¬ saucelabs@1.5.0 β”‚ β”‚ └── https-proxy-agent@2.2.1 deduped β”‚ β”œβ”€β”¬ selenium-webdriver@3.6.0 β”‚ β”‚ β”œβ”€β”¬ jszip@3.2.1 β”‚ β”‚ β”‚ β”œβ”€β”¬ lie@3.3.0 β”‚ β”‚ β”‚ β”‚ └── immediate@3.0.6 β”‚ β”‚ β”‚ β”œβ”€β”€ pako@1.0.10 β”‚ β”‚ β”‚ β”œβ”€β”¬ readable-stream@2.3.6 β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ core-util-is@1.0.2 β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ inherits@2.0.3 deduped β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ isarray@1.0.0 β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ process-nextick-args@2.0.0 β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ safe-buffer@5.1.2 deduped β”‚ β”‚ β”‚ β”‚ β”œβ”€β”¬ string_decoder@1.1.1 β”‚ β”‚ β”‚ β”‚ β”‚ └── safe-buffer@5.1.2 deduped β”‚ β”‚ β”‚ β”‚ └── util-deprecate@1.0.2 β”‚ β”‚ β”‚ └── set-immediate-shim@1.0.1 β”‚ β”‚ β”œβ”€β”€ rimraf@2.6.3 deduped β”‚ β”‚ β”œβ”€β”¬ tmp@0.0.30 β”‚ β”‚ β”‚ └── os-tmpdir@1.0.2 deduped β”‚ β”‚ └── xml2js@0.4.19 deduped β”‚ β”œβ”€β”¬ source-map-support@0.4.18 β”‚ β”‚ └── source-map@0.5.7 deduped β”‚ β”œβ”€β”¬ webdriver-js-extender@2.1.0 β”‚ β”‚ β”œβ”€β”€ @types/selenium-webdriver@3.0.16 deduped β”‚ β”‚ └── selenium-webdriver@3.6.0 deduped β”‚ └─┬ webdriver-manager@12.1.1 β”‚ β”œβ”€β”€ adm-zip@0.4.13 β”‚ β”œβ”€β”€ chalk@1.1.3 deduped β”‚ β”œβ”€β”¬ del@2.2.2 β”‚ β”‚ β”œβ”€β”¬ globby@5.0.0 β”‚ β”‚ β”‚ β”œβ”€β”¬ array-union@1.0.2 β”‚ β”‚ β”‚ β”‚ └── array-uniq@1.0.3 β”‚ β”‚ β”‚ β”œβ”€β”€ arrify@1.0.1 β”‚ β”‚ β”‚ β”œβ”€β”¬ glob@7.1.3 β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ fs.realpath@1.0.0 deduped β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ inflight@1.0.6 deduped β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ inherits@2.0.3 deduped β”‚ β”‚ β”‚ β”‚ β”œβ”€β”¬ minimatch@3.0.4 β”‚ β”‚ β”‚ β”‚ β”‚ └── brace-expansion@1.1.11 deduped β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ once@1.4.0 deduped β”‚ β”‚ β”‚ β”‚ └── path-is-absolute@1.0.1 deduped β”‚ β”‚ β”‚ β”œβ”€β”€ object-assign@4.1.1 deduped β”‚ β”‚ β”‚ β”œβ”€β”€ pify@2.3.0 deduped β”‚ β”‚ β”‚ └── pinkie-promise@2.0.1 deduped β”‚ β”‚ β”œβ”€β”€ is-path-cwd@1.0.0 β”‚ β”‚ β”œβ”€β”¬ is-path-in-cwd@1.0.1 β”‚ β”‚ β”‚ └─┬ is-path-inside@1.0.1 β”‚ β”‚ β”‚ └── path-is-inside@1.0.2 β”‚ β”‚ β”œβ”€β”€ object-assign@4.1.1 deduped β”‚ β”‚ β”œβ”€β”€ pify@2.3.0 β”‚ β”‚ β”œβ”€β”¬ pinkie-promise@2.0.1 β”‚ β”‚ β”‚ └── pinkie@2.0.4 β”‚ β”‚ └── rimraf@2.6.3 deduped β”‚ β”œβ”€β”€ glob@7.1.3 deduped β”‚ β”œβ”€β”€ ini@1.3.5 β”‚ β”œβ”€β”€ minimist@1.2.0 deduped β”‚ β”œβ”€β”€ q@1.4.1 deduped β”‚ β”œβ”€β”¬ request@2.88.0 β”‚ β”‚ β”œβ”€β”€ aws-sign2@0.7.0 β”‚ β”‚ β”œβ”€β”€ aws4@1.8.0 β”‚ β”‚ β”œβ”€β”€ caseless@0.12.0 β”‚ β”‚ β”œβ”€β”¬ combined-stream@1.0.7 β”‚ β”‚ β”‚ └── delayed-stream@1.0.0 β”‚ β”‚ β”œβ”€β”€ extend@3.0.2 β”‚ β”‚ β”œβ”€β”€ forever-agent@0.6.1 β”‚ β”‚ β”œβ”€β”¬ form-data@2.3.3 β”‚ β”‚ β”‚ β”œβ”€β”€ asynckit@0.4.0 β”‚ β”‚ β”‚ β”œβ”€β”€ combined-stream@1.0.7 deduped β”‚ β”‚ β”‚ └── mime-types@2.1.24 deduped β”‚ β”‚ β”œβ”€β”¬ har-validator@5.1.3 β”‚ β”‚ β”‚ β”œβ”€β”¬ ajv@6.10.0 β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ fast-deep-equal@2.0.1 β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ fast-json-stable-stringify@2.0.0 β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ json-schema-traverse@0.4.1 β”‚ β”‚ β”‚ β”‚ └─┬ uri-js@4.2.2 β”‚ β”‚ β”‚ β”‚ └── punycode@2.1.1 β”‚ β”‚ β”‚ └── har-schema@2.0.0 β”‚ β”‚ β”œβ”€β”¬ http-signature@1.2.0 β”‚ β”‚ β”‚ β”œβ”€β”€ assert-plus@1.0.0 β”‚ β”‚ β”‚ β”œβ”€β”¬ jsprim@1.4.1 β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ assert-plus@1.0.0 deduped β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ extsprintf@1.3.0 β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ json-schema@0.2.3 β”‚ β”‚ β”‚ β”‚ └─┬ verror@1.10.0 β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ assert-plus@1.0.0 deduped β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ core-util-is@1.0.2 deduped β”‚ β”‚ β”‚ β”‚ └── extsprintf@1.3.0 deduped β”‚ β”‚ β”‚ └─┬ sshpk@1.16.1 β”‚ β”‚ β”‚ β”œβ”€β”¬ asn1@0.2.4 β”‚ β”‚ β”‚ β”‚ └── safer-buffer@2.1.2 deduped β”‚ β”‚ β”‚ β”œβ”€β”€ assert-plus@1.0.0 deduped β”‚ β”‚ β”‚ β”œβ”€β”¬ bcrypt-pbkdf@1.0.2 β”‚ β”‚ β”‚ β”‚ └── tweetnacl@0.14.5 deduped β”‚ β”‚ β”‚ β”œβ”€β”¬ dashdash@1.14.1 β”‚ β”‚ β”‚ β”‚ └── assert-plus@1.0.0 deduped β”‚ β”‚ β”‚ β”œβ”€β”¬ ecc-jsbn@0.1.2 β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ jsbn@0.1.1 deduped β”‚ β”‚ β”‚ β”‚ └── safer-buffer@2.1.2 deduped β”‚ β”‚ β”‚ β”œβ”€β”¬ getpass@0.1.7 β”‚ β”‚ β”‚ β”‚ └── assert-plus@1.0.0 deduped β”‚ β”‚ β”‚ β”œβ”€β”€ jsbn@0.1.1 β”‚ β”‚ β”‚ β”œβ”€β”€ safer-buffer@2.1.2 deduped β”‚ β”‚ β”‚ └── tweetnacl@0.14.5 β”‚ β”‚ β”œβ”€β”€ is-typedarray@1.0.0 β”‚ β”‚ β”œβ”€β”€ isstream@0.1.2 β”‚ β”‚ β”œβ”€β”€ json-stringify-safe@5.0.1 β”‚ β”‚ β”œβ”€β”¬ mime-types@2.1.24 β”‚ β”‚ β”‚ └── mime-db@1.40.0 β”‚ β”‚ β”œβ”€β”€ oauth-sign@0.9.0 β”‚ β”‚ β”œβ”€β”€ performance-now@2.1.0 β”‚ β”‚ β”œβ”€β”€ qs@6.5.2 β”‚ β”‚ β”œβ”€β”€ safe-buffer@5.1.2 deduped β”‚ β”‚ β”œβ”€β”¬ tough-cookie@2.4.3 β”‚ β”‚ β”‚ β”œβ”€β”€ psl@1.1.31 β”‚ β”‚ β”‚ └── punycode@1.4.1 β”‚ β”‚ β”œβ”€β”¬ tunnel-agent@0.6.0 β”‚ β”‚ β”‚ └── safe-buffer@5.1.2 deduped β”‚ β”‚ └── uuid@3.3.2 β”‚ β”œβ”€β”¬ rimraf@2.6.3 β”‚ β”‚ └─┬ glob@7.1.3 β”‚ β”‚ β”œβ”€β”€ fs.realpath@1.0.0 deduped β”‚ β”‚ β”œβ”€β”€ inflight@1.0.6 deduped β”‚ β”‚ β”œβ”€β”€ inherits@2.0.3 deduped β”‚ β”‚ β”œβ”€β”¬ minimatch@3.0.4 β”‚ β”‚ β”‚ └── brace-expansion@1.1.11 deduped β”‚ β”‚ β”œβ”€β”€ once@1.4.0 deduped β”‚ β”‚ └── path-is-absolute@1.0.1 deduped β”‚ β”œβ”€β”€ semver@5.7.0 β”‚ └─┬ xml2js@0.4.19 β”‚ β”œβ”€β”€ sax@1.2.4 β”‚ └── xmlbuilder@9.0.7

But, i put in my package.json the dependencies: "webdriver-manager": "^12.1.2" And fixed the problem. @cnishina Thanks for your prompt response on this issue.

tiedt commented 5 years ago

Eu tive o mesmo problema. Ele Γ© resolvido com a atualização do Protractor de 5.4.1 para 5.4.2.πŸ‘ # 5224 (comentΓ‘rio)

Thanks!!!!

cnishina commented 5 years ago

For StackOverflow, I tried to find a post to answer. I ended up creating a question and answering it:

https://stackoverflow.com/questions/55869815/error-invalid-or-corrupt-jarfile-node-modules-protractor-node-modules-webdriv

I have a quick explanation about what webdriver-manager update is doing and why it happened. Could we upvote for visibility?

mathpunk commented 5 years ago

Maybe I don't understand how to define versions? I updated my package.json to include "protractor": "^5.4.2", but after removing node_modules and reinstalling I see node_modules/protractor/package.json has "webdriver-manager": "^12.0.6" (and the problem of downloading a zip.jar).

Kurt29 commented 5 years ago

Maybe I don't understand how to define versions? I updated my package.json to include "protractor": "^5.4.2", but after removing node_modules and reinstalling I see node_modules/protractor/package.json has "webdriver-manager": "^12.0.6" (and the problem of downloading a zip.jar).

Do you have protractor installed globally as well?

mathpunk commented 5 years ago

No, I use ./node_modules/protractor/bin/protractor, and I see that which protractor turns up nothing.

Kurt29 commented 5 years ago

when you run webdriver-manager version you get version 12.0.6 as well?

I mean the package.json wasn't changed for protractor 5.4.2, just the webdriver-manager is an updated version

mathpunk commented 5 years ago

I do not have it installed globally. I remember when I started this project it took me some time to discover it's the webdriver inside protractor that needs to be updated, with ./node_modules/protractor/bin/webdriver-manager update. When I check that version:

$ ./node_modules/protractor/bin/webdriver-manager version
[16:29:49] I/version - webdriver-manager 12.1.1

So, that seems better right? However,

$ ./node_modules/protractor/bin/webdriver-manager update
[16:31:28] I/file_manager - creating folder /home/man/logicgate/dev/logicgate/platform/client/node_modules/protractor/node_modules/webdriver-manager/selenium
[16:31:28] I/config_source - curl -o/home/man/logicgate/dev/logicgate/platform/client/node_modules/protractor/node_modules/webdriver-manager/selenium/standalone-response.xml https://selenium-release.storage.googleapis.com/
[16:31:28] I/config_source - curl -o/home/man/logicgate/dev/logicgate/platform/client/node_modules/protractor/node_modules/webdriver-manager/selenium/chrome-response.xml https://chromedriver.storage.googleapis.com/
[16:31:28] I/config_source - curl -o/home/man/logicgate/dev/logicgate/platform/client/node_modules/protractor/node_modules/webdriver-manager/selenium/gecko-response.json https://api.github.com/repos/mozilla/geckodriver/releases
[16:31:29] I/downloader - curl -o/home/man/logicgate/dev/logicgate/platform/client/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.46.zip https://chromedriver.storage.googleapis.com/2.46/chromedriver_linux64.zip
[16:31:29] I/downloader - curl -o/home/man/logicgate/dev/logicgate/platform/client/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
...

i.e., alpha zip!, leading to the corrupt jar error on startup.

cnishina commented 5 years ago

So you should be on the latest. The latest version is 12.1.4. Previous versions of 12 won't work because the file it is downloading changed. Please review the above for instructions to upgrade.

mathpunk commented 5 years ago

I did upgrade. Let me try explaining again, because it's very confusing: there are two different definitions of webdriver-manager in play.

The package.json in my project has "protractor": "^5.4.2". I have never explicitly had "webdriver-manager" included. When I have run the command to update, which is what pulls in the selenium package, I have run ./node_modules/protractor/bin/webdriver-manager update -- interacting with the webdriver build that is inside protractor's bin directory. This is kludgy, and requires doing the update after I've installed node_modules, but it worked, up until the breaking change.

Putting "webdriver-manager": "^12.1.4" in my package.json has no effect on what version protractor uses. I can follow these steps:

to prove that an updated protractor/bin/webdriver-manager will get the right version. But, I'm not looking forward to working "Now edit the post-install protractor package.json" into our CI pipeline. Is there a different way to force protractor to use the latest webdriver-manager?

jvitorino commented 5 years ago

Can you update your package.json and add webdriver-manager to your devDependencies? That fixed the issue for me.

mathpunk commented 5 years ago

In the experiment above, both protractor and webdriver-manager (when added) were in devDependencies.

cnishina commented 5 years ago

Have you verified that your version is 12.1.4 when you run ./node_modules/protractor/bin/webdriver-manager update? There are two ways to do this:

  1. Go to node_modules/protractor/node_modules/webdriver-manager/package.json and check the version number
  2. Run node_modules/.bin/webdriver-manager version

    Protractor (by default) should download the ^12.0.4 version which means it should get 12.1.4. If you are still getting a .zip.jar file that means you have an old version and you need to upgrade this.

I do not recommend adding it to your devDependencies. This is why:

Let's say if Protractor upgrades to version webdriver-manager@13 and you still have devDependencies set to webdriver-manager@^12. When you call ./node_modules/protractor/bin/webdriver-manager update, you are not guaranteed that you will run version 12 or 13. When Protractor calls for the files it will hopefully use version 13. If your files were downloaded with 12, then these files will not exist when Protractor requires them.

mathpunk commented 5 years ago
    "webdriver-manager": "bin/webdriver-manager"
    "@types/selenium-webdriver": "^3.0.0",
    "selenium-webdriver": "3.6.0",
    "webdriver-js-extender": "2.1.0",
    "webdriver-manager": "^12.0.6"

Protractor (by default) should download the ^12.0.4 version which means it should get 12.1.4.

Makes sense. And yet:

$  ./node_modules/protractor/bin/webdriver-manager version
`[11:19:58] I/version - webdriver-manager 12.1.1

Bewildering.

simonua commented 5 years ago

@mathpunk, is there a package-lock.json file at play here that may have it locked to 12.1.1?

simonua commented 5 years ago

We have an interesting scenario in our organization as we have our own automation-related npm package (on an internal registry) that abstracts automation from our SPAs and applications. That package uses protractor 5.4.2 and does not use a package-lock.json file as we have seen some issues with how npm has deduped dependencies of dependencies, which messed with some of our paths. Anyhow, installing a version of our automation package that has protractor as its dependencies in SPAs and applications that use package-lock.json files still results in webdriver-manager 12.1.1 being used. npm i would install that as a first-class citizen, which we don't want because 12.1.4 and 12.1.1 would still be present. npm update --depth 9999 webdriver-manager does not work as I would expect, which would be updating from 12.1.1 to 12.1.4. Short of manually changing package-lock.json in every consuming application of our automation package or regenerating the file fresh, which we don't want because it updates a lot of packages we want to keep where they are to prevent regression test work, I'm not sure what to do.

@cnishina, thanks for all the work you do on Protractor. Would you support a PR of a branch that is branched off 5.4.2, which would only update webdriver-manager to 12.1.4?

mathpunk commented 5 years ago

@simonua You cracked it! Removed package-lock.json, removed node_modules, installed, got webdriver-manager 12.1.4. I don't understand why versions are defined in two different places in this ecosystem, but hey, problem solved~

simonua commented 5 years ago

Glad that did it. Out of curiosity, if you were to revert your changes and run npm i webdriver-manager@12.1.4 with that explicit version you want instead, I suspect you would be in good shape. The benefit you'd have is that your other versions remain untouched, which limits regression exposure.

FrancescoBorzi commented 5 years ago

Same issue here

bfunc commented 5 years ago

Just download right file from selenium site https://selenium-release.storage.googleapis.com/index.html?path=4.0/ I took jar file and changed name from .jar to .zip.jar worked ok