I am facing a situation where the system needs to scroll upwards to reach the web element located in the left panel of the page and then click on it to proceed with other operations. I have attempted various methods but none seem to be effective. Can anyone provide a solution for this issue?
1.
WebElement element = driver.findElement(By.xpath("element"));
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", element);
Thread.sleep(500);
2.
WebElement element = driver.findElement(By.xpath("element"));
Actions actions = new Actions(driver);
actions.moveToElement(ele);
actions.perform();