exists command is not working in Win XP 64bit

Asked by Vidhya

Hii,

Previously exists command seems to work but at present this command is not working

when trying to capture new image then it is not working but previous scrips with exists command are working fine now also....

i am using Win XP 64bit with service pack 2.......checked in virtual machine 64bit also it is not working...

My script is:

setBundlePath("C:\\users\\xx\\Images") ## all images are saved in this folder

os = "winxp"

while True:
    r=exists(os+".image.png")
    if r:
       print("image found")
       break
    else:
       print("image not found")
       break

Result is image not found.......

but if i remove exists then it is ok result is image found...

and if i replace image in place of file name i.e., r=exists(image) then also it is ok....

I have checked saved images path it is fine.....

so please help me out what is the problem with exists command......

Thank u in advance

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Vidhya
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

reading your code, the resulting filename for the image to search is:

"C:\\users\\xx\\Images\\winxp.image.png"

Is this what you expect?

To find out what happens, just replace exists() with find(), since this would show the cause, if any exception is raised.

Only to check, wether the resulting filename works, try this:
import os
imgDir = "C:\\users\\xx\\Images"
print find(os.path.join(imgDir, "winxp.image.png")

Revision history for this message
Vidhya (vidhyadasari) said :
#2

Thanks Raiman,

Now it is ok.