← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #242340]: How to handle when there are high similarity scores for enabled and disabled button Patterns?

 

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

RaiMan posted a new comment:
A solution is something that works with respect to the objectives ;-)
But there are many aspects of the solution, that can be discussed.

My solution is a bit more compact and delegates the waiting, comparing
and looping down to Sikuli.

Not knowing your concrete situation, I dare to say, that

Region reg = <some region containing the button>
reg.wait(btnEnabled, maxTime)

would do the job anyway:
If the button is already enabled, It would come back immediately.
Otherwise it would wait maxTime for the button to get enabled.

To directly support some workflow:

if (!reg.exists(btnEnabled, maxTime)) {
  // do something sensible if button does not get enabled within the given time
} else {
  click(reg.getLastMatch()
}

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.