private InputValue getInputValue ( FormInput input ) { /* Get the DOM element from Selenium. */ WebElement inputElement = browser . getWebElement ( input . getIdentification ( ) ) ; switch ( input . getType ( ) ) { case TEXT : case PASSWORD : case HIDDEN : case SELECT : case TEXTAREA : return new InputValue ( inputElement . getAttribute ( "value" ) ) ; case RADIO : case CHECKBOX : default : String value = inputElement . getAttribute ( "value" ) ; Boolean checked = inputElement . isSelected ( ) ; return new InputValue ( value , checked ) ; } }
Generates the InputValue for the form input by inspecting the current value of the corresponding WebElement on the DOM .