FindFailed with VNCScreen

Asked by Aditya Basak on 2018-06-20

So, I have an image stored at a location "D:\\example.png" on my local computer.
I wish to perform a click on the part of the screen on my remote (here virtualBox) computer screen, which matches with "example.png".
This remote PC has a VNC Server (TigerVNC) installed and running on port 9876.
My connection to the VNC Server is working through Eclipse code, but the find is failing, although physically the match of "example.png" is available on the page.

I tried decreasing the similarity quotient but yet it fails.

Here is my code. :

VNCScreen client = VNCScreen.start(<ip-address>, <port>, <password>, 10, 1000);
try { Pattern("D:\\example.png").similar(0.5f));
catch (FindFailed e) {
finally {

The error message is :

CConnection: Using RFB protocol version 3.8
R[0,0 1024x768]@S(0) E:Y, T:3.0
FindFailed: D:/example.png: (84x31) in R[0,0 1024x768]@S(0) E:Y, T:3.0
  Line 2782, in file

So next to debug, I tried capturing the screen that Sikuli sees on connecting with the VNC with the following code :

ScreenImage image = client.capture(client);"D:\\");

The saved image, is a complete black screen with no items.
Can you point where I am going wrong?

Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
RaiMan (raimund-hocke) said : #1

Using latest SikuliX 1.1.3?

Running on what system?

Aditya Basak (aditya94) said : #2

Yes. Using Sikuli 1.1.3

Both the systems are on Windows 10. The code is written in Eclipse Oxygen.

RaiMan (raimund-hocke) said : #3

Do you get content with a VNCViewer?

Aditya Basak (aditya94) said : #4

Yes. VNCViewer works fine. Not only do I get content, but I can work pretty well on the remote.

RaiMan (raimund-hocke) said : #5

ok, thanks for information.

similar problem here:

... as mentioned there: takes some time for me to check.

Until I (may be) fixed it: what about working against the VNCViewer window as workaround?

Best RaiMan (raimund-hocke) said : #6

made a quick test in max local environment:
Server: TightVNC on a Windows 10 machine
Client: Mac running a script with latest 1.1.3

# script:
vs = vncStart("")

if not vs:
  print "no connection"

cap = vs.userCapture("gimmi")
img = "_vncscreen"


My findings:
Even in my local network, the initial fill of the frame buffer after the VNCScreen.start() takes about 1 second.
So without the wait(1) I get a black screen with the userCapture(), with it, the screen content is correct.

Doing a search with an image directly after the VNCScreen.start() works for me, because of the standard wait time of 3 seconds (in my case doing the vs.hover(img) directly after start)

so you might try this:
VNCScreen client = VNCScreen.start(<ip-address>, <port>, <password>, 10, 1000);
try {
 // Pattern("D:\\example.png").similar(0.5f));"D:\\example.png", 10));
catch (FindFailed e) {
finally {

... so adding some time to wait for the frame buffer to get filled the first time.

Aditya Basak (aditya94) said : #8

Thanks RaiMan, that solved my question.