I am facing a challenge where I am trying to click on link text that is not visible on the screen. To address this, I have used the scrollIntoView(top) JavaScript function to make the text visible. However, the text ends up moving to the top of the screen and becomes hidden behind a fixed header div, making it impossible for me to click on the link. Can anyone offer assistance in resolving this issue?
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("arguments[0].scrollIntoView(top);", Loadmoreweb);