I already searched for the solution for the below problem but I didn't find any solution. I found similar posts and i tried those solutions but nothing is worked. That's why I am posting here.
I am using selenium webdriver with Java on firefox browser. I am facing an issue with scrolling down "Div" element on the webpage. I was not able to scroll down the Div element.
This Div element is only enabled when we place the mouse at that point or when move-in /out from that place.
Div element object properties are given below.
<div class="slimScrollBar" style="background: rgb(0, 0, 0) none repeat scroll 0% 0%; width: 7px; position: absolute; top: 0px; opacity: 0.4; display: none; border-radius: 7px; z-index: 99; right: 1px; height: 30px;"></div>
I tried javascript execution, locators , Keys down etc etc..but nothing didnt work.
Workarounds:
1).
WebElement
ddl_scrollDown =
driver.findElement(By.cssSelector("div.slimScrollBar"));
Coordinates
cor=((Locatable)ddl_scrollDown).getCoordinates();
cor.inViewPort();
2).
WebElement
ddl_scrollDown =
driver.findElement(By.cssSelector("div.slimScrollBar"));
ddl_scrollDown.sendKeys(Keys.PAGE_DOWN);
3).
WebElement
ddl_scrollDown =
driver.findElement(By.cssSelector("div.slimScrollBar")); (JavascriptExecutor)driver).executeScript("arguments[0].click();",ddl_scrollDown);
4).
String
st = "div.slimScrollBar";
String s = String.format("var
topPos = document.querySelector(\""+st+"\");
topPos.scrollIntoView(false); ");
JavascriptExecutor js =
(JavascriptExecutor) driver;
js.executeScript(s);
And I attached a screenshot for reference.
I would really appreciate it if anyone provides the solution.