protected void selectCheckbox ( PageElement element , boolean checked , Object ... args ) throws TechnicalException , FailureException { try { final WebElement webElement = Context . waitUntil ( ExpectedConditions . elementToBeClickable ( Utilities . getLocator ( element , args ) ) ) ; if ( webElement . isSelected ( ) != checked ) { webElement . click ( ) ; } } catch ( final Exception e ) { new Result . Failure <> ( e . getMessage ( ) , Messages . format ( Messages . getMessage ( Messages . FAIL_MESSAGE_UNABLE_TO_CHECK_ELEMENT ) , element , element . getPage ( ) . getApplication ( ) ) , true , element . getPage ( ) . getCallBack ( ) ) ; } }
Checks a checkbox type element .