javascript - Protractor index in loop stays the same -
i have problem following piece of code.
var elements = element.all(by.repeater('repeater')); elements.then(function(array){ (var = 0; < array.length; i++){ var opentext = elements.get(i); opentext.gettext().then(function(txt){ if (txt.indexof(eventname) >= 0){ opentext.element(by.buttontext('close')).click(); }; }); }; });
what trying achieve following: - need go through elements in elements.all that's why i'm using elements.then(array). need find specific string in elements, that's why indexof. in element need find spefific buttontext should on index "i" , call using get(i). turns out las index in array. there way solve this? need click on element inside element. can find 1 element text , buttontext inside first element.
any appreciated.
Comments
Post a Comment