could not find cucumber plugin for protractor test - protractor

i am brand new to protractor and did setup as per the instructions from the protractor website. When i try to run the protractor test with the a cucumber framework i always get "Error: Error: Cannot find module 'cucumber'". Any help on this? below are by configurations.
cucumber-conf.js
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
capabilities: {
browserName:'chrome'
},
framework: 'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
specs: [
'./cucumber/*.feature'
],
cucumberOpts: {
require: ['./cucumber/*.js'],
tags: [],
strict: true,
format: ["pretty"],
dryRun: false,
compiler: []
},
onPrepare: function () {
browser.manage().window().maximize();
}
};
when i run protractor cucumber-conf.js i get below error.
/opt/protractor_tests
➔ protractor cucumber-conf.js
(node:5681) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[12:06:55] I/launcher - Running 1 instances of WebDriver
[12:06:55] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[12:06:57] E/launcher - Error: Error: Cannot find module 'cucumber'
at Function.Module._resolveFilename (module.js:472:15)
at Function.Module._load (module.js:420:25)
at Module.require (module.js:500:17)
at require (internal/module.js:20:19)
at Object.module.exports.load (/opt/protractor_tests/node_modules/protractor-cucumber-framework/lib/cucumberLoader.js:5:12)
at Object.<anonymous> (/opt/protractor_tests/node_modules/protractor-cucumber-framework/index.js:5:48)
at Module._compile (module.js:573:32)
at Object.Module._extensions..js (module.js:582:10)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
[12:06:57] E/launcher - Process exited with error code 100

Related

Failed to open terminal on code-server on alpine linux

