protractor icon indicating copy to clipboard operation
protractor copied to clipboard

Multiples ng-repeat in the same page

Open vipper opened this issue 13 years ago • 2 comments

I have a page where I use twice the same directive, because of this I don't know how i can get those ng-repeaters. When I use element(by.repeater) Protractor always returns just the first repeater and when I use element.all i don't receive a list of repeaters.

Can anyone help me on that trouble?

In my example i have 2 repeaters (column in columns) and i need get the second one.

vipper avatar Nov 20 '13 20:11 vipper

I do not know if this is what you want ,but you can add an extra tag in your HTML and make that a different value for each repeater

example : you can then call them like this : ptor.findElement(protractor.By.xpath('//*[@repeaterTag="1"]')).click();

(reapeaterTag and value 1 are just examples the can be what you want)

edit : wrong example sorry below is correct i think ptor.findElement(protractor.By.xpath('//*[@repeaterTag="1"]').row().column('{{}}'))

Basman01 avatar Nov 21 '13 09:11 Basman01

I just solve this. When i have 2 or more repeater with the same expression, the command by.repeater("col in cols") return a big list of rows and columns with all rows and all columns of all repeaters in the page

vipper avatar Nov 21 '13 12:11 vipper