angularjs - Protractor: addLocator() : 'Cannot read property 'querySelectorAll of null' ' -
i trying run standart example protractor's documentation ( http://angular.github.io/protractor/#/api?view=protractorby.prototype.addlocator ). , have error: 'cannot read property 'queryselectorall of null'
by.addlocator('buttontextsimple', function(buttontext, opt_parentelement, opt_rootselector ) { var using = opt_parentelement, buttons = using.queryselectorall('button'); return array.prototype.filter.call(buttons, function(button) { return button.textcontent === buttontext; }); });
view same:
<button ng-click="doaddition()">go!</button>
what should solve problem?
you should declare variable called using
this:
var using = opt_parentelement || document;
so if there no optional parent element provided, global document
used query results.
not sure if typo in documentation or protractor expected auto-fill opt_parentelement
variable defaults if not being set.
Comments
Post a Comment