public void selectedOption ( String expectedText ) { String option = checkSelectedOption ( expectedText , 0 , 0 ) ; String reason = NO_ELEMENT_FOUND ; if ( option == null && getElement ( ) . is ( ) . present ( ) ) { reason = ELEMENT_NOT_SELECT ; } assertNotNull ( reason , option ) ; assertEquals ( "Selected Option Mismatch" , expectedText , option ) ; }
Asserts that the element s selected option equals 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 .