1

I tried almost all the possible ways to scroll but nothing happens. the scrolling is simply skipping without any error.

I tried the following

IJavascriptExcutor js = (IJavascriptExcutor)driver;

js.ExecuteScript("window.scrollTo(0, document.body.scrollHeight)");

js.ExecuteScript("window.scrollBy(0,250)", "");

IWebElement element = new WebDriverWait(driver, TimeSpan.FromSeconds(20)).Until(ExpectedConditions.ElementIsVisible(By.CssSelector("css_element"))); js.ExecuteScript("arguments[0].scrollIntoView(true);",element); int x= 0; int y=200 js.ExecuteScript(String.Format("window.scrollBy({0},{1})", x,y);

  • The code looks like it should work. Have you tried it on a few different web pages and does it fail to work with all of them? Are there any errors in the browser's console? Have you tried it with different browsers? You may want to add the selenium and selenium-webdriver tags to your question to help people who could answer notice it. – sbridewell Apr 19 '22 at 16:33
  • Thank you for your suggestions. I have added the tags accordingly. the frustrating part is there is no error message. it simply just ignores and goes to the next step. I also tried the Actions Class result is the same. – Rahen CHoudhury Apr 19 '22 at 16:38

0 Answers0