Hey All I have a question regarding selenium I have a very long form, and I want to scroll a little bit down for entering data. I do not want it to scroll all the way just until the element is displayed.
I used this code:
WebElement element = driver.findElement(locator);
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("arguments[0].scrollIntoView();", element);
It not worked since selenium scroll to match down, is their a way it will scroll to this element so I Can enter data to it, for example to scroll until element is in the moddle of screen. I do not know what is the purpose of scroll into view if it is scrolling not to view regards