protractor: Invalid or corrupt jarfile selenium-server-standalone-4.0.0-alpha-1.zip.jar
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
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 14
- Comments: 40 (10 by maintainers)
I will get a new release out tomorrow.
I’m having this same issue! 😦
@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
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.The below mentioned solution worked for me:
Navigate to : Step 1: C:\Users<Your User>\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
@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.
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
@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 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: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:
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.
@davidzaque thanks! This work around worked for me.
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.@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~
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
as a temporary solution to this issue you can explicitly set the standalone version when running webdriver. –versions.standalone=3.9.1
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