Image found failed after moving Junit test case to another same PC

Asked by jerry

I wrote a JUnit test case using sikulixapi.jar(get from sikulixsetup 1.1), however, when I let the case running on another same windows 7 client all the images cannot be found.

Below is the log:
[log] CLICK on L(109,252)@S(0)[0,0 1280x1024]
FindFailed: can not find delete2.PNG in S(0)[0,0 1280x1024]
  Line 2106, in file Region.java

 at org.sikuli.script.Region.handleFindFailedShowDialog(Region.java:2106)
 at org.sikuli.script.Region.handleFindFailed(Region.java:2051)
 at org.sikuli.script.Region.wait(Region.java:2249)
 at org.sikuli.script.Region.find(Region.java:2122)
 at org.sikuli.script.Region.getLocationFromTarget(Region.java:2718)
 at org.sikuli.script.Region.click(Region.java:3188)
 at org.sikuli.script.Region.click(Region.java:3173)
 at Test.HiTest._AddDelIndex_iNorm_01(HiTest.java:36)
 at Test.HiTest.test_AddDelIndex_iNorm_01(IndexTest.java:7)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at junit.framework.TestCase.runTest(TestCase.java:168)
 at junit.framework.TestCase.runBare(TestCase.java:134)
 at junit.framework.TestResult$1.protect(TestResult.java:110)
 at junit.framework.TestResult.runProtected(TestResult.java:128)
 at junit.framework.TestResult.run(TestResult.java:113)
 at junit.framework.TestCase.run(TestCase.java:124)
 at junit.framework.TestSuite.runTest(TestSuite.java:243)
 at junit.framework.TestSuite.run(TestSuite.java:238)
 at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
 at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
 at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

The two windows clients has the same monitor and the same resolution ratio.

Dose anyone else has encountered the issue?
Any help is appreciated.

Thx.

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

but there must be differences on the pixel level, that one might not realise when looking at the monitor:
anti-aliasing, shadows, theme differences, ....

compare an image and a shot on the other machine in an image viewer with some magnification, so you can see the pixels.

Revision history for this message
jerry (jr-zhao) said :
#2

Thanks RaiMan!

I compared the image and the shot, there are some pixels differences.

Is there any way I can do to resolve this issue or else I have to re-capture all the images ---- a lot of work :-(

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

Sorry, but currently no other way, than to make another set of images.

This problem will only be addressed later this year with version 2.

Revision history for this message
Eugene S (shragovich) said :
#4

Try to understand why your images are different. Maybe there are some settings that you can change that will make the required difference. For example:

Clear type
Smooth Edges

Clear type setting will change text appearance.
To disable/enable clear type, go to Control Panel -> Display ->Adjust ClearType text.

Smooth edges of screen fonts option must be disabled.
The option can be found at Control Panel -> System -> Advanced System Settings -> Settings (under Performance). Uncheck the “Smooth edges of screen fonts” option.

Revision history for this message
jerry (jr-zhao) said :
#5

Thanks Eugene for the detailed instruction.

I guess "Clear type" must be enabled, right?

Will have a try now.

Revision history for this message
Eugene S (shragovich) said :
#6

It might be enabled or disabled. What's important is that it will be the same on both systems!
What kind of differences in your images are you experiencing?
Can you provide a pair of patterns that look different?

Can you help with this problem?

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

To post a message you must log in.