The terminal process failed to launch: A native exception occurred during launch (Error relocating /usr/lib/node_modules/code-server/lib/vscode/node_modules/node-pty/build/Release/pty.node: _ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeEPKNS_9CFunctionE: symbol not found).
My user settings value:
{
"go.useLanguageServer": true
}
My terminal logs showed these errors:
[2021-01-14T08:11:39.587Z] info code-server 3.8.0 c4610f7829701aadb045d450013b84491c30580d
[2021-01-14T08:11:39.590Z] info Using user-data-dir ~/.local/share/code-server
[2021-01-14T08:11:39.695Z] info Using config file ~/.config/code-server/config.yaml
[2021-01-14T08:11:39.695Z] info HTTP server listening on http://127.0.0.1:8080
[2021-01-14T08:11:39.696Z] info - Authentication is enabled
[2021-01-14T08:11:39.696Z] info - Using password from ~/.config/code-server/config.yaml
[2021-01-14T08:11:39.696Z] info - Not serving HTTPS
Error: Error relocating /usr/lib/node_modules/code-server/lib/vscode/node_modules/spdlog/build/Release/spdlog.node: _ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeEPKNS_9CFunctionE: symbol not found
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1057:18)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at Module.patchedRequire [as require] (/usr/lib/node_modules/code-server/lib/vscode/node_modules/diagnostic-channel/dist/src/patchRequire.js:14:46)
at require (internal/modules/cjs/helpers.js:74:18)
at bindings (/usr/lib/node_modules/code-server/lib/vscode/node_modules/bindings/bindings.js:112:48)
at Object.<anonymous> (/usr/lib/node_modules/code-server/lib/vscode/node_modules/spdlog/index.js:3:35)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at Module.patchedRequire [as require] (/usr/lib/node_modules/code-server/lib/vscode/node_modules/diagnostic-channel/dist/src/patchRequire.js:14:46)
at require (internal/modules/cjs/helpers.js:74:18)
at t.load (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:17:960)
at e.load (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:13:941)
at o (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:31:189)
at Object.errorback (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:31:313)
at e.triggerErrorback (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:14:306)
at /usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:14:10
at ReadFileContext.callback (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:18:342)
at FSReqCallback.readFileAfterOpen [as oncomplete] (fs.js:261:13) {
phase: 'loading',
moduleId: 'spdlog',
neededBy: [ '===anonymous3===' ]
}
Error: Error relocating /usr/lib/node_modules/code-server/lib/vscode/node_modules/spdlog/build/Release/spdlog.node: _ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeEPKNS_9CFunctionE: symbol not found
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1057:18)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at Module.patchedRequire [as require] (/usr/lib/node_modules/code-server/lib/vscode/node_modules/diagnostic-channel/dist/src/patchRequire.js:14:46)
at require (internal/modules/cjs/helpers.js:74:18)
at bindings (/usr/lib/node_modules/code-server/lib/vscode/node_modules/bindings/bindings.js:112:48)
at Object.<anonymous> (/usr/lib/node_modules/code-server/lib/vscode/node_modules/spdlog/index.js:3:35)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at Module.patchedRequire [as require] (/usr/lib/node_modules/code-server/lib/vscode/node_modules/diagnostic-channel/dist/src/patchRequire.js:14:46)
at require (internal/modules/cjs/helpers.js:74:18)
at t.load (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:17:960)
at e.load (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:13:941)
at o (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:31:189)
at Object.errorback (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:31:313)
at e.triggerErrorback (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:14:306)
at /usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:14:10
at ReadFileContext.callback (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:18:342)
at FSReqCallback.readFileAfterOpen [as oncomplete] (fs.js:261:13) {
phase: 'loading',
moduleId: 'spdlog',
neededBy: [ '===anonymous3===' ]
}
[2021-01-14T08:11:52.407Z] error exthost console {"arguments":"[\"Error: Error relocating /usr/lib/node_modules/code-server/lib/vscode/node_modules/spdlog/build/Release/spdlog.node: _ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeEPKNS_9CFunctionE: symbol not found\\n at Object.Module._extensions..node (internal/modules/cjs/loader.js:1057:18)\\n at Module.load (internal/modules/cjs/loader.js:863:32)\\n at Function.Module._load (internal/modules/cjs/loader.js:708:14)\\n at Function.t._load (/usr/lib/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:1065:961)\\n at Function.i._load (/usr/lib/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:1035:665)\\n at Module.require (internal/modules/cjs/loader.js:887:19)\\n at require (internal/modules/cjs/helpers.js:74:18)\\n at bindings (/usr/lib/node_modules/code-server/lib/vscode/node_modules/bindings/bindings.js:112:48)\\n at Object.<anonymous> (/usr/lib/node_modules/code-server/lib/vscode/node_modules/spdlog/index.js:3:35)\\n at Module._compile (internal/modules/cjs/loader.js:999:30)\\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)\\n at Module.load (internal/modules/cjs/loader.js:863:32)\\n at Function.Module._load (internal/modules/cjs/loader.js:708:14)\\n at Function.t._load (/usr/lib/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:1065:961)\\n at Function.i._load (/usr/lib/node_modules/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:1035:665)\\n at Module.require (internal/modules/cjs/loader.js:887:19)\\n at require (internal/modules/cjs/helpers.js:74:18)\\n at t.load (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:17:960)\\n at e.load (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:13:941)\\n at o (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:31:189)\\n at Object.errorback (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:31:313)\\n at e.triggerErrorback (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:14:306)\\n at /usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:14:10\\n at ReadFileContext.<anonymous> (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:18:342)\\n at ReadFileContext.callback (/usr/lib/node_modules/code-server/lib/vscode/node_modules/graceful-fs/graceful-fs.js:115:16)\\n at FSReqCallback.readFileAfterOpen [as oncomplete] (fs.js:261:13)\"]","token":"cc585d5e-035d-4875-9d18-cdd3e2a29183"}
innerError Error: Cannot find module '../build/Debug/pty.node'
Require stack:
- /usr/lib/node_modules/code-server/lib/vscode/node_modules/node-pty/lib/unixTerminal.js
- /usr/lib/node_modules/code-server/lib/vscode/node_modules/node-pty/lib/index.js
- /usr/lib/node_modules/code-server/lib/vscode/out/bootstrap-amd.js
- /usr/lib/node_modules/code-server/lib/vscode/out/vs/server/fork.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
at Function.Module._load (internal/modules/cjs/loader.js:667:27)
at Module.require (internal/modules/cjs/loader.js:887:19)
at Module.patchedRequire [as require] (/usr/lib/node_modules/code-server/lib/vscode/node_modules/diagnostic-channel/dist/src/patchRequire.js:14:46)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/usr/lib/node_modules/code-server/lib/vscode/node_modules/node-pty/lib/unixTerminal.js:31:15)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at Module.patchedRequire [as require] (/usr/lib/node_modules/code-server/lib/vscode/node_modules/diagnostic-channel/dist/src/patchRequire.js:14:46)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/usr/lib/node_modules/code-server/lib/vscode/node_modules/node-pty/lib/index.js:14:20)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at Module.patchedRequire [as require] (/usr/lib/node_modules/code-server/lib/vscode/node_modules/diagnostic-channel/dist/src/patchRequire.js:14:46)
at require (internal/modules/cjs/helpers.js:74:18)
at t.load (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:17:960)
at e.load (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:13:941)
at o (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:31:189)
at Object.errorback (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:31:313)
at e.triggerErrorback (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:14:306)
at /usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:14:10
at ReadFileContext.callback (/usr/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:18:342)
at FSReqCallback.readFileAfterOpen [as oncomplete] (fs.js:261:13) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/usr/lib/node_modules/code-server/lib/vscode/node_modules/node-pty/lib/unixTerminal.js',
'/usr/lib/node_modules/code-server/lib/vscode/node_modules/node-pty/lib/index.js',
'/usr/lib/node_modules/code-server/lib/vscode/out/bootstrap-amd.js',
'/usr/lib/node_modules/code-server/lib/vscode/out/vs/server/fork.js'
]
}
PROTOCOL CORRUPTION, LAST SAW MSG 0 AND HAVE NOW RECEIVED MSG 38
I solved this entirely by accident, by being accommodating to external developers. The error is misleading, implying the nonexistence of needed libraries, but it assumes bash is installed.
Either install bash or add a terminal profile for ash in Settings, then use it as your terminal shell.

No default proposals for protractor browser.actions() and throws TypeError: browser.actions(...).dragAndDrop(...).perfrom is not a function

I am using protractor Version 5.4.2 in window 10 OS, to script I use Eclipse Java EE IDE for Web Developers.Version: Photon Release (4.8.0) with Tern plugin.
I get no default proposals for browser.actions(). Also my execution is fails due to below error .
Message:
Failed: browser.actions(...).dragAndDrop(...).perfrom is not a function
Stack:
TypeError: browser.actions(...).dragAndDrop(...).perfrom is not a function
at UserContext. (F:\Learning\Repositories\protractor-sam-test-scripts\EclipsePro\src\com\sam\scriptjs\draganddrop.spec.js:15:45)
at C:\Users\sam\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd2\index.js:112:25
at new ManagedPromise (C:\Users\sam\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:1077:7)
at ControlFlow.promise (C:\Users\sam\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2505:12)
at schedulerExecute (C:\Users\sam\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd2\index.js:95:18)
at TaskQueue.execute_ (C:\Users\sam\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:3084:14)
at TaskQueue.executeNext_ (C:\Users\sam\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:3067:27)
at asyncRun (C:\Users\sam\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2974:25)
at C:\Users\sam\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:668:7
at
From: Task: Run it("Drag and drop") in control flow
at UserContext. (C:\Users\sam\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd2\index.js:94:19)
From asynchronous test:
Error
at Suite. (F:\Learning\Repositories\protractor-sam-test-scripts\EclipsePro\src\com\sam\scriptjs\draganddrop.spec.js:11:4)
at Object. (F:\Learning\Repositories\protractor-sam-test-scripts\EclipsePro\src\com\sam\scriptjs\draganddrop.spec.js:2:1)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
I already updated my protractor and webdriver-manager versions , but the error still persists.
Please see my spec.js
//draganddrop.spec.js
describe('drag and drop trial', function() {
//Each single it function is a test script
it('first spec', function() {
browser.driver.get('https://codef0rmer.github.io/angular-dragdrop/#!/');
expect(browser.getTitle()).toEqual('Drag and Drop for AngularJS');
});
it('Drag and drop', function() {
var from=element(by.model('list1'));
var to=element(by.model('list2'));
//drag and drop source to Destination
browser.actions().dragAndDrop(from,to).perfrom();
browser.sleep(7500);
});
})
Try with this code:
//1st way: dragging one element to another
browser.actions().mouseDown(from).mouseMove(to).mouseUp().perform();
There are 3 ways of implementing dragAndDrop in which I found this approach in protractor the most fitting.

Error: listen EADDRINUSE when using nodemon with babel 7

nodemon -v: 1.18.6
node -v: v11.2.0
Command: nodemon --exec babel-node lib/server.js
My app starts ok with the above command. When I change the source code, I expect the nodemon restart automatically. But I got the error Error: listen EADDRINUSE: address already in use :::3000.
Error details
[nodemon] starting `babel-node lib/server.js`
events.js:167
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE: address already in use :::3000
at Server.setupListenHandle [as _listen2] (net.js:1294:14)
at listenInCluster (net.js:1342:12)
at Server.listen (net.js:1429:7)
at Function.listen (/Users/longntran/Desktop/learning/pangara-web/node_modules/express/lib/application.js:618:24)
at Object.listen (/Users/longntran/Desktop/learning/pangara-web/lib/server.js:12:5)
at Module._compile (internal/modules/cjs/loader.js:722:30)
at Module._compile (/Users/longntran/Desktop/learning/pangara-web/node_modules/pirates/lib/index.js:83:24)
at Module._extensions..js (internal/modules/cjs/loader.js:733:10)
at Object.newLoader [as .js] (/Users/longntran/Desktop/learning/pangara-web/node_modules/pirates/lib/index.js:88:7)
at Module.load (internal/modules/cjs/loader.js:620:32)
Emitted 'error' event at:
at emitErrorNT (net.js:1321:8)
at internalTickCallback (internal/process/next_tick.js:72:19)
at process._tickCallback (internal/process/next_tick.js:47:5)
at Function.Module.runMain (internal/modules/cjs/loader.js:778:11)
at Object.<anonymous> (/Users/longntran/Desktop/learning/pangara-web/node_modules/#babel/node/lib/_babel-node.js:224:23)
at Module._compile (internal/modules/cjs/loader.js:722:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
Dependencies
"dependencies": {
"ejs": "^2.6.1",
"express": "^4.16.4",
"react": "^16.6.3",
"react-dom": "^16.6.3"
},
"devDependencies": {
"#babel/core": "^7.1.6",
"#babel/preset-env": "^7.1.6",
"#babel/preset-react": "^7.0.0",
"#babel/node": "^7.0.0",
"babel-jest": "^23.6.0",
"babel-loader": "^8.0.4",
"jest": "^23.6.0",
"nodemon": "^1.18.6",
"pm2": "^3.2.2",
"prettier": "1.15.2",
"regenerator-runtime": "^0.13.1",
"webpack": "^4.26.1",
"webpack-cli": "^3.1.2"
}
Note
I am using nodemon with babel 7. Please help me. Thank you guys
I found an interesting fix in this thread around adding a delay and kill process commands to your scripts.
"events": {
"restart": "fuser -k 5000/tcp ; fuser -k 3050/tcp" // change to whatever ports you're using.
}
And to add a delay to the nodemon command:
--delay 1500ms
https://github.com/remy/nodemon/issues/1316#issuecomment-387367160
I also noticed that if I hit save twice in my code editor in rapid succession, I get this error. However if I only hit save once, I see no problem.
I've found that completing a graceful server shutdown on any interruption allows nodemon to restart successfully (using Express):
// Run server
const PORT = process.env.PORT || 3000
const server = app.listen(PORT, () => {
console.log('[server] Started server');
});
// Graceful shutdown of server
process.on('SIGINT', () => {
console.log('\n[server] Shutting down...');
server.close();
process.exit();
});
process.on('SIGTERM', () => {
console.log('\n[server] Shutting down...');
server.close();
process.exit();
});
process.on('uncaughtException', () => {
console.log('\n[server] Shutting down...');
server.close();
process.exit();
});

Getting error "Failed: Fn is not a function" when try to automate e2e for a login page

I am trying to automate and rum a simple register form but i am getting error saying "Failed: Fn is not a function". Below is my code
describe('Locator testing by model', function(){
it('automate user register form', function(){
browser.get('http://www.way2automation.com/angularjs-protractor/registeration/#/login');
element(by.model('Auth.user.name')).sendKeys('angular');
element(by.model('Auth.user.password')).sendKeys('password');
element(by.model('model[options.key]')).sendKeys('zafaque');
element(by.buttonText('Login')).click();
browser.wait(3000);
});
});
below is the error detail
1) Locator testing by model automate user register form
Message:
Failed: fn is not a function
Stack:
TypeError: fn is not a function
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:716:14
at TaskQueue.execute_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2913:14)
at TaskQueue.executeNext_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2896:21)
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2820:25
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:639:7
at process._tickCallback (node.js:369:9)
From: Task: <anonymous>
at pollCondition (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2359:16)
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2355:9
at new ManagedPromise (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1082:7)
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2354:14
at TaskQueue.execute_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2913:14)
at TaskQueue.executeNext_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2896:21)
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2775:27
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:639:7
at process._tickCallback (node.js:369:9)
From: Task: <anonymous wait>
at ControlFlow.wait (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2352:17)
at Driver.wait (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:712:29)
at ProtractorBrowser.to.(anonymous function) [as wait] (/usr/local/lib/node_modules/protractor/built/browser.js:60:29)
at Object.<anonymous> (/Users/zafaque/WebstormProjects/autotation/udemyProject/loginTest.js:12:17)
at /usr/local/lib/node_modules/protractor/node_modules/jasminewd2/index.js:94:23
at new ManagedPromise (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1082:7)
at controlFlowExecute (/usr/local/lib/node_modules/protractor/node_modules/jasminewd2/index.js:80:18)
at TaskQueue.execute_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2913:14)
at TaskQueue.executeNext_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2896:21)
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2820:25
From: Task: Run it("automate user register form") in control flow
at Object.<anonymous> (/usr/local/lib/node_modules/protractor/node_modules/jasminewd2/index.js:79:14)
From asynchronous test:
Error
at Suite.<anonymous> (/Users/zafaque/WebstormProjects/autotation/udemyProject/loginTest.js:6:5)
at Object.<anonymous> (/Users/zafaque/WebstormProjects/autotation/udemyProject/loginTest.js:4:1)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
You are using browser.wait() incorrectly. Refer the official documentation for correct usage here
browser.wait() accepts params in the below order
first argument is a condition which can be a function or a
webdriver.promise.Promise or a Expected Condition Second Argument is
the timeout
But you are passing timeout as the first argument. Incase you just wait a conditionless wait - Just use browser.sleep(3000)

