How to scroll to a particular element on a web page with Java-Cucumber?

How to scroll to a particular element on a web page with Java-Cucumber?

Hello Dipen-soni,

You can scroll to a particular point by specifying the exact location or coordinates on the page. This can be done using the scrollBy method in JavaScript.

Sample syntax:

js.executeScript("window.scrollBy(0,3000)");