last day (14 days later) » 

12:33 PM
1
A: How to click on button with no text in Protractor ?

igniteram1You are not able to click them because both of them have same class & attributes. In these cases you have 2 options: 1) You can directly use nth child concept of CSS. describe ('angularjs homepage', function() { browser.get('http://angular.github.io/peepcode-tunes/public/'); element(by.css('#c...

 
Failures: 1) angularjs homepage encountered a declaration exception Message: TypeError: element(...).get is not a function Stack: TypeError: element(...).get is not a function at Suite.<anonymous> (D:\Protractor\git.js:3:32) at Object.<anonymous> (D:\Protractor\git.js:1:1) at Module._compile (module.js:413:34) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Module.require (module.js:367:17)
1 spec, 1 failure Finished in 0.03 seconds C:\Users\kipatel\AppData\Roaming\npm\node_modules\protractor\node_modules\seleni‌​‌​um-webdriver\lib\pro mise.js:1329 return callbackFn(this.value_); ^ Error: Angular could not be found on the page angular.github.io/peepcode-tunes/public : angu lar never provided resumeBootstrap at
I got this error while running your above code.
 
I missed .all option , I updated my answer. did you try with nth child?
 
C:\Users\kipatel\AppData\Roaming\npm\node_modules\protractor\node_modules\seleni‌​‌​um-webdriver\lib\pr mise.js:1329 return callbackFn(this.value_); ^ Error: Angular could not be found on the page angular.github.io/peepcode-tunes/public : ang lar never provided resumeBootstrap at C:\Users\kipatel\AppData\Roaming\npm\node_modules\protractor\built\protractor.js‌​‌​:679:17 Still i m getting this.. What wrong m i doing ? Can you test on your end and let me know?
nth child is also not working dear
 
which protractor version & jasmine framework r u using?
i checked them with elementExplorer jasmine2 and protractor 4.0.0 they work fine!
 
Protractor version is 3.2.0 and jasmine 2
 
12:33 PM
I thinks you are using older version of Angular, there is as issue already resolved for this - github.com/angular/protractor/issues/3115. try upgrading to new protractor version 4.0.0 or 3.3.0. it would solve your issue. If you still have issue let's move this discussion to chat!
 
how to upgrade ?
I upgrade everything. My error message was shorten just No specs found Finished in 0.002 seconds [17:59:03] E/launcher - "process.on('uncaughtException'" error, see launcher [17:59:03] E/launcher - Process exited with error code 199
 
you specs are missing in you config file
show me your config file
 
yes
you talking about conf.js?
 
yes
 
//conf.js

exports.config= {
directConnect: true,
specs : ['test.js'],
capabilities: {
'browserName': 'chrome'
}


};
 
12:36 PM
is your test.js in the same folder as conf.js
 
YEs
both are in same folder
the website is getting launched
iit is just the + button which is not getting clicked
 
and you are not getting the correct error message also.
 
yeah
tried a lot hell things
upgraded the protractor too
now it is version 4
What can be more simpler than this?
describe ('angularjs homepage', function() {
browser.get('http://angular.github.io/peepcode-tunes/public/');
element.all(by.css('.queue.add')).get(0).click();

});
 
don't worry it happens, protractor has gone through lot of changes, you can do one thing, go inside your folder's node modules/protractor/lib and then find launcher.ts file. can you paste the ` uncaught exception error code` here ?
there is a tweak to get the exact error message
the code should be somewhat like this
` process.on('uncaughtException', (e: Error) => {
let errorCode = ErrorHandler.parseError(e);
if (errorCode) {
let protractorError = e as ProtractorError;
ProtractorError.log(
logger, errorCode, protractorError.message,
protractorError.stack);
process.exit(errorCode);
} else {
logger.error(e.message);
logger.error(e.stack);
process.exit(ProtractorError.CODE);
}
});
`
 
i cannt find a folder named protractor under node modules
y so?
 
12:45 PM
you installed protractor globally or locally?
npm install -g protractor would install globally
 
i went to protractor website and followed the step there
through npm
yes
-g
 
npm install --save protractor would install locally in your projects folder
do this
 
ok wait
i used it
 
go to your project folder and type the above command
now you should see node_modules folder
 
i was able to see node_module
but there in protractor folder was missing
 
12:47 PM
can you paste your pakage.json?
 
where can i find that?
 
it should be in ur project folder
 
there are many package.json
 
ohki think you should have some understanding of nodejs for working with protractor.
can you type ` npm -g ls protractor`
it would give the location of your globally installed protractor
 
{
"_args": [
[
"protractor",
"D:\\Protractor"
]
],
"_from": "protractor@latest",
"_id": "protractor@4.0.0",
"_inCache": true,
"_installable": true,
"_location": "/protractor",
"_nodeVersion": "5.11.0",
"_npmOperationalInternal": {
"host": "packages-16-east.internal.npmjs.com",
"tmp": "tmp/protractor-4.0.0.tgz_1468347609540_0.5993468663655221"
},
"_npmUser": {
"email": "angular-core+npm@google.com",
"name": "angularcore"
},
"_npmVersion": "3.5.3",
"_phantomChildren": {
"adm-zip": "0.4.7",
"brace-expansion": "1.1.6",
is this the json u want?
 
12:54 PM
nope I am looking for something like this -
```
{
"name": "solve",
"version": "1.0.0",
"description": "",
"main": "config.js",
"scripts": {
"test": "protractor config.js"
},
"author": "",
"license": "ISC",
"devDependencies": {
"protractor": "^4.0.0",
"protractor-html-screenshot-reporter": "0.0.21",
"protractor-jasmine2-html-reporter": "0.0.6",
"protractor-jasmine2-screenshot-reporter": "^0.3.1"
}
}
```
 
can u provide me path?
where this json will be avilable?
 
do npm -g ls protractor
did you get some location?
 
yeah
got APPdata location
 
yes now go to that location
inside your protractor folder search lib folder and then launcher.ts
 
there is a bin folder
but lib folder nai hai
package.json hai
 
12:59 PM
yaar lib folder hona chahiye protractor 4.0.0 hi install kiya hai na?
 
i checked with protractor --version
it is showing 4.0.0
and i m writing all in notepad
mene project nai banaya
is this the reason?
 
it doesn't matter, if you installed protractor globally and using it should work then also
 
lib is replaced by built?
is it so ?
i have built
and i have launcher.js in it
 
that is an old issue which is closed. with new protractor it is changed
look at the folder structure
you will find lib folder
i am not sure how you are getting old protractor in your system
 
ok
should i delete this all crab?
and install all again?
 
1:08 PM
ya delete everything . start from scratch i will tell you detailed steps
 
yeah
how to delete?
 
no need to delete just now...just create a new folder somewhere else
 
let me delete everything please
should i delete the folder
?
 
no its not needed yet you could lose some imp info. later you can delete
just create a new folder
 
created
 
1:11 PM
now open cmd from that folder
 
done
 
type npm init
keep on pressing enter till it asks yes/no
 
done
is this ok ? <yes>
 
yes
 
done
 
1:12 PM
now you should see package.json in your folder
 
ok come back to cmd
and type npm install --save protractor
 
came
typed
downloading
 
yes, it should install protractor
after installation check in your package.json
 
yeah checking
 
1:13 PM
protractor should be there in dependencies
 
{
"name": "protractor-new",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"protractor": "^4.0.0"
}
}
is it fine?
 
yes correct
 
now?
 
now in your folder create 2 files conf.js & test.js
same copy paste the files
 
wait
creating
conf.js
//conf.js

exports.config= {
directConnect: true,
specs : ['git.js'],
capabilities: {
'browserName': 'chrome'
}


};
git.js
describe ('angularjs homepage', function() {
browser.get('http://angular.github.io/peepcode-tunes/public/');
element.all(by.css('.queue.add')).get(0).click();

});
fine?
should i go with protractor conf.js ?
 
1:16 PM
no wait
 
okay
 
your git.js is not correct
 
this is what u provided me
 
you should put element.all(by.css) line in it function
that is the correct way
your tests should be in it function
and urls you can give in describe
ohh i think this i didn't see earlier :P
 
describe ('angularjs homepage', function() {
browser.get('http://angular.github.io/peepcode-tunes/public/');
it('test 1', function(){
element.all(by.css('.queue.add')).get(0).click()
});

});
 
1:18 PM
ok anyways try this
 
fine now?
 
yes now run protractor conf.js
 
protractor is not recognized
y so?
webdriver manager start?
 
no need of webdriver -manager , you are using directConnect
you are running protractor conf.js from your folder only right?
 
run as admin issue
silly
 
1:22 PM
run your cmd as admin
 
same error dear
huh
D:\protractor-new>protractor conf.js
[18:51:52] I/direct - Using ChromeDriver directly...
[18:51:52] I/launcher - Running 1 instances of WebDriver
Started
[18:52:10] E/launcher - "process.on('uncaughtException'" error, see launcher
[18:52:10] E/launcher - Process exited with error code 199

D:\protractor-new>[0721/185214:ERROR:ipc_channel_win.cc(217)] pipe error: 109
 
yes this is not the correct error
now go to your node_modules/protractor/lib
and change the launcher.ts
 
still there is no lib yaar
yea kya hai
 
ohh..some issue is going on. they will release a patch soon to fix all this mess
meanwhile just find the launcher .js file
 
so we were all good
it is just their problem?
"use strict";
/**
* The launcher is responsible for parsing the capabilities from the
* input configuration and launching test runners.
*/
var q = require('q');
var configParser_1 = require('./configParser');
var exitCodes_1 = require('./exitCodes');
var logger_1 = require('./logger');
var runner_1 = require('./runner');
var taskRunner_1 = require('./taskRunner');
var taskScheduler_1 = require('./taskScheduler');
var helper = require('./util');
var logger = new logger_1.Logger('launcher');
var RUNNERS_FAILED_EXIT_CODE = 100;
 
1:27 PM
yes
just add one line in process.on('uncaughtEception').. code
did yoou find that code?
 
no
please guide
 
this one--

var scheduler = new taskScheduler_1.TaskScheduler(config);
process.on('uncaughtException', function (e) {
var errorCode = exitCodes_1.ErrorHandler.parseError(e);
if (errorCode) {
var protractorError = e;
exitCodes_1.ProtractorError.log(logger, errorCode, protractorError.message, protractorError.stack);
process.exit(errorCode);
}
else {
logger.error('"process.on(\'uncaughtException\'" error, see launcher');
process.exit(exitCodes_1.ProtractorError.CODE);
}
});
 
got
what to add?
 
change the else part to this--


logger.error(e.message);
logger.error(e.stack);
process.exit(ProtractorError.CODE);
 
done
now?
 
1:32 PM
save it and now execute protractor conf.js from your folder . you will get the correct error message
 
still getting the same error
 
i think your global protractor is confilicting. do npm uninstall -g protrator
it would uninstall protractor globally
 
uninstalling
done
 
and try once again from your folder if issue still exists i am afraid i dont have anything else. i know this i just a setup issue
 
i think it uninstalled all
now i am nt able to run even protractor --version
 
1:38 PM
yes you wont get that now
 
node_modules is empty
 
from your folder you would be able to run
in your folder node_modules/protractor is ther or not?
 
yes it is
still not able to run
can i delete everything from node modules?
i vl do a fresh setup
i know steps
which u told me
 
ya you can do npm uninstall --save protrator
it would remove protractor & node_modules from your folder
 
yea did that
i vl do it tomorrow and let u know
 
1:42 PM
ya do it and also i was looking at ur conf.js
you should add framework: 'jasmine2'
/conf.js

exports.config= {
directConnect: true,
specs : ['git.js'],
capabilities: {
'browserName': 'chrome'
}


};
in this add that line
it comes by default but anyways try it
 
added
i vl do it tmrw now
and vl let u know
thanks a lot for ur time
i'm leaving now.. talk to u tmrw :-)
 
sure :)
 

last day (14 days later) »