Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
davidzaque opened this issue Apr 24, 2019 · 40 comments
Open

Comments

@davidzaque
Copy link

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


  • Node Version: 8.12
  • Protractor Version: 5.4.2
  • Browser(s): Chrome
  • Operating System and Version Ubuntu 16.04
  • Your protractor configuration file:
'use strict';

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
Copy link

I'm having this same issue! :(

@davidzaque
Copy link
Author

davidzaque commented Apr 24, 2019

@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
Copy link

@davidzaque thanks! This work around worked for me.

@tejasbhosale
Copy link

@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
Copy link
Member

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

Here is the bug listed in webdriver-manager angular/webdriver-manager#370

And here is the fix / discussion for the fix: angular/webdriver-manager#371

@cnishina
Copy link
Member

I will get a new release out tomorrow.

@tomreinartz90
Copy link

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

@ZehraHN
Copy link

ZehraHN commented Apr 25, 2019

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

@tomreinartz90
Copy link

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

I would run

  • webdriver-manager update --versions.standalone=3.9.1
  • webdriver-manager start
  • protractor conf.js

I hope this helps you in any way.

@ZehraHN
Copy link

ZehraHN commented Apr 25, 2019

@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
Copy link

@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
Copy link

ZehraHN commented Apr 25, 2019

Yes works now. Thankss @clymerrm

@davidzaque
Copy link
Author

davidzaque commented Apr 25, 2019

@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
Copy link

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
Copy link
Member

cnishina commented Apr 25, 2019

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.

@tejasbhosale
Copy link

tejasbhosale commented Apr 25, 2019

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
Copy link
Member

@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
Copy link

@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
Copy link

The below mentioned solution worked for me:

  • Uninstall/install Java
  • Setup the Environment variable if newer version of java installed

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

  • protractor
  • webdriver-manager

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
Copy link

mstssk commented Apr 26, 2019

I had same issue.
It's resolved with updating Protractor from 5.4.1 to 5.4.2. 👍
#5224 (comment)

@davidzaque
Copy link
Author

davidzaque commented Apr 26, 2019

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
Copy link

tiedt commented Apr 26, 2019

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
Copy link
Member

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?

@cnishina cnishina removed the P0 label Apr 29, 2019
@mathpunk
Copy link

mathpunk commented May 3, 2019

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
Copy link

Kurt29 commented May 3, 2019

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
Copy link

mathpunk commented May 3, 2019

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

@Kurt29
Copy link

Kurt29 commented May 3, 2019

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
Copy link

mathpunk commented May 3, 2019

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
Copy link
Member

cnishina commented May 6, 2019

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
Copy link

mathpunk commented May 7, 2019

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:

  • npm install in my project directory
  • edit the file in node_modules/protractor/package.json to update webdriver-manager to ^12.1.4.
  • npm install in node_modules/protractor/
  • ./node_modules/protractor/bin/webdriver-manager update

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
Copy link

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

@mathpunk
Copy link

mathpunk commented May 7, 2019

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

@cnishina
Copy link
Member

cnishina commented May 7, 2019

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
Copy link

mathpunk commented May 8, 2019

  • my-project/package.json: "protractor": "^5.4.2" in devDependencies , webdriver-manager nowhere
  • $ rm -rf node_modules
  • npm install
  • cat node_modules/protractor/package.json|grep webdr
    "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
Copy link
Contributor

simonua commented May 8, 2019

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

@simonua
Copy link
Contributor

simonua commented May 8, 2019

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
Copy link

mathpunk commented May 8, 2019

@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
Copy link
Contributor

simonua commented May 8, 2019

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
Copy link

Same issue here

@bfunc
Copy link

bfunc commented Sep 25, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests