Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

selenium

What are web elements and how do they structure a webpage?

Hassaan Waqar

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.

Example

The code snippet below shows the structure of a webpage:

  • HTML

We can use different tags and elements inside these containers.

What are web elements?

Any element that is present inside a web page is known as a web element. There are different types of web elements in Selenium:

  • Edit box
  • Links
  • Button
  • Image, image link, an image button
  • Text area
  • Checkbox
  • Radio button
  • Dropdown list

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:

Different web elements

RELATED TAGS

selenium

CONTRIBUTOR

Hassaan Waqar
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring