HomeSelenium

HTML for Selenium (Part 4) – Adding Title to the Web Page

HTML for Selenium (Part 4) – Adding Title to the Web Page

<<Previous Post                            << Complete Tutorial>>                              Next Post>>

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:

HTML for Selenium - Creating Text Document

3) Observe that a text document will be created and right click on it to open as shown below:

HTML for Selenium - Open Text Document

4) Create the Structure for the HTML as shown below:

HTML for Selenium - HTML Structure Creation

5) Select ‘File’ > ‘Save As’ option as shown below:

HTML for Selenium - File Save As

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:’

HTML for Selenium - File Name and Type

7) Observe that the above HTML file will be saved as below:

HTML for Selenium - Saved Browser Icon

8) Right click on the above-saved HTML file and select ‘Open’ option as shown below:

HTML for Selenium - Open HTML file

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:

HTML for Selenium - Default Title

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):

HTML for Selenium - Edit with NotePadPlusPlus

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:

HTML for Selenium - Added Title Tags

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:

HTML for Selenium - QAFox Title

Here concludes this article and will explain more HTML basics in the upcoming posts.

Next Steps:

  • > 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 ?

About Me > Arun Motoori

On a mission to contribute to the Software Testing Community in all possible ways.

<<Previous Post                            << Complete Tutorial>>                              Next Post>>

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *

For FREE Testing Tutorials & Videos

X
Open chat
Contact Us on Whatsapp