public void selectValues ( String [ ] expectedValues , double seconds ) { double end = System . currentTimeMillis ( ) + ( seconds * 1000 ) ; try { elementPresent ( seconds ) ; if ( ! element . is ( ) . select ( ) ) { throw new TimeoutException ( ELEMENT_NOT_SELECT ) ; } while ( ! Arrays . toString ( element . get ( ) . selectValues ( ) ) . equals ( Arrays . toString ( expectedValues ) ) && System . currentTimeMillis ( ) < end ) ; double timeTook = Math . min ( ( seconds * 1000 ) - ( end - System . currentTimeMillis ( ) ) , seconds * 1000 ) / 1000 ; checkSelectValues ( expectedValues , seconds , timeTook ) ; } catch ( TimeoutException e ) { checkSelectValues ( expectedValues , seconds , seconds ) ; } }
Waits for the element s select values equal the provided expected values . If the element isn t present or a select this will constitute a failure same as a mismatch . The provided wait time will be used and if the element doesn t have the desired match count at that time it will fail and log the issue with a screenshot for traceability and added debugging support .