I am learning protractor for e2e testing angularjs and having some difficulties getting things going.
Since I am new to this framework, Im following some tutorials like https://egghead.io/lessons/angularjs-protractor-interactive.
watching the tutorial I see that he checks if an element has been successfully found by *tabbing.
I gave tries too.
I made a button and input field as he did and ran into interactive mode.
element(by.tagName("button")).click()
did fine for me. it clicked the button on index.html.
However, I cannot check if the element has been found before clicking it. That means I cannot see click option by tabbing when I am done typing to the point element(by.tagName("button")).
I found it inefficient to rerun specs just to check if element has been found every time.
I would really appreciate if someone can let me know the right solution to this problems.
Thank you.
This was fixed 6 days ago and is not yet released.
So you can wait for Protractor > 1.3.1 or start using master branch.
In case you need sudo
and using Protractor globally installed:
sudo npm -g install git://github.com/angular/protractor#master
I prefer to setup a NodeJS project with package.json and point to an specific Protractor version or commit, for better control:
npm init
npm install --save git://github.com/angular/protractor#ed1c75c7
mkdir -p bin
# some handy shortcuts
ln -s ../node_modules/.bin/protractor bin/p
ln -s ../node_modules/protractor/bin/elementexplorer.js bin/e
# elementexplorer sample usage
bin/e https://angularjs.org/
# Protractor binary sample usage
bin/p your-config.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With