1. We may require to scroll to bottom of the page and then perform operations. For this scenario we have created a test 'scrollingToBottomofAPage'/
2. Some times, we may require to scroll to particular element and peform operations on that particular element. For this we need to pass the element on which we need to perform operation. For this scenario we have created a test 'scrollingToElementofAPage'/
3. We can also use the coordinates to scroll to particular position by passing the coordinates. For this scenario we have created a test 'scrollingByCoordinatesofAPage'/
The more better way to do this is having a utils class and define reusable methods. We can call these methods from different classes/tests.
We need to pass the driver to the method.
In the same way, we may need to scroll to particular element and perform operations. To do this we need the below example reusable method. We need to pass the driver and element.