I want to handle a test scenario for a select menu where spec would pick a random option other than the one currently selected. I can't seem to find a working locator or method that would let me do it.
- Strategy 1: get the current index of
option[selected]
and select random off other indices. - Strategy 2: get options not selected
by.css('option:not([selected])')
- get the length of the array and pick random one. This selector seems to ignore the:not
part and returns total number of options.
As I am fresh to protractor, I don't really see a way to do that looking at the API. Any hint, please?