findAll function is not returning any results though match preview indicates it should
I am currently writing a script where the object is to find a certain image on a page. Once the image is found, the page resets and it needs to find this image again. Because the image is quite small, sikuli will sometimes interpret other graphical elements as being the image. As such, I need to find a way to prevent my mouse from clicking the same place over and over.
In order to avoid this occuring, this is how my script was built (the region is declared earlier):
x = Large.find(Found) #finding the first searchable in level
y = x #storing position of searchable for later comparison
click(x)
sleep(1)
while Large.exists(
x = Large.find(Found) #current new position
print(x,y)
if x == y:
with Large.findAll(
while m.hasNext():
else:
x = Large.find(Found)
y = x #resetting y value to new x position
else:
wait(
click(
The issue that I am encountering is that the findAll() in line 14 won't always find items even when the matching preview indicates that some should be found. It also generally does not find the proper amount of matches. The following error appears in the output:
[error] Error message: Traceback (most recent call last):
File "C:\Users\
if x == y:
Line 30, in file C:\Users\
at org.sikuli.
at org.sikuli.
at sun.reflect.
at sun.reflect.
at java.lang.
org.sikuli.
Line 30, in file C:\Users\
I'm not sure if the error is in the coding or if it's an issue with the pattern recognition.
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Michel Aubinais for more information if necessary.