问题
I have a protractor project that It starts and runs specs as I expect but after almost 2 minutes it starts getting this error on rest of test cases. I don't know why. It had run perfectly one week ago but now I faced that error and it doesn't give (or I can't see) any detail about error.
"Error: Failed: WebDriverError at stack (Z:\\dev\\lmw\node_modules\\protractor\node_modules\\jasmine-core\\lib\\jasmine-core\\jasmine.js:2200:17) at buildExpectationResult (Z:\\dev\\lmw\node_modules\\protractor\node_modules\\jasmine-core\\lib\\jasmine-core\\jasmine.js:2170:14) at Spec.expectationResultFactory (Z:\\dev\\lmw\node_modules\\protractor\node_modules\\jasmine-core\\lib\\jasmine-core\\jasmine.js:777:18) at Spec.addExpectationResult (Z:\\dev\\lmw\node_modules\\protractor\node_modules\\jasmine-core\\lib\\jasmine-core\\jasmine.js:450:34) at Env.fail (Z:\\dev\\lmw\node_modules\\protractor\node_modules\\jasmine-core\\lib\\jasmine-core\\jasmine.js:1192:25) at Function.next.fail (Z:\\dev\\lmw\node_modules\\protractor\node_modules\\jasmine-core\\lib\\jasmine-core\\jasmine.js:4046:19) at Z:\\dev\\lmw\node_modules\\protractor\node_modules\\jasminewd2\\index.js:64:48 at ControlFlow.emit (Z:\\dev\\lmw\node_modules\\protractor\node_modules\\selenium-webdriver\\lib\\events.js:62:21) at ControlFlow.shutdown_ (Z:\\dev\\lmw\node_modules\\protractor\node_modules\\selenium-webdriver\\lib\\promise.js:2565:10) at shutdownTask_.MicroTask (Z:\\dev\\lmw\node_modules\\protractor\node_modules\\selenium-webdriver\\lib\\promise.js:2490:53)"
Information about project: it runs two browser and using chromedriver_2.31.exe.
protractor.conf.js=>
directConnect: false,
splitTestsBetweenCapabilties: true,
multiCapabilities:[
{
shardTestFiles: false,
maxInstances: 1,
maxSessions: 1,
sequential: true,
parallelCapability: true,
browserName: 'chrome',
specs: [
'./tests/login/*.js',
'./tests/header/*.js',
'./tests/my-profile/*.js',
'./tests/nominee/*.js',
'./tests/left-menu/*.js',
'./tests/contact-us/*.js',
'./tests/relations/*.js',
'./tests/coordinator/*.js',
'./tests/sitemap/*.js',
'./tests/landing/*.js',
'./tests/vouchers/*.js',
'./tests/extend/*.js',
'./tests/activity/*.js'
]
},
{
shardTestFiles: false,
maxInstances: 1,
maxSessions: 1,
sequential: true,
parallelCapability: true,
browserName: 'chrome',
specs: [
'./tests/enrollment/*.js',
'./tests/claim-/*.js',
'./tests/transfer/*.js',
'./tests/donate/*.js',
'./tests/buy/*.js',
'./tests/calculator/*.js'
]
}
]
package.json =>
{
"devDependencies": {
"grunt-cli": "^1.2.0",
"grunt-protractor-runner": "^4.0.0",
"jasmine-spec-reporter": "^3.2.0",
"protractor": "^5.0.0",
"jasmine-reporters": "^2.0.0"
}
}
回答1:
if you are using your office laptop ,can you check whether it has any encryption in the system. Few of these encryptions corrupt the node modules , which results in the failure of the test cases.
This is the only reason I could guess since you ran all your test cases earlier
PS : I faced the same issue
来源:https://stackoverflow.com/questions/45729715/protractor-error-failed-webdrivererror