← Back to team overview

sikuli-driver team mailing list archive

[Question #291150]: VNCScreen => How to click ?

 

New question #291150 on Sikuli:
https://answers.launchpad.net/sikuli/+question/291150

Following code works well until I try the click: 
I can see the mouse on the MAIN screen moving & clicking, not the one in the VNC session :-(
( You can see in trace what the click is done on the main screen )

Does vnc.click() is implemented ?
------------------------------------------------------------------------------

import shutil 
import os 

print ('Establish a VNC connection to %s on port %d' % ("frlesvmhostqa02",9105) )

import java.net.Socket as Socket
import edu.unh.iol.dlc.ConnectionController as ConnectionController

s = Socket("frlesvmhostqa02", 9105); #open a socket to vnc server on listening port
s.setSoTimeout(1000);
s.setKeepAlive(1); #some socket configuration

SocketList = []
SocketList.append(s)

cc = ConnectionController(SocketList);
cc.openConnection(0); #opens the vnc connection for connection 0, multiple are supported
cc.setPixelFormat(0, "Truecolor", 32, 0); #for connection 0, set pixel data to Truecolor, 32 bits per pixel, little endian
cc.start(0); #start thread that keeps BufferedImage updated by polling server for remote desktop changes

Sikuli.wait(2); #wait for buffered image to be updated before we do sikuli

import edu.unh.iol.dlc.VNCScreen as VNCScreen
vnc = VNCScreen()
print('Main Screen size is %d,%d' % (Region(SCREEN).getW(),Region(SCREEN).getH() ))
print('VNC  Screen size is %d,%d' % (vnc.getW(),vnc.getH() ))

vnc.showMonitors()

test = vnc.find("Next.png")
Larger = test.nearby(100)
img = vnc.capture(Larger)
shutil.move(img.getFile(), "f:/temp/test.png")

print ('BBBBBBBBBBBBBBBBBBBBBBB')
click(test)
print ('CCCCCCCCCCCCCCCCCCCCCCC')
vnc.click(test)
print ('DDDDDDDDDDDDDDDDDDDDDDD')

--------------------------------------------
output :

Establish a VNC connection to frlesvmhostqa02 on port 9105

Main Screen size is 1680,1050
VNC Screen size is 1280,768
[info] *** monitor configuration [ 1 VNCScreen(s)] ***
[info] *** Primary is VNCScreen 0
[info] Screen 0: S(0)[0,0 1280x768]
[info] *** end monitor configuration ***
AAAAAAAAAAAAAAAAAAAAAAA

BBBBBBBBBBBBBBBBBBBBBBB
[log] CLICK on L(885,589)@S(0)[0,0 1680x1050]

CCCCCCCCCCCCCCCCCCCCCCC
[log] CLICK on L(885,589)@S(0)[0,0 1680x1050]

DDDDDDDDDDDDDDDDDDDDDDD




-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.