Runs on one box and does not run on another box (vmware)

Asked by Selva

Hi,
I have creates some testcases in Sikuli. I have to run the same in my local and remote boxes. The remote box may have the different resolution but I am not sure.
Some of the testcases are running perfectly in both boxes and some testcases are failing on identifying the image as
FindFailed: can not find B:\REEE_SLC07LOY_VIEW\ptqa\Version_1_1.PNG in S(0)[0,0 1280x1024]
  Line 2106, in file Region.java

(1) The screen shot shows the image exists on the page
(2) I have added hard wait of 3 secs, hence there will be no synchronization issue
(3) the code look like
Screen scr=new Screen();
Vision.setParameter("MinTargetSize", 18);

if(scr.find(sImagePath).isValid()){
  System.out.println("Object found withtthe path "+sImagePath);
  int x=scr.click(sImagePath);
  System.out.println("Done with"+x);
  return true;
 }
else
 {Logger.WriteLog("", "{{Element Not Found}}", "Info", "The looked for Element is not found -"+sImagePath);
  return false;
 }

This is the code snippet. This used to work fine locally but fails in remote vmware.
Even in remote box, some other images clicked with this code. hence I assume there will be some issue to find the object.

Both are win 7 boxes .

Note - When I simulate error, the location box is shown as
S(0)[0,0 1920x1080]
does this cause the isue and if so, how can I provide tolerance for resolution

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

Usually these kind of problems are due to different rendering (caused by whatever) in the other environment (which might be due to a different resolution).

The images have to be shown on the screen equal on the pixel level (at least width and height must be the same, other aspects like shadows or different edges (anti-aliasing) might reduce the score).

So check the images on the pixel level with some viewer, that can magnify.

If the pixel level differs dramatically, currently the only approach is to have different image sets for differing environments.

Revision history for this message
Selva (ganapathy-selva) said :
#2

Thnaks, I will try .

Will you please clarify on the following?

(1) When I run the same image locally even in the 'other environment', it is clicking on the image based on the present image description. The way the code was invoked is through calling the code through Web application.

(2) When rendering is the issue, will it not impact all the images being opened on the same box but how some of the work.

Mean time, I will look at your suggestion.

(3) If I reduce the score, will it work and what is the propability?

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

at (1)
as I understood, you started locally, where everything works.
then you went to some other scenario and some of the images could not be found.
So you have to check, wether these not-found-images have something in common with respect to possible differences in presentation on the screen, some window or generally GUI part (I call it rendering).

at (2)
see 1

at (3)
you have to try that.
reducing the score below 0.7 (the standard) will raise the risk for false positives dramatically.
the risk can be reduced by using restricted regions (where the visual should be found) and some double checking.

Revision history for this message
Selva (ganapathy-selva) said :
#4

Hi RaiMan,
I have tried the following but did not work out.
(1) The resolution of the remote box is 1280x1024 aand I have changed the resolution of my local box from 1920x1080 to 1280x1024 and captured the new image.
However this again did not work in the remote box. Hence I did not think resolution would be the issue.

(2) I created a region with the broader image but the match of the same itself failed in remote box but passes locally.

Hence I did a work around . I used Screen.scr.type(Key.DOWN); and proceeded .
But I am curious to get the solution for FindFailed.

Thanks

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

thanks for your trials.

But currently I do not have any chance to help you with the evaluation of this problem, since I cannot see and reproduce what you are doing/seeing.

I am planning to add some better visual debugging features into version 2.

Can you help with this problem?

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

To post a message you must log in.