RE: Identify Scroll bar

Thanks Virendra for sharing the answer!!

Scroll Bar is getting handle by using offset method but still its getting an error i.e.
Exception in thread “main” org.openqa.selenium.interactions.MoveTargetOutOfBoundsException: Offset within element cannot be scrolled into view: (0, 42.5): [object XrayWrapper [object HTMLDivElement]]
Command duration or timeout: 10 milliseconds

&
few time it successfully gets executed

Could you provide the solution for it ?

Add Comment
9 Answers

Hi Virendra,

Following is the script using in the Framework :

WebElement draggablePartOfScrollbar =¬† wd.findElement(By.xpath(“//div[@class=’fx-scrollbar-handle’]”));
System.out.println(“identified Scroll Bar”);
System.out.println(draggablePartOfScrollbar1.getLocation().getX());
int x = draggablePartOfScrollbar1.getLocation().getX();
System.out.println(draggablePartOfScrollbar1.getLocation().getY());
int y = draggablePartOfScrollbar1.getLocation().getY();

dragger.moveToElement(draggablePartOfScrollbar).clickAndHold(draggablePartOfScrollbar1).moveByOffset(0, y+260).release().perform();

//dragger.moveToElement(draggablePartOfScrollbar).clickAndHold(draggablePartOfScrollbar1).moveByOffset(y, y+260).release().perform();

Requirements :

This is a Vertical Scroll Bar when we move to mouse pointer to its division it gets displayed and we need to identify it and scroll  it down
.
If there is an alternative solution to perform this operation, Please let me know.

Train Answered on April 23, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.