protractor sets error without opening browser

i download a new ionic project and i am trying to test the header contains these elements ""
my config file is
exports.config = {
framework: 'jasmine2',
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['../www/head.spec.js'],
multiCapabilities: [
{
browserName: 'chrome'
}]
}
named this as e2e.js
my test case file is
describe('header Module', function(){
var header;
beforeEach(function() {
header = element(by.css('title'));
});
it('should check title text',function(){
expect(header.getText()).toContain('Ionic Blank Starter');
});
});
and i named this as head.spec.js
my issue is that i could see the browser opened and my protractor sends an error msg
empresss-Mac-mini:myApp admin$ protractor test/e2e.js
Using the selenium server at http://localhost:4444/wd/hub
[launcher] Running 1 instances of WebDriver
/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:172
callback(new Error(message));
^
Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444
at ClientRequest. (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:172:16)
at emitOne (events.js:77:13)
at ClientRequest.emit (events.js:169:7)
at Socket.socketErrorListener (_http_client.js:259:9)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at emitErrorNT (net.js:1253:8)
at doNTCallback2 (node.js:439:9)
at process.tickCallback (node.js:353:17)
From: Task: WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:157:22)
at Function.webdriver.WebDriver.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:131:30)
at [object Object].Builder.build (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/builder.js:445:22)
at [object Object].DriverProvider.getNewDriver (/usr/local/lib/node_modules/protractor/lib/driverProviders/driverProvider.js:38:7)
at [object Object].Runner.createBrowser (/usr/local/lib/node_modules/protractor/lib/runner.js:182:37)
at /usr/local/lib/node_modules/protractor/lib/runner.js:263:21
at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:797:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:826:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:759:13)
at /usr/local/lib/node_modules/protractor/node_modules/q/q.js:525:49
[launcher] Process exited with error code 1
could someone help to fix this issue
when i try to webdriver-manager update err msg is displayed
empresss-Mac-mini:~ admin$ webdriver-manager update
fs.js:799
return binding.mkdir(pathModule._makeLong(path),
^
Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/protractor/selenium'
at Error (native)
at Object.fs.mkdirSync (fs.js:799:18)
at Object.<anonymous> (/usr/local/lib/node_modules/protractor/bin/webdriver-manager:126:6)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:134:18)
at node.js:961:3
empresss-Mac-mini:~ admin$