Error received on example script from website

Asked by Demortes

I downloaded the clickstars.sikuli and tried running it. It kept doing nothing. Once I replaced the image of the star with one taken from my gmail screen, it now returns this error:

[sikuli] [Error] source lineNo: 2
[sikuli] [Error] Traceback (innermost last):
  File "C:\Users\Kevin\AppData\Local\Temp\sikuli-tmp3612676769496706837.py", line 2, in ?
  File "C:\Program Files\Sikuli\sikuli-ide-full.jar\Lib/python/edu/mit/csail/uid/Sikuli.py", line 381, in findAll
TypeError: findAll(): 1st arg can't be coerced to String

Any thoughts?

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Demortes
Solved:
Last query:
Last reply:
Revision history for this message
Demortes (demortes) said :
#1

switchApp("Mozilla Firefox")
xs = findAll( )
for x in xs:
      click(x)

----------------------------------------------
There is, ofcourse an image within the findAll function.

Revision history for this message
RaiMan (raimund-hocke) said :
#2

I found: findAll() gives this error, when there is a region as parm (looks like pic, but is not)

this runs perfectly:
switchApp("Safari")
xs = findAll(<image> )
for x in xs:
      print x # I use print in the first testing to see the matches in the message area, if ok turn it to clicks

<image> has to be produced with the left capture tool (foto camera)

Revision history for this message
Demortes (demortes) said :
#3

I redid the script copying and pasting from your script, and changed Safari to Firefox, it worked fine... so question is, why Firefox, not "Mozilla Firefox" based on the title bar as it indicates...

I'm on Windows 7 btw, I assume you're on Mac OS X :)

Revision history for this message
Maikel (romerete) said :
#4

I had the same problem. I took some screenshots and with one of them it worked. With the others it told me the same error:
TypeError: findAll(): 1st arg can't be coerced to String

May be a bug there? I'm on Windows XP SP3.