[1.1.0] OS X 10.10: Location: outside any screen in multi-monitor setup

Bug #1386862 reported by Luis Jacinto on 2014-10-28
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Sikuli
High
RaiMan

Bug Description

Sikulix API Version: 1.1.0
Yosemite 64 bits

I'm developing a solution on Java with Sikuli, with two monitors, on Mac OS after I updated to Yosemite I began to get the next errors message:
error] Location: outside any screen (-2560, 0) - subsequent actions might not work as expected
[error] Location: outside any screen (-2560, 0) - subsequent actions might not work as expected
[error] Location: outside any screen (-1484, 153) - subsequent actions might not work as expected

I've make changes to Display settings and update to Java 1.8 JDK and JRE
I use this method to get the Screen ID:

public static int getCurrentScreenId(Pattern pattern) throws Exception
 {
  int result = 0;

  for (int i = 0; i <= 1; i++)
  {
   System.out.println("Try number " + i);
   if (new Screen(i).exists(pattern) != null)
   {
    System.out.println("Searching on Screen: " + i);
    result = i;
    System.out.println("Screen founded =" + result);

   }
   else
   {
    continue;
   }

  }
  return result;
 }
NOTE: on Yosemite the screen 0 (default) is the monitor connected to the machine, if you unplugged the monitor then the screen(0) is the screen machine.

RaiMan (raimund-hocke) wrote :

could you run it with
Debug.setDebugLevel=3

at the very beginning of your main and send me the log output silently to my mail at https://launchpad.net/~raimund-hocke with ref to this bug.

summary: - After Yosemite update on Mac appears error] Location: outside any
- screen
+ [1.1.0] OS X 10.10: Location: outside any screen in multi-monitor setup
Changed in sikuli:
status: New → In Progress
importance: Undecided → High
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.0
Luis Jacinto (luisj81) wrote :

This error occurs also in Windows , Windows 8.1)

Everything is ok while the coordinate do not change:
Region: exists: waiting 3.0 secs for P(images/Windows/TomSawyerPerspectives/CommonImageMapPreview/ToolBar/WebCommonToolBar.png) S: 0.8 to appear in S(1)[-1360,0 1360x768]
Region: find: waiting 3.0 secs for images\Windows\TomSawyerPerspectives\CommonCanvasPreview\ToolBar\CircularLayoutCanvas.png to appear in S(1)[-1360,0 1360x768]
Region: exists: waiting 3.0 secs for P(images/Windows/SocialNetworkAnalysis/HtmlCanvas/SecondaryScreen/CircularExpected.png) S: 0.8 to appear in S(1)[-1360,0 1360x768]
Region: find: waiting 3.0 secs for images\Windows\TomSawyerPerspectives\CommonCanvasPreview\ToolBar\HierarchicalLayoutCanvas.png to appear in S(1)[0,0 1360x768]--- coordinate changed*******

All my tests are only one screen.
The question is why is different the coordinate after some tests? from -1360,0 to 0,0
Do I have to get the first coordinate and then set it for each test? (I'm using JUnit)

Regards!

RaiMan (raimund-hocke) wrote :

OK, thanks for the information.

could you send me the code snippet around the last working exists() and the failing find().

Something must trigger the coordinate change.
Without seeing the code, I have no idea.

You might send it silently to my mail at https://launchpad.net/~raimund-hocke if you do not want to post it publicly.

Luis Jacinto (luisj81) wrote :
Download full text (7.9 KiB)

Hi this is the log on Yosemite:

*******TestOnMouseHoverOrthogonalLayout*******
Coordinates for x =-2560
Coordinates for y =0
x= -2560
x= 0
[debug] Image: loaded: images/Mac/TomSawyerPerspectives/CommonCanvasPreview/ToolBar/OrthogonalLayoutCanvas.png (file:/Users/ljacinto/Documents/workspace/SikuliSeleniumJava/images/Mac/TomSawyerPerspectives/CommonCanvasPreview/ToolBar/OrthogonalLayoutCanvas.png)
[debug] Image: cached: images/Mac/TomSawyerPerspectives/CommonCanvasPreview/ToolBar/OrthogonalLayoutCanvas.png (1 KB) (# 9 KB 108 -- 0 % of 64 MB)
[debug] Region: hover: P(images/Mac/TomSawyerPerspectives/CommonCanvasPreview/ToolBar/OrthogonalLayoutCanvas.png) S: 0.4
[debug] Region: find: waiting 3.0 secs for P(images/Mac/TomSawyerPerspectives/CommonCanvasPreview/ToolBar/OrthogonalLayoutCanvas.png) S: 0.4 to appear in S(1)[-2560,0 2560x1440]
[debug] Region: find: P(images/Mac/TomSawyerPerspectives/CommonCanvasPreview/ToolBar/OrthogonalLayoutCanvas.png) S: 0.4 has appeared
at M[-1604,83 27x25]@S(S(1)[-2560,0 2560x1440]) S:1.00 C:-1591,95 [836/835 msec]
Script paused for: 1500
Searching image for validationimages/Mac/TomSawyerPerspectives/CommonCanvasPreview/HoverToolTips/OrthogonalLayout.png
[debug] Image: loaded: images/Mac/TomSawyerPerspectives/CommonCanvasPreview/HoverToolTips/OrthogonalLayout.png (file:/Users/ljacinto/Documents/workspace/SikuliSeleniumJava/images/Mac/TomSawyerPerspectives/CommonCanvasPreview/HoverToolTips/OrthogonalLayout.png)
[debug] Image: cached: images/Mac/TomSawyerPerspectives/CommonCanvasPreview/HoverToolTips/OrthogonalLayout.png (4 KB) (# 10 KB 112 -- 0 % of 64 MB)
[debug] Region: exists: waiting 3.0 secs for P(images/Mac/TomSawyerPerspectives/CommonCanvasPreview/HoverToolTips/OrthogonalLayout.png) S: 0.6 to appear in S(1)[-2560,0 2560x1440]
[debug] Region: exists: P(images/Mac/TomSawyerPerspectives/CommonCanvasPreview/HoverToolTips/OrthogonalLayout.png) S: 0.6 has not appeared [1599 msec]
[debug] FileManager: tempfile create:
/var/folders/z5/kycxdqnx1nsg46fwx1g101pdwpbsln/T/Sikulix/sikuli-6755377293243039222.png
Saving Evidence in: images/Mac/SocialNetworkAnalysis/Evidence/TestSikuliTSSocialNetworkHtml5PreviewTesttestOnMouseHoverOrthogonalLayout.png
*******TestOnMouseHoverDegreeCentralityLayout*******
Coordinates for x =-2560
Coordinates for y =0
x= -2560
x= 0
[debug] Image: loaded: images/Mac/TomSawyerPerspectives/CommonCanvasPreview/ToolBar/DegreeCentralityCanvas.png (file:/Users/ljacinto/Documents/workspace/SikuliSeleniumJava/images/Mac/TomSawyerPerspectives/CommonCanvasPreview/ToolBar/DegreeCentralityCanvas.png)
[debug] Image: cached: images/Mac/TomSawyerPerspectives/CommonCanvasPreview/ToolBar/DegreeCentralityCanvas.png (1 KB) (# 11 KB 114 -- 0 % of 64 MB)
[debug] Region: hover: P(images/Mac/TomSawyerPerspectives/CommonCanvasPreview/ToolBar/DegreeCentralityCanvas.png) S: 0.4
[debug] Region: find: waiting 3.0 secs for P(images/Mac/TomSawyerPerspectives/CommonCanvasPreview/ToolBar/DegreeCentralityCanvas.png) S: 0.4 to appear in S(1)[0,0 2560x1440]
[error] Location: outside any screen (-2560, 0) - subsequent actions might not work as expected
[error] Location: outside any screen (-2560, 0) - subsequent actions might no...

Read more...

RaiMan (raimund-hocke) wrote :

well, thanks for the code and log.

Does not shed more light on the problem though.

The same functions are used with different images in both cases.

... and at the beginning of onMouseHoverImageMap the correct x-value for automationTesterCurrentScreen is reported.

... but when stepping down one line later into
automationTesterCurrentScreen.hover(new Pattern(patternStringPath).similar(new Float(0.4)));

the shit happens, without any intermediate action, that might be responsible for the change.

So the problem must have been produced before.
The last find in testOnMouseHoverOrthogonalLayout fails and triggers your function TSAutomationUtils.getScreenShot.

- please paste this code?
- what happens, if you comment this line out, so it is not called?

Luis Jacinto (luisj81) wrote :

Hi!
Bingo! Tha problem is with the getScreenShot method if I send the parameters (x,y,w,h) so I change it for getScreenShot(Region r) and that seem to be the solution, I'll test this change on Mac and I'll report you.
Thanks a lot fpr your help

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers