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

Wait For Image - ignore @notWantedImage

Open SudPiva opened this issue 5 years ago • 3 comments

Using the keyword "Wait For Image" doesn't achieve what is it supposed to do. It ignores the image defined in @notWantedImage

made the same Keyword using exist and that works - doesnt have timeout :-( ` Image Not Visible

[Arguments]  ${yesImage}  ${noImage}  ${timeout}
Sleep    ${timeout}
${isExist} =       Exists    ${yesImage}
${isNotExist} =    Exists    ${noImage}
Should Be True               ${isExist}
Should Not Be True           ${isNotExist}

`

Using robotframework-SikuliLibrary 1.0.8

SudPiva avatar Oct 24 '19 13:10 SudPiva

@SudPiva , so in your environment, "wantedImage" and "notWantedImage" may exist at the same time, right?

I think "wantedImage" and "notWantedImage" are mutex each other, so when keyword find "wantedImage" and then return.

rainmanwy avatar Nov 11 '19 01:11 rainmanwy

@SudPiva , so in your environment, "wantedImage" and "notWantedImage" may exist at the same time, right?

I think "wantedImage" and "notWantedImage" are mutex each other, so when keyword find "wantedImage" and then return.

yes thay may exist at the same time. I was not sure from the description of that keyword if it supposed to work like that or not. So I guess to close this, if this is the wanted behavior.

SudPiva avatar Nov 11 '19 06:11 SudPiva

I think it should throw exception if there are "wantedImage" and "notWantedImage" found at the same time.

Could check if notWantedMatch == null before returning if wantedMatch is found. ...

if (wantedMatch != null && notWantedMatch == null) {
    return;
}

...

Similar fix should also be added to keyword "Wait For Multiple Images"

jpeltonen avatar Nov 11 '19 10:11 jpeltonen