Scroll until

Asked by DH on 2021-04-29

sorry for this post. I've red many answers in this matter here on Launchpad but still I cant't get it working.

So I need to scroll until bottom of scroll.

This is what I've tried:

while True:
   if not exists(complete_scroll):

The problem is that the loop continues forever.

Question information

English Edit question
SikuliX Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Manfred Hampl (m-hampl) said : #1

What is complete_scroll? Is this an image that shows that you are at the end?

In that case your "if" statement is the wrong way round and probably must be

while True:
   if exists(complete_scroll):

Additional idea:
Is there a way to use a keyboard shortcut (e.g. Ctrl+End) to scroll down to the end?

DH (dh72) said : #2

"complete_scroll" is an image at the end of scroll in browser.

Tried your solution but Sikuli only clicked one time on scroll and exited.

Best masuo (masuo-ohara) said : #3

Let's recognize where sikuli find the image(complete scroll) on the screen.
Insert this codes after "while True" and run script, you will find out where it is.
If it's an unexpected location, try changing the image or changing the similarity.

m = exists(complete scroll)
if m:

DH (dh72) said : #4

Thanks masuo, that solved my question.