I am having a problem testing a website on which most elements are loading as you go in your view. Basically whenever i scroll to an element by ID and i attemt to click it it has already moved or my view got scrolled up or down. How can I easily make this bulletproof?
This only occurs on chromedriver, on geckodriver there is no problem with loading.
Used code:
WebElement scrollTest = driver.findElement(By.id("testId"));
((JavascriptExecutor)driver).executeScript("arguments[0].scrollIntoView();", scrollTest);