← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #272154]: [1.1.0] Is there a way to integrate a (background) observer with wheel()?

 

Question #272154 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/272154

RaiMan posted a new comment:
I understand what you mean, but you have to always keep in mind how SikuliX works:
1. make a screenshot
2. search the image in the screenshot
3. stop the search if found else continue with 1 until max waitime is reached (then stop)

step 2 is the time consuming part here.
So if you do not somehow synchronize the wheeling and the search, in the "independent" solution the wheeling might overtake the searching and the target might be missed.

Looking from this perspective, the solution we have agreed on is a bit
risky, since even here the wheeling is in fact independent from the
search. The wheeling slowdown in the polling loop somehow "guarantees",
that the search gets a chance to grab all parts of the web-page. Hence
the faster the wheeling the greater the chance to miss the target.

The mentioned wheelDownUntilAppear("someImage") would have to be
implemented in a safe way anyways:

- find how much one wheel step moves the page
- calculate how many wheel steps it takes to move the page to the next part
- start loop
  - search
  - if found then stop
  - wheel down on sub-page

Only this approach assures, that under all circumstances the target is
matched, when it gets visible.

Another possibility would be to capture the complete page and calculate the amount of needed wheeling to make it visible (but this is only an option for web-pages using appropriate libraries) - hence not an option for SikuliX 
(would not be WhatYouSeeIsWhatYouScript)

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.