Skip to content

On Windows computer, The Wait_For is failing with exception pyautogui.ImageNotFoundException whereas the except is on ImageHorizonLibrary.errors.ImageNotFoundException #73

@FranckDijoux

Description

@FranckDijoux

Initial condition:

On Windows 11
install Robotframework 7.2.2
install robotframework-imagehorizonlibrary with pip3 install robotframework-imagehorizonlibrary

Action:

Run simple RF script like
${xy} Wait For .png 30

Problem:

Exception ImageNotFoundException is raised immediatly without waiting for the end of the timeout (30 sec in this example).

My First analysis:
The instruction
location = self._locate(reference_image, log_it=False)
is raising an exception pyautogui.ImageNotFoundException
whereas the try/except is catching the ImageHorizonLibrary.errors.ImageNotFoundException
so pyautogui.ImageNotFoundException is not catched and the Wait_For exited with ImageNotFoundException.

Expected behaviour:

No exception before the end of the timeout .

Current Workaround:

in file <My_Documents>\AppData\Local\Programs\Python\Python313\Lib\site-packages\ImageHorizonLibrary\recognition_recognize_images.py
ADD:
import pyautogui as ag

REPLACE:
except ImageNotFoundException:
WITH :
except ag.ImageNotFoundException: # "ImageHorizonLibrary.errors.ImageNotFoundException" is different from

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions