jeudi 2 avril 2015

protractor executeScript weirdness with ElementArrayFinder

I have this declared in my Page Object:



this.paginationPageNumberList = element.all(by.repeater("page in pages track by $index"));


Running this inside a function of Page Object, its successful and prints 'no wrap':



browser.executeScript('window.scrollTo(254,1600);');
this.paginationPageNumberList.get(0).then(function() {
console.log("no wrap");
});


Running the same thing except with a then() gives me an error:



browser.executeScript('window.scrollTo(254,1600);').then(function () {
this.paginationPageNumberList.get(0).then(function() {
console.log("wrap");
});
});



Failed: Cannot call method 'get' of undefined.



Why?


Aucun commentaire:

Enregistrer un commentaire