How can we fetch the title of the page in Selenium?

How can we fetch the title of the page in Selenium?

Hello Rhian-lewis,

Using driver.getTitle() command, we can fetch the page title in Selenium. This method returns a string containing the title of the webpage.