Have tried many things with respect to scroll, but the below code has provided better results.
This will scroll until the element is in view:
WebElement element = driver.findElement(By.id("id_of_element")); ((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", element); Thread.sleep(500); //do anything you want with the element
Related Posts:
- How to use XPath preceding-sibling correctly
- When and how to use switchTo() method in webDriver (Selenium 2) to handle window/pop up
- SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81
- Scroll to an element with jQuery
- Scroll to an element with jQuery
- SBOX_FATAL_MEMORY_EXCEEDED error shown when Chromedriver turned 1800-1900 pages using Selenium
- ImportError: No module named ‘selenium’
- MacOS Catalina(v 10.15.3): Error: “chromedriver” cannot be opened because the developer cannot be verified. Unable to launch the chrome browser
- Scroll to the top of the page using JavaScript?
- element not interactable exception in selenium web automation
- selenium – chromedriver executable needs to be in PATH
- Wait for page load in Selenium
- Disable Scrolling on Body
- Running Selenium with Headless Chrome Webdriver
- Selenium using Python – Geckodriver executable needs to be in PATH
- Disable Scrolling on Body
- Easiest way to alter eBay page content/DOM
- scrollIntoView Scrolls just too far
- How to get locator of current web element?
- jQuery animate scroll
- org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms
- Wait until page is loaded with Selenium WebDriver for Python
- How to select a drop-down menu value with Selenium using Python?
- Scroll Automatically to the Bottom of the Page
- Scroll to the top of the page after render in react.js
- Jquery .on(‘scroll’) not firing the event while scrolling
- Call a Class From another class
- 100% DIV width is not really 100%
- How to open a new tab using Selenium WebDriver in Java?
- Auto scrolling with CSS
- Selenium Webdriver: Element Not Visible Exception
- jQuery Scroll to bottom of page/iframe
- Is there a way to get element by XPath using JavaScript in Selenium WebDriver?
- How to disable scrolling temporarily?
- Can not click on a Element: ElementClickInterceptedException in Splinter / Selenium
- How to scroll an HTML page to a given anchor
- Selenium using Java – The path to the driver executable must be set by the webdriver.gecko.driver system property
- How do you add a scroll bar to a div?
- jQuery scrollTop() method not working
- How to scroll to top of a div using jQuery?
- Overflow-x not working
- Selenium “Unable to find a matching set of capabilities” despite driver being in /usr/local/bin
- ElementClickInterceptedException: element click intercepted:
- Test if element is present using Selenium WebDriver?
- How to get scrollbar position with Javascript?
- How to scroll to top of page with JavaScript/jQuery?
- Webdriver Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms