[英]Protractor elementexplorer doesn't show elements
I'm starting working with protractor e2e tests and I spend a lot of time in elementexplorer tool. 我开始使用量角器e2e测试,我花了很多时间在elementexplorer工具上。 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. 所以我点击Enter按钮没有任何反应:我的光标只是跳到新行,显然elementexplorer正在等待更多输入。 I'm trying that on chrome (Chrome Developer Tools are closed).
我正在尝试使用chrome(Chrome开发者工具已关闭)。 In my tests the locator
element.all(by.css('.hbpreg-exdesc-samples-ul>li'))
works perfectly fine. 在我的测试中,locator
element.all(by.css('.hbpreg-exdesc-samples-ul>li'))
完全正常。
Has anyone faced the similar problem? 有没有人遇到类似的问题?
This was fixed Oct 1 and got released in Protractor 1.4.0 . 这已于10月1日修复,并在Protractor 1.4.0中发布 。
So you need Protractor >= 1.4.0 or start using master branch. 所以你需要Protractor> = 1.4.0或者开始使用master分支。
In case you need sudo
and using Protractor globally installed: 如果您需要
sudo
并使用全局安装的Protractor:
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: 我更喜欢使用package.json设置NodeJS项目并指向特定的Protractor版本或提交,以便更好地控制:
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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.