The site I'm testing on is a single page application with angular.
Because of this a lot of the DOM is loaded ahead of time and are hidden. Depending on what the user does, the hidden DOM will be displayed. Regardless of if the DOM is displayed or hidden, protractor sees this as part of the entire DOM tree. When I locate an element by id:
this.usernameTextbox = element(by.id('username'));
It detects that there are multiple elements with that same id, one element being visible (ng-show
) and the other being hidden (ng-hide
).
Is there a way for protractor to only locate elements that are not hidden?