I am new to the automation and I would like to know how to scroll to a web element on the current page using selenium and java.
I have tries many methods which is described in stackoverflow. But couldn't able to solve my problem.
Solutions I tried:
WebElement element = driver.findElement(By.id("id_of_element"));
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", element);
Thread.sleep(500);