I am using Page Factory to initiate a common driver for the entire test. So created a page class and a test which will use the functionality of the page class to find total deals but need to scroll down the window to load all the deals. So thought of using JS Executor but ended up with casting error("java.lang.ClassCastException: Pages.CourseListPage cannot be cast to org.openqa.selenium.JavascriptExecutor ").
If you can please help me with how to use JS Executor with Page Factory.