@ Override public void setValue ( Object value ) throws WidgetException { boolean set = false ; try { if ( value instanceof String ) { if ( ( ( String ) value ) . equalsIgnoreCase ( UNCHECK ) ) { doAction ( true ) ; } else if ( ( ( String ) value ) . equalsIgnoreCase ( CHECK ) ) { doAction ( false ) ; } set = true ; } else { throw new WidgetRuntimeException ( "value must be a String of either 'check' or 'uncheck'" , getByLocator ( ) ) ; } } catch ( Exception e ) { throw new WidgetException ( "Error while checking/unchecking" , getByLocator ( ) , e ) ; } if ( ! set ) throw new WidgetException ( "Invalid set value for checkbox. It must be either 'check' or 'uncheck'" , getByLocator ( ) ) ; }
Sets the value of the CheckBox