How to define page objects in Selenium?
Selenium is a heavy duty framework for testing web application. It is used by testers and developers to automate their functional and non-functional tests. When you are writing test for Selenium you will have to create page objects which are responsible for the creation of all the elements on the page.
These page objects will be using methods like findElementBy*() or findElementsBy*() . But these methods are tedious and time consuming. So, Selenium has introduced some of its own methods like ‘findText()’. Find text method returns the first found element which contains the text which you are searching for. This method can be used to search for element with id, text and many other properties in it.
Learn more: https://www.toptal.com/selenium/test-automation-in-selenium-using-page-object-model-and-page-factory