HomePage Class
Learn how to implement user interactions with the Home Page in the HomePage class using element locators.
We'll cover the following...
We'll cover the following...
The code of the HomePage class is shown below:
Why do we need this class?
The HomePage class implements the user interactions with the Home Page of the site. In our case, the only thing that the user does on the Home Page is execute a keyword search.
Constructor
The HomePage constructor gets the driver as a parameter and saves it in a class variable (lines 21-23).
It also creates a WebDriverWait object with the 30 seconds timeout (line 24). This object will be used for waiting for elements to be visible before interacting with them, which synchronizes the automated test with the web page.
If the web ...