Sikuli FindFailed error after waiting for an image Pattern on the screen

Asked by Petru Birgoveanu

Hi,

I am out of options to identify a Pattern image on the screen.
I took a screenshot of a username input text box along with the username naming on the left of the input field to ensure some unique way to identify it. On Windows 7, Sikuli can identify the picture and I can move to it, click it and enter text. However, on Windows 10, I tried multiple screen captures of that input filed and it's as if it's invisible to Sikuli.

In short, I execute code like this:
//I initialize the Pattern
private static final Pattern WIN10_CHROME_INTERSTITIAL_USERNAME_INPUT_SELECTED = new Pattern(.....\src\test\resources\testImages\windowsSecurityInterstitialPopUp\chrome\Win10ChromeSelectedUserNameInput3.png)

//On the Security page I do this:
Screen screen = new Screen();
Settings.setShowActions(true);
screen.wait(
                                    WIN10_CHROME_INTERSTITIAL_USERNAME_INPUT_SELECTED.similar((float) 0.50),
                                    5
                            );

And I always get :

FindFailed: .....\src\test\resources\testImages\windowsSecurityInterstitialPopUp\chrome\Win10ChromeSelectedUserNameInput3.png: (532x51) in R[0,0 1536x864]@S(0)
  Line 2222, in file Region.java

I'm stuck... If anyone can provide and kind of help, I would greatly appreciate it.

Regards,
Peter

Question information

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

Have you checked in the SikuliX IDE with the Preview pane?

Using the latest SikuliX version?

Revision history for this message
Petru Birgoveanu (masterofmysea) said :
#2

I have just tried using SikuliX IDE 2.0.4 - manually creating the flow from the beginning and it works flawlessly. I don't understand what I should check with the Preview pane though. Maybe that's some way to debug that I am not aware of?

Still I think I'm doing the same thing as in the IDE with sikulixapi 2.0.4 maven dependency (Only that I am using selenium for most of the steps before a certain page and then some Sikuli code only for interacting with a Windows security pop-up that Selenium can't interact with). I don't understand what's wrong, given that I'm doing the same thing on Windows 7 (with a different Pattern picture) and it works. Is there any way to get more insight into what the problem could be?

Revision history for this message
RaiMan (raimund-hocke) said :
#3

With IDE's Preview feature you can check, wether an image is found with a given score and you can adjust the borders.

You might send me the offending image and a related screenshot (where the image should be found) to sikulix---at---outlook---dot---com

Revision history for this message
Petru Birgoveanu (masterofmysea) said :
#4

Hi RaiMan! Thanks for trying to help. I've sent you an email with the details.
Looking forward to your reply.

Revision history for this message
Petru Birgoveanu (masterofmysea) said :
#5

Hey, I'm still stuck here. Did you get a chance to look into this issue?
I need to understand whether I'm doing something wrong or this is a bug related to sikulixapi 2.0.4 which will take more time fixing, case in which I need to search for some other tool to help me interact with those windows security pop-ups on windows 10 from the code. I am at your disposal to try anything to debug this on my side. Please help.

Revision history for this message
RaiMan (raimund-hocke) said :
#6

Sorry for the delay - private priorities.
Hope till Monday.

Revision history for this message
RaiMan (raimund-hocke) said :
#7

The images you sent me all work on the given screenshot shown in a viewer on Windows and Mac, but with a rather low score (0.75 to 0.85).

The image with only the text "Username" should work in any case. The others might be critical caused by the blinking cursor in the text field.

The most secure way to get the input focus into a text field is to work with an image that is found with a high score and then use the term
text1 = Pattern(reliableImage).targetOffset(x, y)

This can easily be done in the IDE preview.

start with
username = <shot of the text Username>

then add the targetoffset using Preview

and finally
type(username, "some text")

same for the password field.

Can you help with this problem?

Provide an answer of your own, or ask Petru Birgoveanu for more information if necessary.

To post a message you must log in.