0

When I inspected for a scroll bar it pointed the element .x-table-container, tried to scroll with the following code, but it's not working, is there any other solution for this?

    protected void DragAndDropToVertical(IWebElement webElement, int dragValue)
    {
        new Actions(Driver).DragAndDropToOffset(webElement, 0, dragValue).Build().Perform();
        PauseExecution(200);
    }
gayana
  • 1

1 Answers1

0

The problem with Action chain it is usually not working when there is an iframe html in main body or element is not in view. So i think you should use Javascript Execute instead, this usually work best for me. Try it your self:

WebElement element = driver.findElement(By.id("find element with id or using what ever you want"));
((JavascriptExecutor)driver).executeScript("arguments[0].scrollIntoView(true);", element);
Thread.sleep(500); 

This code will scroll until it find your element.

Reference

Scroll Element into View with Selenium

Trinh Phat
  • 524
  • 3
  • 6