To create three text boxes with different values, I need to click a button three times using the following code:
for (var i = 0; i < 3; i++) {
element(by.id('protractor-type')).click();
};
After clicking thrice, three text boxes will appear. The HTML code for the text box is:
<input type="text" required="" ng-model="config.eTypes[$index]" ng-change="updateEySettings()" class="form-control ng-pristine ng-invalid ng-invalid-required ng-touched" placeholder="Eg: Dancing" tabindex="0" aria-required="true" aria-invalid="true">
Using the code below, you can give a value to only one textbox:
element(by.model('config.eTypes[$index]')).sendKeys('1st box');
However, to provide values to all textboxes, attempt like this was unsuccessful:
element.all(by.repeater('type in config.eTypes track by $index')).then(function(arr){
arr[0].sendKeys('cat');
arr[1].sendKeys('ball');
arr[2].sendKeys('bat');
});
If you have suggestions on how to achieve this properly, please share.