To remove the issues we are experiencing here, we are going to start building our page objects using something designed to get around the problems noted earlier: the Query object.
First of all, you will need to add the following dependency to your POM.xml file:
<dependency>
<groupId>com.lazerycode.selenium</groupId>
<artifactId>query</artifactId>
<version>1.2.0</version>
<scope>test</scope>
</dependency>
Then we are going to create an abstract class called BasePage that all other pages will be able to inherit from. We are doing this because we are going to need to have access to a RemoteWebDriver object, and we don't want to add this code to every single page object:
package com.masteringselenium.query_page_objects;
import com.masteringselenium.DriverBase;
import org...