简体   繁体   English

量角器elementexplorer没有显示元素

[英]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分支。

How to install Protractor from master branch 如何从master分支安装Protractor

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.

相关问题 elementExplorer字符转义在量角器1.8.0和2.0.0上回归了? - elementExplorer character escape regressed on Protractor 1.8.0 and 2.0.0? jQuery:Tipsy不会显示在禁用的元素上 - Jquery: Tipsy doesn't show on disabled elements Javascript 不显示带有 display = "block" 的元素 - Javascript doesn't show elements with display = "block" 量角器不等待重定向 - Protractor doesn't wait for redirect 量角器-打开弹出窗口时,它不等待该窗口内的所有元素 - Protractor - When opening a popup it doesn't wait for all elements inside this window Protractor - 通过 count() 遍历所有元素 function 对我不起作用 - Protractor - iterate through all elements by count() function doesn't work for me 使用量角器时,我的页面未加载所有元素。 手动执行 - My page doesn't load all the elements when using protractor. Manually it does 为什么我的函数没有按预期显示和隐藏元素? - Why doesn't my function show and hide elements as expected? Cypress invoke 不执行隐藏元素交互的“show”方法 - Cypress invoke doesn't execute the "show" method for hidden elements interaction 悬停的项目在展开时不会显示隐藏的元素 - Hovered item doesn't show hidden elements when it expands
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM