Webpages are used to display content over the internet. The basic structure of a web page comprises of three container elements:
<html>
<head>
<body>
The <html>
tag wraps the contents of the page.
The <head>
tag shows information related to the webpage. This can include the title, search keywords, or style-sheets. All this information is optional.
The <body>
tag encapsulates the entire content of the webpage. All elements are placed inside the <body>
tag.
The code snippet below shows the structure of a webpage:
We can use different tags and elements inside these containers.
Any element that is present inside a web page is known as a web element. There are different types of web elements in Selenium:
The table below shows the description of each web element:
Element | Description |
---|---|
Edit box | Used to enter small amounts of text. |
Links | Links refers to hyperlinks to other web pages. Links are used to connect different web pages. |
Button | A button is used to confirm an input. We can also use buttons to submit a form. |
Image | Images make the webpage more interactive. They attract users and efficiently convey information. Images can also be used as clickable buttons. |
Text area | Text area is used to allow users to write several lines of text. It shows an area carved inside the webpage. |
Checkbox | A checkbox is used to allow a user to select multiple options. It is an interactive way of getting input from the user in the form of bulleted options. |
Radio button | A radio button enables a user to select a single option only from a series of options. |
Dropdown list | A dropdown list is used to display options to the user in the form of a list. A user can only select a single option at a time. |
The illustration below shows different web elements:
Free Resources