rainmanwy / robotframework-SikuliLibrary

Sikuli Robot Framework Library provide keywords for Robot Framework to test UI through Sikuli.
Apache License 2.0
144 stars 61 forks source link

Image file could not find #60

Open choosebest opened 6 years ago

choosebest commented 6 years ago

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

rainmanwy commented 6 years ago

@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.

RaiMan commented 6 years ago

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.

choosebest commented 6 years ago

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?

rainmanwy commented 6 years ago

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)

choosebest commented 6 years ago

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

rainmanwy commented 6 years ago

@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

choosebest commented 6 years ago

I created the header.PNG using the snipping tool.

bjanzen commented 6 years ago

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

RaiMan commented 6 years ago

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

Images should preferably be captured using the SikuliX IDE.

rainmanwy commented 6 years ago

@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.

Sonal1011 commented 2 years ago

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???

rainmanwy commented 2 years ago

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

rainmanwy commented 2 years ago

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

Sonal1011 commented 2 years ago

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_javastderr*.txt deleting them shows error java.io.IO exception cant delete.

rainmanwy commented 2 years ago

disable java process log file

EstevaoFPM commented 2 years ago

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!

rainmanwy commented 2 years ago

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

jongadev commented 1 year ago

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

edugitQA commented 6 months ago

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