Input boxes refer to either of these two types:
- Text Fields- text boxes that accept typed values and show them as they are.
- Password Fields- text boxes that accept typed values but mask them as a series of special characters (commonly dots and asterisks) to avoid sensitive values to be displayed.
Entering Values in Input Boxes
The sendKeys() method is used to enter values into input boxes.
Deleting Values in Input Boxes
The clear() method is used to delete the text in an input box. This method does not need any parameter. The code snippet below will clear out the text "tutorial" in the User Name text box.
Toggling a radio button on is done using the click() method.
Toggling a check box on/off is also done using the click() method.
The code below will click on Facebook's "Keep me logged in" check box twice and then output the result as TRUE when it is toggled on, and FALSE if it is toggled off.