You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to click a page element using a BufferedImage pattern to detect it. The check for the pattern using screen.has(botDetected) is working fine when the element is present, but when I try to click that element, I get a FindFailed error.
My code looks something like this:
BufferedImage image = ImageIO.read(this.getClass().getClassLoader().getResourceAsStream("press_hold.png"));
Pattern botDetected = new Pattern(image);
.....
String webContent = getPageContent(currentURL);
if (screen.has(botDetected)) {
System.out.println("Element is present");
screen.click(botDetected);
}
.......
The error I get, when calling screen.click(botDetected); is:
FindFailed: __BufferedImage__: (267x118) seen at (176, 343) with 1.00 in R[0,0 1920x954]@S(0)
Line 2226, in file Region.java
I use sikulixapi 2.0.5, with selenium-java 4.14.1 in a spring app with OpenJDK 17.
Any idea what is going on?
Thanks
The text was updated successfully, but these errors were encountered:
Surely a problem of visibility (window to be searched in should be in front).
In debug mode the Eclipse window comes back to front when arriving at breakpoints.
Make sure that at least the relevant part of the window stays visible all the time or run with 2 monitors.
I'm trying to click a page element using a BufferedImage pattern to detect it. The check for the pattern using
screen.has(botDetected)
is working fine when the element is present, but when I try to click that element, I get a FindFailed error.My code looks something like this:
The error I get, when calling
screen.click(botDetected);
is:I use sikulixapi 2.0.5, with selenium-java 4.14.1 in a spring app with OpenJDK 17.
Any idea what is going on?
Thanks
The text was updated successfully, but these errors were encountered: