robotframework-SikuliLibrary icon indicating copy to clipboard operation
robotframework-SikuliLibrary copied to clipboard

Image file could not find

Open choosebest opened this issue 7 years ago • 19 comments

*** Settings *** Suite Setup Start Sikuli Process Suite Teardown Stop Remote Server Library SikuliLibrary mode=NEW

*** Test Cases *** Click Demo Add Image Path ${CURDIR}/img Exists header.PNG Exists AppPlaces.PNG Capture Screen Wait Until Screen Contain header.PNG 5 Click AppPlaces.PNG

Here is my Click example code, pretty much same from the SikuliLibrary document. The Exists keyword found those image files OK and verified that the screen capture has the header image in it but got the following error

FAIL com.github.rainmanwy.robotframework.sikulilib.exceptions.TimeoutException: Timeout happend, could not find header.PNG

debug-20180201-104221.txt

choosebest avatar Feb 01 '18 18:02 choosebest

@choosebest , “Exists” keyword will return "True" or "False" to confirm whether could match in screen. from your attached file, i do not know the return value. you may check robot log file, and get detail.

rainmanwy avatar Feb 02 '18 01:02 rainmanwy

May be you should use Wait Until Screen Contain header.PNG ... after the Click Demo

Using Exists without checking the result does not make sense.

RaiMan avatar Feb 02 '18 10:02 RaiMan

Exists returned "False" Wait Unitl Screen Contain header.PNG timed out after 10 sec Then where should I put those image files? or what to fix on this simple demo Robot file?

choosebest avatar Feb 05 '18 16:02 choosebest

Images should be in folders which add by "Add Image Path". So in your env, it should be in "img" foler.

Guess the error messages confused you. " Timeout happend, could not find header.PNG" not mean header.PNG not found in "img" folder, but not found in the Screen.

So could you attach header.PNG, and the whole screen captured image here(if keyword failed, this library will capture whole screen for troubleshooting)

rainmanwy avatar Feb 06 '18 09:02 rainmanwy

I set & exported the img env variable but the same error. Attached the header.PNG and the whole screen captured by sikuli

header

sikuliximage-1517938844240

choosebest avatar Feb 06 '18 17:02 choosebest

@choosebest, how do you get header.PNG, could you have a try to create it again? When i use the header.PNG to search in whole screen image, it not works.

s.run_keyword('get_match_score', ['header.PNG'], {}) Params: [header.PNG] Could not find header.PNG 0.0

rainmanwy avatar Feb 07 '18 08:02 rainmanwy

I created the header.PNG using the snipping tool.

choosebest avatar Feb 07 '18 19:02 choosebest

Does header.PNG have an alpha channel? Those haven't worked well with Sikuli in the past, for obvious reasons.

bjanzen avatar Feb 09 '18 18:02 bjanzen

@bjanzen good point, since he used some snipping tool.

Images should preferably be captured using the SikuliX IDE.

RaiMan avatar Feb 09 '18 18:02 RaiMan

@RaiMan @bjanzen , thank you all. So this problem is related with the snipping tool which @choosebest used.

@choosebest, have you tried Sikulix IDE as @RaiMan suggested, or other snipping tool.

rainmanwy avatar Feb 13 '18 01:02 rainmanwy

Dear @rainmanwy : I am having the sam eproblem , I have captured the images using SikuliX IDE the add path step is ok but then it doesnot finds the images inside it , do Ineed to set any environmental variables???

Sonal1011 avatar May 09 '22 16:05 Sonal1011

@Sonal1011 , could you attach the error log and images here?

rainmanwy avatar May 10 '22 08:05 rainmanwy

@Sonal1011 , could you attach the error log and images here?

rainmanwy avatar May 10 '22 08:05 rainmanwy

Hallo @rainmanwy : I am glad to inform you that the issueis resolved now . the error was : TimeoutException: Timeout happened, could not find P sikuli error solution found : spaces in the file name referenced as Image Path but it works fine Thanks a lot for ur attention ! Also could you help me deleting the unwanted files generated with each run named: Sikuli_java_stderr_*.txt deleting them shows error java.io.IO exception cant delete.

Sonal1011 avatar May 10 '22 11:05 Sonal1011

Guys,

I still haven't been able to solve the problem. The file name is out of space. Even so, the error remains: if

com.github.rainmanwy.robotframework.sikulilib.exceptions.TimeoutException: Timeout happened, could not find P(test.png) S: 0.699999988079071

What do I do? I'm almost giving up on Sikuli and going to Autoit... =//

Help me please! It's hard to see... =/ @rainmanwy and @RaiMan !!

Thanks advance!

EstevaoFPM avatar May 17 '22 12:05 EstevaoFPM

As @bjanzen suggested, you could use sikuli IDE to capture the images. And if it is ok, could you attach detail logs here?

rainmanwy avatar May 27 '22 08:05 rainmanwy

Good afternoon @rainmanwy , I'm having the same problem, I'm using Sikuli IDE, to capture images, they are not have spaces, but it doesn't work at all, can you help me?

2022-10-14_14h59_17

jongadev avatar Oct 14 '22 18:10 jongadev

Geralmente, diminuindo a resolução da tela vai funcionar

edugitQA avatar Mar 18 '24 02:03 edugitQA