How to handle Scroll bars while developing test scripts in Sikuli for automation

9k Views Asked by At

I am automating a page which is designed in Flex, so i am writing scripts in Sikuli. Now i want to move the scroll bar up and down. Can anybody help me?

2

There are 2 best solutions below

0
On

At the moment there is not a function to move the scrollbar.
But you can use dragDrop() to move it.

For example:

ImageScrollbar = ("bar.png") # Make for example a image of those 3 stripes on the scrollbar.
# Locate the scrollbar 
regionScrollbar = find(ImageScrollbar)
# Move the scrollbar vertically down 
dragDrop(regionScrollbar, Location(regionScrollbar.getX(), regionScrollbar.getY() + 100))
1
On

With Sikuli it's pretty easy to scroll I've done it already.

Use the wheel function

wheel(WHEEL_DOWN, 4)  # Scrolls down 4 times 
wheel(WHEEL_UP,   12) # Scrolls up   12 times