public void selectOption ( String expectedOption ) { String [ ] options = checkSelectOption ( expectedOption , 0 , 0 ) ; String reason = NO_ELEMENT_FOUND ; if ( options == null && getElement ( ) . is ( ) . present ( ) ) { reason = ELEMENT_NOT_SELECT ; } assertNotNull ( reason , options ) ; assertTrue ( "Option not found: element options of '" + String . join ( "," , options ) + DOES_NOT_CONTAIN + expectedOption + "'" , Arrays . asList ( options ) . contains ( expectedOption ) ) ; }
Asserts that the element s options contains the provided expected option . If the element isn t present or a select this will constitute a failure same as a mismatch . This information will be logged and recorded with a screenshot for traceability and added debugging support .