SikuliX2.0.1 - checkMousePosition Error - Mouse clicking at incorrect location

Asked by Garima Priya

System Specifications - Windows 10, x64, java version "1.8.0_231"
sikulixapi2.0.1.jar (added in referenced libraries)

I am working on Eclipse(2019-12). I took an image of File on Eclipse UI only and tried to click it using Sikuli.

ISSUE- Click does not happen on the actual image - "File", instead the mouse moves towards File but clicks somewhat below the actual "File" area/region to be clicked.

OUTPUT -- (with checkMousePosition Error)
[log] highlight M[0,34 42x31]On(0) S 10000 for 0.0 secs
[error] RobotDesktop: checkMousePosition: should be L[21,49]@S(0)
but after move is L[20,50]@S(0)
Possible cause in case you did not touch the mouse while script was running:
 Mouse actions are blocked generally or by the frontmost application.
You might try to run the SikuliX stuff as admin.
[log] CLICK on L[21,49]@S(0) (544 msec)

CODE
package utg_regression;

import org.sikuli.basics.Debug;
import org.sikuli.script.Match;
import org.sikuli.script.Pattern;
import org.sikuli.script.Screen;

public class SikuliTest {

 public static void main(String[] args) throws InterruptedException {
  // TODO Auto-generated method stub

  Screen screen = new Screen();

  Pattern pattern = new Pattern("C:\\Users\\gp0924\\Desktop\\LatestSikuliImages\\File");

  Match match = screen.exists(pattern);
  if (null != match) {
   match.highlight(); // already logs the match
   match.click(); // do not search again
  } else {
   Debug.error("Not found: ", match);
  }

 }

}

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

Is your environment according to the bug?
https://bugs.launchpad.net/sikuli/+bug/1730645

Revision history for this message
Garima Priya (garimapriya89) said :
#2

Yes, I believe somewhat it is related to the bug mentioned above.
JAVA - 1.8.0_231
Windows 10, x64, sikulixapi2.0.1.jar (added in referenced libraries - Eclipse 2019-12)
Resolution - 1920 * 1080 (recommended)
Scaling - 150% (recommended)

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

Try the possible workarounds mentioned in the bug comment #1

We have to live with this problem, until it is solved in Java.

Can you help with this problem?

Provide an answer of your own, or ask Garima Priya for more information if necessary.

To post a message you must log in.