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")).
a busy cat http://i59.tinypic.com/dmfcrt.jpg
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.