【问题标题】:undefined property 'bind' when using expected conditions使用预期条件时未定义的属性“绑定”
【发布时间】:2015-04-30 13:39:24
【问题描述】:

我正在尝试使用预期条件功能让量角器在继续之前等待页面上存在项目。

http://angular.github.io/protractor/#/api?view=ExpectedConditions

我已按照文档中的示例进行操作,但收到有关未定义属性的错误。

这似乎是使用任何预期条件时的情况,而不仅仅是与我在这里使用的 presentOf 函数有关:

var EC = protractor.ExpectedConditions
var pixels = element.all(by.repeater('item in items'))
var pixelsLoaded = EC.presenceOf(pixels)

browser.wait(pixelsLoaded,10000)

失败:无法读取未定义的属性“绑定” 堆: TypeError:无法读取未定义的属性“绑定” 在 [object Object].ExpectedConditions.presenceOf (/foo/bar/node_modules/gulp-protractor/node_modules/protractor/lib/expectedConditions.js:233:33) 在环境。 (/foo/bar/app/features/pixelmanager/test/pixelManagerPOTest.js:48:31) 在 /foo/bar/node_modules/gulp-protractor/node_modules/protractor/node_modules/jasminewd2/index.js:95:14 在 [object Object].promise.ControlFlow.runInFrame_ (/foo/bar/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1877:20) 在 [object Object].promise.ControlFlow.runEventLoop_ (/foo/bar/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1755:8) 在 [对象对象]。 (/foo/bar/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:2056:12) 在 goog.async.run.processWorkQueue (/foo/bar/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/async/run.js:125:21) 在 runMicrotasksCallback (node.js:337:7) 在 process._tickCallback (node.js:355:11) 来自:任务:在控制流中运行 在对象。 (/foo/bar/node_modules/gulp-protractor/node_modules/protractor/node_modules/jasminewd2/index.js:94:33) ==== 异步任务 ==== 错误 在套房。 (/foo/bar/app/features/pixelmanager/test/pixelManagerPOTest.js:44:5) 在对象。 (/foo/bar/app/features/pixelmanager/test/pixelManagerPOTest.js:9:1) 在 Module._compile (module.js:460:26) 在 Object.Module._extensions..js (module.js:478:10) 在 Module.load (module.js:355:32) 在 Function.Module._load (module.js:310:12)

【问题讨论】:

    标签: javascript angularjs webdriver protractor


    【解决方案1】:

    通过删除对all 的不当调用来修复:

    var pixels = element(by.repeater('item in items'));
    

    【讨论】:

      猜你喜欢
      • 2017-10-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-17
      • 1970-01-01
      • 1970-01-01
      • 2018-03-09
      • 2020-03-27
      相关资源
      最近更新 更多