In the previous post, we have understood the below HTML basics:
- > HTML Structure
- > Also understand the previous posts on HTML in this tutorial for understanding the HTML basics (Click here to get started on HTML Basics for Selenium)
Once you have understood the above HTML Structure, you can now understand the steps for adding the Title to the Web Page using HTML.
Let’s get started
HTML for Selenium (Part 4) – Adding Title to the Web Page
Follow the below steps for adding Title to the Web Page using HTML.
1) HTML provides the tags <title> .. </title> for adding the desired Titles to the Web Page. The text provided between the title tags will become the Title of the Web Page. The following is an example of the same:
<title> QAFox </title>
In the above HTML code, text between the start and end title tags becomes the title of the Web Page. (i.e. QAFox becomes the title of the web page)
Let’s follow the below steps for adding the title tags to the Web Page.
2) Right click on your desktop and select ‘New’ > ‘Text Document’ as shown below:
3) Observe that a text document will be created and right click on it to open as shown below:
4) Create the Structure for the HTML as shown below:
5) Select ‘File’ > ‘Save As’ option as shown below:
6) Provide the File name as ‘HTML Title Demo.html’ and Save As Type as ‘All Files’ as shown below and click on ‘Save’ Button:’
7) Observe that the above HTML file will be saved as below:
8) Right click on the above-saved HTML file and select ‘Open’ option as shown below:
9) Observe that the HTML page having the title as default HTML File name (As no title is specified in the HTML code) will be displayed as shown below:
10) Right click on the HTML file and select ‘Edit with NotePad++’ option as shown below (Install NotePad++ software from here if not installed in your machine):
11) Now let’s add the desired Title to the Web Page by adding the title tags to the HTML code as shown below and Save:
12) Right click on the above-saved HTML file and select ‘Open’ option as shown below:
13) Observe that this time, ‘QAFox’ title will be displayed on the title section of the web page as shown below:
Here concludes this article and will explain more HTML basics in the upcoming posts.
- > To learn more about Selenium, continue to the next post (Click on Next Post link below)
- > Check complete Selenium Tutorial Contents here (Click here)
Please leave your questions/comments/feedback below.
Happy Learning 🙂
On a mission to contribute to the Software Testing Community in all possible ways.