Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Protractor elementexplorer doesn't show elements

I'm starting working with protractor e2e tests and I spend a lot of time in elementexplorer tool. Quite often it doesn't seem to work properly like in this case:

node node_modules/protractor/bin/elementexplorer.js http://localhost:9000/#/experiment-desc
Type <tab> to see a list of locator strategies.
Use the `list` helper function to find elements by strategy:
  e.g., list(by.binding('')) gets all bindings.

Getting page at: http://localhost:9000/#/experiment-desc
> element.all(by.css('.hbpreg-exdesc-samples-ul>li'))

So I hit the Enter button and nothing happens: my cursor just jumps to the new line and apparently elementexplorer is waiting for more input. I'm trying that on chrome (Chrome Developer Tools are closed). In my tests the locator element.all(by.css('.hbpreg-exdesc-samples-ul>li')) works perfectly fine.

Has anyone faced the similar problem?

like image 906
ganqqwerty Avatar asked Feb 01 '26 15:02

ganqqwerty


1 Answers

This was fixed Oct 1 and got released in Protractor 1.4.0.

So you need Protractor >= 1.4.0 or start using master branch.

How to install Protractor from 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
like image 146
Leo Gallucci Avatar answered Feb 03 '26 05:02

Leo Gallucci