About Lesson
Different Types of Form Elements
HTML forms allow users to input data and interact with the web page. They are crucial for collecting and processing user input on web pages. They contain various elements like test boxes, buttons, links, etc.
Form Elements
Some of the commonly used form elements in HTML are as follows:
HTML Element | Description | Selenium Action |
Button | The button element allows the user to click on the button in the form. | click() |
Button | The submit button allows you to submit the form to the server, which will post the form and its data.
<button type=”submit”>Submit</button> |
submit() |
Radio button | The radio button allows you to select one radio button
<input type=”radio” name=”gender” value=”male” /> |
click() |
Checkbox | The checkbox allows you to select multiple checkboxes
<input type=”checkbox” name=”mcq answer” /> |
click() |
Text box | Type the text in the textbox. | send_keys() |
Text box | clears the content of the textbox.
<input type=”text” name=”username” /> |
clear() |