Not able to select an element using protractor vir

2019-03-01 20:31发布

I was able to select an element using ng-repeat but the developers have used virtual repeat as such the following code does not work now

expect(stores.listStores(0).getText()).toContain('Prahran');
expect(element.all(by.repeater('store in ui.stores')).count()).toEqual(1);

Failed: Index out of bound. Trying to access element at index: 0, but there are only 0 elements that match locator by.repeater("store in ui.stores")

1条回答
够拽才男人
2楼-- · 2019-03-01 21:09

You can make a CSS selector to match the material design repeater elements:

element.all(by.css('[md-virtual-repeat="store in ui.stores"]'));
查看更多
登录 后发表回答